/* Member referral app (/m/:token) and public review page (/rv/:slug).
   --acc / --on are set per network in the page <head>. */
:root {
  --acc: #ffdb3a;
  --on: #ffffff;
  /* iOS system grouped background + label colors */
  --bg: #f2f2f7;
  --card: #ffffff;
  --ink: #000000;
  --muted: #6e6e73;
  --tab-muted: #8e8e93;
  --line: rgba(60, 60, 67, 0.12);
  --navy: #13213a;
  --acc-soft: color-mix(in srgb, var(--acc) 14%, white);
  --acc-ink: color-mix(in srgb, var(--acc) 80%, black);
  --radius: 20px;
  --tabbar-h: 50px;
  /* Review FAB rises ~half above the bar via margin-top. */
  --tabbar-fab-overhang: 26px;
  /* Small air so the last row clears the frosted bar + FAB — keep tight to avoid a tall empty shelf. */
  --tabbar-content-gap: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  /* SF Pro on Apple devices; Inter/Manrope elsewhere */
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", Manrope, Inter, ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}

/* Forced / resolved theme via html[data-ma-theme]. Early script in _head sets this. */
html[data-ma-theme="dark"] {
  --bg: #000000;
  --card: #1c1c1e;
  --ink: #ffffff;
  /* Slightly brighter than iOS secondary so labels/hints stay readable on --card. */
  --muted: #b0b0b5;
  --tab-muted: #9a9aa0;
  --line: rgba(84, 84, 88, 0.45);
  --acc-soft: color-mix(in srgb, var(--acc) 24%, #1c1c1e);
  --acc-ink: color-mix(in srgb, var(--acc) 70%, white);
  color-scheme: dark;
}
html[data-ma-theme="light"] {
  color-scheme: light;
}

/* Branding preview iframe: lay out as on an iPhone with a Dynamic Island and home indicator. */
html.ma-preview { --safe-t: 54px; --safe-b: 34px; scrollbar-width: none; }
html.ma-preview::-webkit-scrollbar { display: none; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  height: 100%;
  height: -webkit-fill-available;
  /* Match tab bar so any home-indicator / overscroll bleed is white, not gray */
  background: var(--card);
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}
a { color: inherit; }
h1, h2, h3, .ma-display { font-family: var(--font-display); letter-spacing: -0.02em; }
/* Controls behave like native ones: no text selection or long-press callouts. */
.ma-tabbar, .ma-tile, .ma-btn, .ma-seg, .ma-hero, .ma-top { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/*
 * Lock the document to the visible viewport when the tab bar is present.
 * On iOS PWAs, position:fixed + 100vh can leave a phantom gap under the bar;
 * scrolling inside .ma-shell keeps bottom:0 glued to the real screen edge.
 */
body:has(> .ma-tabbar) {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  height: -webkit-fill-available;
  overflow: hidden;
  overscroll-behavior: none;
  /* Same paint as the tab bar so nothing under the home indicator reads as a gray strip */
  background: var(--card);
}
body:has(> .ma-tabbar) .ma-shell {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  background: var(--bg);
}

.ma-shell {
  max-width: 480px;
  margin: 0 auto;
  padding:
    calc(var(--safe-t) + 14px)
    18px
    calc(var(--tabbar-h) + var(--tabbar-fab-overhang) + var(--tabbar-content-gap) + var(--safe-b));
  /* Keep focused/scrolled rows above the raised Review FAB. */
  scroll-padding-bottom:
    calc(var(--tabbar-h) + var(--tabbar-fab-overhang) + var(--tabbar-content-gap) + var(--safe-b));
}
.ma-shell--plain { padding-bottom: calc(var(--safe-b) + 32px); }
/* Last accordion must clear the floating Review star. */
.ma-shell > .ma-fold:last-of-type {
  margin-bottom: 8px;
}

/* Top bar */
.ma-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.ma-top__title { font-size: 15px; font-weight: 600; color: var(--muted); margin: 0; }
.ma-top__brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* Accent-backed PWA icon — matches Home badge / Home Screen tile. */
.ma-top__logo { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; background: var(--acc); }
.ma-avatar {
  width: 34px; height: 34px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--acc); color: var(--on); font-weight: 800; font-size: 13px; flex-shrink: 0;
  overflow: hidden; text-decoration: none; position: relative;
  box-shadow: 0 0 0 0 transparent; transition: box-shadow 0.12s ease, transform 0.12s ease;
}
a.ma-avatar:active { transform: scale(0.94); }
a.ma-avatar:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
a.ma-avatar.is-on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--acc); }
.ma-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ma-avatar--lg {
  width: 56px; height: 56px; font-size: 22px; border-radius: 999px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.1);
}
.ma-profile-hero {
  display: flex; align-items: center; gap: 12px; margin: 4px 0 16px;
}
.ma-profile-hero__name { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 18px; line-height: 1.2; }
.ma-profile-hero__sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.ma-settings-list { display: flex; flex-direction: column; gap: 0; }
a.ma-settings-row,
button.ma-settings-row,
summary.ma-settings-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  padding: 10px 2px;
  border-radius: 10px;
  min-height: 44px;
  width: 100%;
  max-width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}
a.ma-settings-row:active,
button.ma-settings-row:active,
summary.ma-settings-row:active {
  background: color-mix(in srgb, var(--muted) 10%, transparent);
}
.ma-settings-row__icon {
  flex: 0 0 28px;
  width: 28px !important;
  height: 28px !important;
  max-width: 28px;
  max-height: 28px;
  border-radius: 8px;
  background: var(--acc-soft);
  color: var(--acc);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ma-settings-row__icon svg {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px;
  max-height: 14px;
  display: block;
  flex-shrink: 0;
}
.ma-settings-row__text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ma-settings-row__text strong {
  font-size: 14px;
  font-weight: 700;
  display: block;
}
.ma-settings-row__text span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.3;
  display: block;
}
.ma-settings-row__chev {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  color: var(--tab-muted);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}
.ma-settings-row__chev svg {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px;
  max-height: 16px;
  display: block;
}
.ma-top__actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
/* 44pt hit target around a 36px visual circle */
.ma-iconbtn {
  position: relative; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--acc); text-decoration: none; border-radius: 999px; flex-shrink: 0;
  border: 0; padding: 0; margin: 0; background: transparent; font: inherit; cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.ma-iconbtn::before { content: ""; position: absolute; inset: 4px; border-radius: 999px; background: var(--acc-soft); transition: transform 0.12s ease; }
.ma-iconbtn svg { position: relative; width: 20px; height: 20px; }
.ma-iconbtn:active::before { transform: scale(0.92); }
.ma-iconbtn.is-on::before, .ma-iconbtn--fill::before { background: var(--acc); }
.ma-iconbtn.is-on, .ma-iconbtn--fill { color: var(--on); }
.ma-iconbtn:focus-visible { outline: 2px solid var(--acc); outline-offset: 0; }
.ma-top__back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin-left: -8px; padding-right: 8px; color: var(--acc); text-decoration: none; font-size: 17px; font-weight: 500; min-width: 0; }
.ma-top__back svg { width: 24px; height: 24px; flex-shrink: 0; }
.ma-top__back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Lead / referral notification bell (member app — not the workspace CRM bell) */
.ma-bell { position: relative; flex-shrink: 0; z-index: 80; }
.ma-bell__btn { position: relative; }
.ma-bell__ping {
  position: absolute; top: 10px; right: 10px; width: 8px; height: 8px;
  border-radius: 999px; background: #ef4444; box-shadow: 0 0 0 2px var(--card);
  pointer-events: none;
}
.ma-bell__ping:not([hidden]) { animation: ma-bell-pulse 1.4s ease-in-out infinite; }
@keyframes ma-bell-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.75; }
}
/* Dim the page so the pull-down reads as a real menu, not glass over Home. */
.ma-bell__scrim {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(15, 23, 42, 0.42);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.ma-bell__panel {
  /* Fixed so shell overflow / stacking cannot punch through the fill. */
  position: fixed;
  top: calc(var(--safe-t) + 58px);
  left: 12px;
  right: 12px;
  z-index: 80;
  width: auto;
  max-width: 420px;
  margin: 0 auto;
  /* Literal opaque fills — never rely on translucent mixes for the surface. */
  background: #ffffff;
  color: var(--ink);
  border: 1px solid rgba(60, 60, 67, 0.18);
  border-radius: 18px;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  isolation: isolate;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  animation: ma-bell-down 0.18s ease-out;
}
@keyframes ma-bell-down {
  from { transform: translateY(-10px); opacity: 0.88; }
  to { transform: none; opacity: 1; }
}
html[data-ma-theme="dark"] .ma-bell__panel {
  background: #2c2c2e;
  border-color: rgba(84, 84, 88, 0.55);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.55);
}
html[data-ma-theme="dark"] .ma-bell__scrim {
  background: rgba(0, 0, 0, 0.55);
}
.ma-bell__head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  background: #ffffff;
}
html[data-ma-theme="dark"] .ma-bell__head { background: #2c2c2e; }
.ma-bell__head h2 {
  margin: 0; font-size: 11px; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ma-bell__close {
  border: 0; background: color-mix(in srgb, var(--muted) 14%, transparent);
  color: var(--muted); font-size: 16px;
  width: 32px; height: 32px; border-radius: 999px; cursor: pointer;
}
.ma-bell__list {
  max-height: min(42vh, 280px); overflow-y: auto;
  background: #ffffff;
}
html[data-ma-theme="dark"] .ma-bell__list { background: #2c2c2e; }
.ma-bell__empty {
  margin: 0; padding: 28px 16px; text-align: center;
  color: var(--muted); font-size: 12px; font-style: italic;
  background: inherit;
}
.ma-bell__item {
  display: block; padding: 12px 16px; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}
html[data-ma-theme="dark"] .ma-bell__item { background: #2c2c2e; }
.ma-bell__item:active { background: var(--acc-soft); }
.ma-bell__item.is-unread {
  background: color-mix(in srgb, var(--acc) 12%, #ffffff);
}
html[data-ma-theme="dark"] .ma-bell__item.is-unread {
  background: color-mix(in srgb, var(--acc) 16%, #2c2c2e);
}
.ma-bell__item strong { display: block; font-size: 13px; font-weight: 800; line-height: 1.25; }
.ma-bell__item span { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); line-height: 1.35; }
.ma-bell__item small {
  display: block; margin-top: 6px; font-size: 10px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--acc);
}
.ma-bell__section {
  margin: 0; padding: 10px 16px 4px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); background: inherit;
}
.ma-bell__item--ghl { cursor: default; }
.ma-bell__ghl-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  margin-top: 8px;
}
.ma-bell__ghl-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 28px; padding: 0 10px; border-radius: 999px;
  background: var(--acc); color: #fff; text-decoration: none;
  font-size: 9px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
}
.ma-bell__ghl-link {
  border: 0; background: transparent; cursor: pointer;
  padding: 6px 8px; text-decoration: none; color: var(--muted);
  font-size: 9px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
}
.ma-bell__ghl {
  padding: 12px 16px; border-top: 1px solid var(--line);
  background: #ffffff;
}
html[data-ma-theme="dark"] .ma-bell__ghl { background: #2c2c2e; }
.ma-bell__ghl-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  cursor: pointer;
}
.ma-bell__ghl-copy {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.ma-bell__ghl-copy strong {
  font-size: 12px; font-weight: 800; line-height: 1.25;
}
.ma-bell__ghl-copy span {
  font-size: 11px; line-height: 1.35; color: var(--muted);
}
.ma-bell__ghl-row input[type="checkbox"] {
  width: 44px; height: 28px; flex-shrink: 0;
  appearance: none; -webkit-appearance: none;
  border-radius: 999px; border: 0; cursor: pointer;
  background: color-mix(in srgb, var(--muted) 35%, #e5e7eb);
  position: relative; transition: background 0.15s ease;
}
.ma-bell__ghl-row input[type="checkbox"]::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 999px;
  background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 0.15s ease;
}
.ma-bell__ghl-row input[type="checkbox"]:checked {
  background: var(--acc);
}
.ma-bell__ghl-row input[type="checkbox"]:checked::after {
  transform: translateX(16px);
}
.ma-bell__ghl-row input[type="checkbox"]:disabled { opacity: 0.55; cursor: default; }
.ma-bell__ghl[hidden] { display: none !important; }
.ma-bell__push {
  padding: 12px 16px; border-top: 1px solid var(--line);
  background: #ffffff;
}
html[data-ma-theme="dark"] .ma-bell__push { background: #2c2c2e; }
.ma-bell__push-btn {
  width: 100%; min-height: 44px; border-radius: 12px; cursor: pointer;
  border: 2px solid color-mix(in srgb, var(--acc) 55%, #38bdf8);
  background: #ffffff; color: var(--ink);
  font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
}
html[data-ma-theme="dark"] .ma-bell__push-btn { background: #2c2c2e; }
.ma-bell__push-btn:disabled { opacity: 0.6; cursor: default; }
.ma-bell__push-status {
  margin: 8px 0 0; text-align: center; font-size: 11px; line-height: 1.4; color: var(--muted);
}
.ma-bell__push-off {
  display: block; width: 100%; margin-top: 6px; border: 0; background: transparent;
  color: var(--muted); font-size: 11px; font-weight: 700; text-decoration: underline;
  cursor: pointer; padding: 6px;
}
.ma-bell__push-off[hidden],
.ma-bell__panel[hidden],
.ma-bell__scrim[hidden],
.ma-bell__ping[hidden] { display: none !important; }
.ma-bell__foot {
  padding: 12px 16px; border-top: 1px solid var(--line); text-align: center;
  background: #f2f2f7;
}
html[data-ma-theme="dark"] .ma-bell__foot { background: #1c1c1e; }
.ma-bell__foot a {
  font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--acc); text-decoration: none;
}
body.ma-bell-open .ma-shell { pointer-events: none; }
body.ma-bell-open .ma-bell { pointer-events: auto; }

.ma-hello { margin: 10px 0 16px; }
/* iOS large title */
.ma-hello h1 { font-size: 34px; font-weight: 700; margin: 0; line-height: 1.12; letter-spacing: -0.025em; }
.ma-hello p { margin: 4px 0 0; font-weight: 600; font-size: 15px; }
.ma-hello p em { font-style: normal; color: var(--acc); }

.ma-page-title { font-size: 24px; font-weight: 800; margin: 16px 0 4px; }
.ma-page-sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }

/* Hero */
.ma-hero { position: relative; border-radius: 24px; overflow: hidden; min-height: 250px; margin-bottom: 16px; background: linear-gradient(135deg, var(--acc), var(--navy)); box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14); }
.ma-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ma-hero__upload { position: absolute; top: 12px; right: 12px; z-index: 3; margin: 0; }
.ma-hero__upload-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 999px; cursor: pointer;
  color: #fff; background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.28); box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
  transition: transform 0.12s ease, background 0.12s ease;
}
.ma-hero__upload-btn:active { transform: scale(0.94); background: rgba(15, 23, 42, 0.72); }
.ma-hero__upload-btn svg { width: 22px; height: 22px; }
.ma-hero__upload-btn input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.ma-hero__card {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  color: #fff; border-radius: 18px; padding: 14px 16px;
  /* Light glass — keep the banner photo readable (same art used in review shares) */
  background: rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 8px 20px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  backdrop-filter: saturate(120%) blur(6px);
  -webkit-backdrop-filter: saturate(120%) blur(6px);
}
.ma-hero__row { display: flex; align-items: center; gap: 10px; }
.ma-hero__badge {
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
/* Accent-backed PWA icon (not raw pale logo on white) so light marks stay visible. */
.ma-hero__badge img { width: 100%; height: 100%; object-fit: cover; background: var(--acc); }
.ma-hero__badge svg { width: 18px; height: 18px; color: var(--acc); }
.ma-hero__name {
  font-weight: 800; font-size: 15px; margin: 0; line-height: 1.2;
  text-shadow: 0 1px 3px rgba(15, 23, 42, 0.55), 0 0 12px rgba(15, 23, 42, 0.35);
}
.ma-hero__sub {
  font-size: 11px; color: rgba(255, 255, 255, 0.92); margin: 1px 0 0;
  text-shadow: 0 1px 3px rgba(15, 23, 42, 0.5);
}
.ma-hero__stat {
  margin: 10px 0 0; font-family: var(--font-display); font-weight: 900;
  font-size: 34px; line-height: 1; letter-spacing: -0.02em;
  text-shadow: 0 1px 4px rgba(15, 23, 42, 0.55), 0 0 14px rgba(15, 23, 42, 0.3);
}
.ma-hero__stat small {
  font-family: var(--font-text); font-size: 11px; font-weight: 700;
  color: rgba(255, 255, 255, 0.95); letter-spacing: 0; margin-left: 6px;
}
.ma-hero__label {
  margin: 6px 0 0; font-size: 11px; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 3px rgba(15, 23, 42, 0.5);
}

/* Stat tiles */
.ma-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ma-tile {
  display: block; text-decoration: none; background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.05); border: 1px solid var(--line);
  transition: transform 0.15s ease;
}
.ma-tile:active { transform: scale(0.98); }
.ma-tile__icon { width: 36px; height: 36px; border-radius: 11px; background: var(--acc-soft); color: var(--acc); display: inline-flex; align-items: center; justify-content: center; }
.ma-tile__icon svg { width: 18px; height: 18px; }
.ma-tile__value { font-family: var(--font-display); font-size: 30px; font-weight: 800; margin: 12px 0 0; line-height: 1; font-variant-numeric: tabular-nums; }
.ma-tile__label { margin: 6px 0 0; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* Cards, lists */
.ma-section { margin-top: 22px; }
.ma-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ma-section__head h2 { font-size: 17px; font-weight: 800; margin: 0; }
.ma-section__head a { font-size: 13px; font-weight: 700; color: var(--acc); text-decoration: none; }

/* Collapsible setup sections — keep primary send form calm */
.ma-fold {
  margin-top: 10px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  overflow: hidden;
}
.ma-fold > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  -webkit-user-select: none;
  user-select: none;
}
.ma-fold > summary::-webkit-details-marker { display: none; }
.ma-fold > summary::after {
  content: '';
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  margin-top: -4px;
}
.ma-fold[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.ma-fold__hint {
  margin-left: auto;
  margin-right: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
}
.ma-fold__body { padding: 0 12px 14px; }
/* SMS script: keep link hint fully above Save (no overlap / clipped URL). */
.ma-fold__body form.ma-card--flush {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: visible;
}
.ma-fold__body form.ma-card--flush .ma-field { margin-bottom: 0; }
.ma-script-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 2px;
  margin: 0;
}
.ma-script-link__url {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: break-all;
}
.ma-script-save {
  margin-top: 4px;
  margin-bottom: 28px; /* clear raised Review FAB when the fold is open */
  flex-shrink: 0;
  /* Solid accent — reads as the primary action in the SMS script fold */
  box-shadow: 0 6px 16px color-mix(in srgb, var(--acc) 35%, transparent);
}
.ma-script-save:active {
  transform: scale(0.98);
}
.ma-qr__ask:active {
  transform: scale(0.98);
}
.ma-fold[open] > .ma-fold__body {
  padding-bottom: 28px;
}
.ma-fold--inset {
  margin-top: 4px;
  background: color-mix(in srgb, var(--muted) 8%, transparent);
  border-style: dashed;
}
.ma-fold--inset > summary { min-height: 44px; font-size: 14px; padding: 10px 12px; }
/* Share contact: invite fold sits under teammate picker */
#maCustomerShare .ma-fold--inset,
#maJobShare .ma-fold--inset {
  margin-top: 14px;
}
.ma-card--flush { box-shadow: none; border: 0; background: transparent; padding: 4px 2px 0; margin: 0; }
.ma-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.ma-card + .ma-card { margin-top: 10px; }
/* iOS dark mode separates surfaces by color, not outlines. */
html[data-ma-theme="dark"] .ma-tile, html[data-ma-theme="dark"] .ma-card, html[data-ma-theme="dark"] .ma-seg, html[data-ma-theme="dark"] .rv-link { border-color: transparent; box-shadow: none; }

.ma-card__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ma-card__title { font-weight: 800; font-size: 15px; margin: 0; }
.ma-card__meta { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.ma-card__note { font-size: 14px; margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.ma-empty { text-align: center; color: var(--muted); padding: 28px 16px; font-size: 14px; }
.ma-empty > svg { width: 24px; height: 24px; color: var(--acc); margin-bottom: 6px; }
/* Tap empty-states: icon beside the message (not stacked). */
.ma-empty--tap {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 16px;
  text-decoration: none;
}
.ma-empty--tap > svg {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  margin: 0;
  color: var(--acc);
}
.ma-empty--tap > p { margin: 0; flex: 1 1 auto; min-width: 0; line-height: 1.35; }
/* Closed-by-default import fold; List/Calendar/Pending pills sit under it. */
.ma-cust-tools.ma-fold {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  border-radius: 10px;
}
/* Thin strip — match the List/Calendar/Pending bar height. */
.ma-cust-tools.ma-fold > summary {
  box-sizing: border-box;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  gap: 8px;
}
.ma-cust-tools.ma-fold > summary::after {
  width: 7px;
  height: 7px;
  margin-top: -3px;
}
.ma-cust-tools.ma-fold[open] > summary {
  height: auto;
  max-height: none;
  min-height: 36px;
  padding: 8px 12px;
}
.ma-cust-tools.ma-fold[open] > summary::after {
  margin-top: 1px;
}
.ma-cust-tools.ma-fold > .ma-fold__body {
  padding-top: 2px;
}
.ma-cust-tools__lead { margin: 0 0 8px; }
.ma-cust-tools__form { margin: 0; }
a.ma-settings-row.is-locked {
  opacity: 0.55;
  cursor: pointer;
  pointer-events: auto;
}
a.ma-settings-row.is-locked:active { opacity: 0.45; }
.ma-settings-row__upgrade {
  flex: 0 0 auto;
  margin-left: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ma-cust-tools__import { margin: 0; border: 0; }
.ma-cust-tools__import > summary.ma-settings-row {
  list-style: none;
  cursor: pointer;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
}
.ma-cust-tools__import > summary::-webkit-details-marker,
.ma-cust-tools__import > summary::marker { display: none; content: ""; }
.ma-cust-tools__import[open] > summary .ma-settings-row__chev {
  transform: rotate(90deg);
}
.ma-cust-tools__import .ma-settings-row__chev {
  transition: transform 0.15s ease;
}
.ma-cust-tools__body {
  margin: 4px 0 8px;
  padding: 12px;
  display: grid;
  gap: 10px;
  border-radius: 14px;
  background: var(--bg);
}
.ma-empty .ma-btn {
  margin-left: auto;
  margin-right: auto;
}
.ma-empty .ma-btn svg { width: 16px; height: 16px; }

.ma-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 800; white-space: nowrap; background: rgba(148, 163, 184, 0.16); color: var(--muted); }
.ma-pill--sent, .ma-pill--pending { background: rgba(59, 130, 246, 0.13); color: #2563eb; }
.ma-pill--accepted, .ma-pill--booked { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.ma-pill--won, .ma-pill--approved { background: rgba(16, 185, 129, 0.14); color: #047857; }
.ma-pill--declined, .ma-pill--lost, .ma-pill--unrouted, .ma-pill--rejected { background: rgba(225, 29, 72, 0.1); color: #be123c; }
html[data-ma-theme="dark"] .ma-pill--sent, html[data-ma-theme="dark"] .ma-pill--pending { color: #93c5fd; }
  html[data-ma-theme="dark"] .ma-pill--accepted, html[data-ma-theme="dark"] .ma-pill--booked { color: #fcd34d; }
  html[data-ma-theme="dark"] .ma-pill--won, html[data-ma-theme="dark"] .ma-pill--approved { color: #6ee7b7; }
  html[data-ma-theme="dark"] .ma-pill--declined, html[data-ma-theme="dark"] .ma-pill--lost, html[data-ma-theme="dark"] .ma-pill--unrouted, html[data-ma-theme="dark"] .ma-pill--rejected { color: #fda4af; }


/* Segmented control */
.ma-seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 14px; }
.ma-seg a,
.ma-seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  text-align: center; text-decoration: none; font: inherit; font-weight: 800; font-size: 13px;
  padding: 9px 6px; border-radius: 999px; color: var(--muted);
  border: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none;
}
.ma-seg a svg,
.ma-seg button svg { width: 15px; height: 15px; flex-shrink: 0; }
.ma-seg a.is-on,
.ma-seg button.is-on { background: var(--acc); color: var(--on); }
.ma-seg--2 { grid-template-columns: 1fr 1fr; }
.ma-seg--3 { grid-template-columns: repeat(3, 1fr); }

/* Customers tab */
.ma-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 4px; }
.ma-titlebar .ma-page-title { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ma-search { position: relative; margin-bottom: 12px; }
.ma-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.ma-search .ma-input { padding: 10px 12px 10px 38px; border-radius: 12px; background: color-mix(in srgb, var(--muted) 12%, var(--card)); border-color: transparent; }

/* GHL call + SMS history on a synced customer profile */
.ma-ghl-feed {
  list-style: none; margin: 0; padding: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.ma-ghl-feed__item {
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.ma-ghl-feed__item:last-child { border-bottom: 0; }
.ma-ghl-feed__item--inbound { border-left: 3px solid var(--acc); }
.ma-ghl-feed__item--outbound { border-left: 3px solid color-mix(in srgb, var(--muted) 45%, transparent); }
.ma-ghl-feed__meta {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.ma-ghl-feed__meta strong { font-size: 14px; font-weight: 800; }
.ma-ghl-feed__meta span { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.ma-ghl-feed__body {
  margin: 6px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ma-ghl-feed__open {
  display: inline-block; margin-top: 8px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--acc); text-decoration: none;
}
.ma-ghl-feed__item--call .ma-ghl-feed__meta strong { color: var(--acc-ink, var(--ink)); }

/* iOS inset grouped list */
.ma-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.ma-list + .ma-list__label { margin-top: 14px; }
.ma-list__label { margin: 6px 4px 6px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ma-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 60px; text-decoration: none; color: inherit; position: relative; }
/* Class display:flex would otherwise beat the UA [hidden] rule and leave filtered rows visible. */
.ma-row[hidden],
.ma-list[hidden],
.ma-empty[hidden] { display: none !important; }
.ma-list > .ma-row + .ma-row::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; border-top: 1px solid var(--line); }
a.ma-row:active { background: color-mix(in srgb, var(--muted) 10%, transparent); }
.ma-row__avatar, .ma-row__date {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--acc-soft); color: var(--acc-ink); font-weight: 800; font-size: 15px; line-height: 1;
}
.ma-row__avatar svg, .ma-row__date svg { width: 18px; height: 18px; color: var(--acc); }
.ma-row__date b { font-family: var(--font-display); font-size: 16px; }
.ma-row__date small { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; color: var(--acc); }
.ma-row__date.is-late { background: rgba(225, 29, 72, 0.12); color: #be123c; }
.ma-row__date.is-late small { color: #be123c; }
.ma-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ma-row__title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ma-row__meta { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ma-row__end { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.ma-row__end small { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.ma-row__end form { margin: 0; }
.ma-row--split { flex-direction: column; align-items: stretch; gap: 0; padding: 0; }
.ma-row--split > .ma-row { padding: 14px 14px 8px; align-items: flex-start; }
.ma-row--readable .ma-row__title {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
}
.ma-row--readable .ma-row__meta {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  margin-top: 3px;
  line-height: 1.35;
}
.ma-row__quick {
  display: flex; justify-content: stretch;
  padding: 0 14px 14px; margin: 0;
}
.ma-row__quick .ma-btn {
  width: 100%; min-height: 44px; padding: 10px 14px;
  justify-content: center; font-weight: 800;
}
.ma-row__quick .ma-btn svg { width: 16px; height: 16px; }
.ma-count { display: inline-flex; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; align-items: center; justify-content: center; font-size: 12px; background: var(--acc-soft); color: var(--acc-ink); vertical-align: 2px; margin-left: 4px; }
.ma-section--first { margin-top: 4px; }
.ma-empty:not(.ma-empty--tap) p { margin: 4px 0 0; }
.ma-newcust[hidden] { display: none; }

.ma-pill--job-lead { background: rgba(148, 163, 184, 0.18); color: #475569; }
.ma-pill--job-estimate { background: rgba(139, 92, 246, 0.13); color: #6d28d9; }
.ma-pill--job-scheduled { background: rgba(59, 130, 246, 0.13); color: #2563eb; }
.ma-pill--job-in_progress { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.ma-pill--job-completed { background: rgba(16, 185, 129, 0.14); color: #047857; }
.ma-pill--job-on_hold { background: rgba(100, 116, 139, 0.14); color: #64748b; }
.ma-pill--job-cancelled { background: rgba(225, 29, 72, 0.1); color: #be123c; }
html[data-ma-theme="dark"] .ma-pill--job-lead { color: #cbd5e1; }
  html[data-ma-theme="dark"] .ma-pill--job-estimate { color: #c4b5fd; }
  html[data-ma-theme="dark"] .ma-pill--job-scheduled { color: #93c5fd; }
  html[data-ma-theme="dark"] .ma-pill--job-in_progress { color: #fcd34d; }
  html[data-ma-theme="dark"] .ma-pill--job-completed { color: #6ee7b7; }
  html[data-ma-theme="dark"] .ma-pill--job-on_hold { color: #94a3b8; }
  html[data-ma-theme="dark"] .ma-pill--job-cancelled { color: #fda4af; }
  html[data-ma-theme="dark"] .ma-row__date.is-late, html[data-ma-theme="dark"] .ma-row__date.is-late small { color: #fda4af; }
  html[data-ma-theme="dark"] .ma-list { border-color: transparent; box-shadow: none; }


/* Month calendar — large cells on phone and desktop */
.ma-cal { padding: 12px 10px 14px; }
.ma-cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ma-cal__head h2 { font-size: 18px; font-weight: 800; margin: 0; }
.ma-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; row-gap: 6px; }
.ma-cal__dow { text-align: center; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 6px 0 4px; }
.ma-cal__day {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px;
  min-height: 58px; padding: 6px 2px 8px;
  border-radius: 14px; border: 1px solid transparent; background: color-mix(in srgb, var(--muted) 6%, transparent);
  text-decoration: none; color: var(--ink); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums;
  -webkit-user-select: none; user-select: none;
}
.ma-cal__day span { width: 36px; height: 36px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }
.ma-cal__day.is-out { color: color-mix(in srgb, var(--muted) 55%, transparent); background: transparent; }
.ma-cal__day.is-today { border-color: color-mix(in srgb, var(--acc) 55%, transparent); }
.ma-cal__day.is-today span { color: var(--acc); font-weight: 800; }
.ma-cal__day.is-sel { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 14%, transparent); }
.ma-cal__day.is-sel span { background: var(--acc); color: var(--on); font-weight: 800; }
.ma-cal__day.is-today.is-sel span { color: var(--on); }
.ma-cal__dots { display: flex; gap: 3px; height: 6px; font-style: normal; margin-top: auto; }
.ma-cal__dots b { width: 6px; height: 6px; border-radius: 999px; background: var(--acc); }
.ma-cal__dots.is-done b { background: var(--muted); }
@media (min-width: 420px) {
  .ma-cal__day { min-height: 68px; }
  .ma-cal__day span { width: 40px; height: 40px; }
}
@media (min-width: 720px) {
  .ma-cal { padding: 16px 14px 18px; }
  .ma-cal__head h2 { font-size: 22px; }
  .ma-cal__grid { gap: 8px; row-gap: 8px; }
  .ma-cal__dow { font-size: 12px; padding: 8px 0 6px; }
  .ma-cal__day { min-height: 88px; padding: 10px 6px 12px; border-radius: 16px; font-size: 18px; }
  .ma-cal__day span { width: 44px; height: 44px; }
  .ma-cal__dots b { width: 7px; height: 7px; }
}

/* Customer quick actions + job status stepper */
.ma-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 4px; }
.ma-quick__form { margin: 0; min-width: 0; }
.ma-quick__form .ma-quick__btn { width: 100%; cursor: pointer; font: inherit; }
.ma-quick__btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; min-height: 60px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); color: var(--acc); text-decoration: none; font-size: 12px; font-weight: 700;
  -webkit-user-select: none; user-select: none;
}
.ma-quick__btn svg { width: 22px; height: 22px; color: var(--acc); }
/* Labels follow theme ink (black in light, white in dark); icons stay accent. */
.ma-quick__btn span { color: var(--ink); font-weight: 700; }
.ma-quick__btn.is-off { color: var(--muted); opacity: 0.45; pointer-events: none; }
.ma-quick__btn.is-off span { color: var(--muted); }
.ma-quick__btn:disabled { color: var(--muted); opacity: 0.45; cursor: default; }
.ma-steps { display: flex; gap: 6px; overflow-x: auto; margin: 4px -18px 12px; padding: 4px 18px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ma-steps::-webkit-scrollbar { display: none; }
.ma-step {
  flex-shrink: 0; font: inherit; font-size: 13px; font-weight: 700; min-height: 36px; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--muted) 30%, transparent); background: var(--card); color: var(--ink);
  transition: background .12s ease, color .12s ease, border-color .12s ease, transform .12s ease;
}
.ma-step:active { transform: scale(0.96); }
.ma-step.is-on { background: var(--acc); border-color: var(--acc); color: var(--on); }
.ma-steps.is-saving .ma-step.is-on { box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 28%, transparent); }
.ma-steps.is-error .ma-step.is-on,
.ma-row__quick.is-error .ma-btn { box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.28); }
.ma-row--split.is-advancing { pointer-events: none; opacity: 0.72; }
html[data-ma-theme="dark"] .ma-quick__btn { border-color: transparent; }


/* Forms */
.ma-field { margin-bottom: 12px; }
.ma-label { display: block; font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 6px; }
.ma-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ma-label-row .ma-label { margin-bottom: 0; }
.ma-label-link { font-size: 12px; font-weight: 700; color: var(--acc); text-decoration: none; white-space: nowrap; }
.ma-label-link:hover { text-decoration: underline; }

/* Customer tags (GHL 2-way; search + create) */
.ma-tags { overflow: visible; }
.ma-tags__list { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 0; }
.ma-tags__list:has(.ma-tags__chip) { min-height: 44px; }
.ma-tags__empty { width: 100%; margin: 0; }
.ma-tags__chip {
  --ma-tag: var(--acc);
  display: inline-flex; flex-direction: row; align-items: center; gap: 2px;
  min-height: 44px; max-width: 100%;
  border: 1px solid color-mix(in srgb, var(--ma-tag) 55%, transparent);
  /* Mix with --card so dark mode stays dark (not pastel-on-white + white ink). */
  background: color-mix(in srgb, var(--ma-tag) 22%, var(--card));
  border-radius: 999px; padding: 4px 4px 4px 14px; box-sizing: border-box;
}
.ma-tags__chip-name {
  font-size: 14px; font-weight: 800; color: var(--ink);
  padding-right: 4px; line-height: 1.2;
}
.ma-tags__chip-remove {
  display: inline-flex; margin: 0; padding: 0; border: 0; background: transparent;
}
.ma-tags__chip-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 0; border-radius: 999px;
  background: color-mix(in srgb, var(--ma-tag) 28%, var(--card));
  color: var(--ink); font: inherit; font-size: 22px;
  font-weight: 700; line-height: 1; cursor: pointer;
}
.ma-tags__chip-x:hover, .ma-tags__chip-x:focus-visible {
  background: color-mix(in srgb, var(--ma-tag) 40%, var(--card)); outline: none;
}
.ma-tags__search { margin-top: 12px; }
.ma-tags__search-form .ma-label { margin-bottom: 8px; }
.ma-tags__submit { margin-top: 12px; }
.ma-tags__suggest {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 16px 0 0; padding: 0; list-style: none;
}
.ma-tags__suggest-item form { margin: 0; }
.ma-tags__suggest[hidden] { display: none !important; }
.ma-tags__chip.is-pending { opacity: 0.72; }
.ma-tags__suggest-item { margin: 0; }
.ma-tags__suggest-btn {
  --ma-tag: var(--acc);
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 10px 14px; border-radius: 999px;
  border: 1.5px dashed color-mix(in srgb, var(--ma-tag) 55%, var(--muted));
  background: var(--card); color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
}
.ma-tags__suggest-btn:hover { background: color-mix(in srgb, var(--ma-tag) 14%, var(--card)); }
html[data-ma-theme="dark"] .ma-tags__chip {
  background: color-mix(in srgb, var(--ma-tag) 36%, var(--card));
}
html[data-ma-theme="dark"] .ma-tags__chip-x {
  background: color-mix(in srgb, var(--ma-tag) 42%, var(--card));
}
html[data-ma-theme="dark"] .ma-tags__chip-x:hover,
html[data-ma-theme="dark"] .ma-tags__chip-x:focus-visible {
  background: color-mix(in srgb, var(--ma-tag) 55%, var(--card));
}
html[data-ma-theme="dark"] .ma-tags__suggest-btn {
  background: color-mix(in srgb, var(--ma-tag) 22%, var(--card));
}
html[data-ma-theme="dark"] .ma-tags__suggest-btn:hover {
  background: color-mix(in srgb, var(--ma-tag) 32%, var(--card));
}
.ma-tags .ma-typeahead { overflow: visible; }
/* Inline (not absolute) so suggestions aren't clipped by the scroll shell / keyboard */
.ma-tags .ma-typeahead__list {
  position: static; left: auto; right: auto; top: auto;
  margin: 10px 0 0; max-height: min(240px, 40vh);
  box-shadow: none;
}
.ma-tags .ma-typeahead__item {
  padding: 14px; font-size: 15px; min-height: 48px;
  display: flex; align-items: center;
}
.ma-input, .ma-select, .ma-textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--card);
  border: 1px solid color-mix(in srgb, var(--muted) 35%, transparent); border-radius: 14px; padding: 12px 14px; outline: none;
  -webkit-appearance: none; appearance: none;
}
.ma-input::placeholder, .ma-textarea::placeholder {
  color: var(--muted);
  opacity: 0.55;
  font-style: italic;
}
/* Empty keyword defaults — dashed border so placeholders are not mistaken for saved values. */
.ma-input.ma-input--unset {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--acc) 45%, transparent);
}
#rvKeywordsPreview[data-empty="1"] {
  color: var(--danger, #f87171);
}
.ma-select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.ma-input:focus, .ma-select:focus, .ma-textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 22%, transparent); }
.ma-textarea { min-height: 88px; resize: vertical; }
.ma-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ma-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 600; margin: 6px 0 14px; }
.ma-check input { width: 20px; height: 20px; accent-color: var(--acc); margin-top: 1px; flex-shrink: 0; }
.ma-hint { font-size: 12px; color: var(--muted); margin: 4px 0 0; }

/* Customer typeahead (review ask + pickers) */
.ma-typeahead { position: relative; }
.ma-label__hint {
  font-weight: 650;
  color: color-mix(in srgb, var(--muted) 85%, transparent);
  text-transform: none;
  letter-spacing: 0;
}
.ma-ask-selected {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--acc) 45%, var(--line));
  background: color-mix(in srgb, var(--acc) 8%, var(--card));
}
.ma-ask-selected[hidden] { display: none !important; }
.ma-ask-selected__avatar {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--acc-soft);
  color: var(--acc-ink);
  font-weight: 800;
  font-size: 15px;
}
.ma-ask-selected__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ma-ask-selected__body strong {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ma-ask-selected__body span {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ma-ask-selected .ma-btn { flex-shrink: 0; }
.ma-typeahead__list {
  position: absolute;
  z-index: 40;
  left: 0; right: 0; top: calc(100% + 4px);
  margin: 0; padding: 6px;
  list-style: none;
  max-height: min(280px, 45vh);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--muted) 28%, transparent);
  background: var(--card);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}
.ma-typeahead__item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ma-typeahead__item:hover,
.ma-typeahead__item.is-active {
  background: var(--acc-soft);
  color: var(--acc-ink);
}
.ma-typeahead__item--new {
  font-weight: 800;
  color: var(--acc-ink);
  border-bottom: 1px solid color-mix(in srgb, var(--muted) 18%, transparent);
  border-radius: 10px 10px 0 0;
  margin-bottom: 4px;
  white-space: normal;
}
.ma-typeahead__empty {
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.ma-typeahead__item.is-off {
  opacity: 0.55;
  cursor: not-allowed;
}
.ma-typeahead__item.is-off:hover,
.ma-typeahead__item.is-off.is-active {
  background: transparent;
  color: var(--ink);
}
.ma-share-mate-pick [data-ma-share-search][hidden],
.ma-share-mate-pick [data-ma-share-selected][hidden] {
  display: none !important;
}
/* Inline (not absolute) so partner results aren't clipped by the scroll shell / keyboard */
.ma-share-mate-pick .ma-typeahead { overflow: visible; }
.ma-share-mate-pick .ma-typeahead__list {
  position: static;
  left: auto;
  right: auto;
  top: auto;
  margin: 10px 0 0;
  max-height: min(240px, 40vh);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  box-shadow: none;
}
[data-ma-share-submit]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ma-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none;
  font: inherit; font-weight: 800; font-size: 15px; border-radius: 999px; padding: 13px 18px; min-height: 48px;
  background: var(--acc); color: var(--on);
}
.ma-btn--block { width: 100%; }
.ma-btn--ghost { background: transparent; color: var(--ink); border: 1px solid color-mix(in srgb, var(--muted) 35%, transparent); }
.ma-btn--soft { background: var(--acc-soft); color: var(--acc-ink); }
.ma-btn--danger { background: transparent; color: #e11d48; border: 1px solid rgba(225, 29, 72, 0.3); }
.ma-btn--sm { min-height: 38px; padding: 8px 14px; font-size: 13px; }
.ma-btn svg { width: 18px; height: 18px; }
.ma-btn[disabled], .ma-btn[aria-busy='true'] {
  opacity: 0.72;
  cursor: wait;
  pointer-events: none;
}
.ma-btn[aria-busy='true']::after {
  content: "";
  width: 14px; height: 14px; margin-left: 2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: ma-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes ma-spin { to { transform: rotate(360deg); } }
.ma-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ma-actions form { margin: 0; }
.ma-inline { display: flex; gap: 8px; align-items: center; }
.ma-inline .ma-input { padding: 9px 12px; min-height: 38px; }

.ma-flash { border-radius: 14px; padding: 12px 14px; font-size: 14px; font-weight: 600; margin: 12px 0; }
.ma-flash--ok { background: rgba(16, 185, 129, 0.12); color: #047857; }
.ma-flash--err { background: rgba(245, 158, 11, 0.15); color: #92400e; }

/* Freemium: request lead packs (Network / Leads) */
.ma-upgrade {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  padding: 28px 20px 22px;
  opacity: 0.92;
}
.ma-upgrade__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--acc) 16%, var(--bg));
  color: var(--acc);
  opacity: 0.7;
}
.ma-upgrade__icon svg { width: 22px; height: 22px; display: block; }
.ma-upgrade strong {
  font-size: 17px;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}
.ma-upgrade p {
  margin: 0;
  max-width: 28rem;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.4;
}
.ma-upgrade__btn { margin-top: 8px; max-width: 260px; }

/* Free members: Join tab (Audible-style plan / benefits) */
.ma-join__eyebrow {
  margin: 4px 0 0;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ma-join__title { text-align: center; margin-top: 6px; }
.ma-join__lead { text-align: center; max-width: 22rem; margin-left: auto; margin-right: auto; }
.ma-join-card {
  margin: 18px 0 12px;
  padding: 18px 18px 20px;
  border-radius: 22px;
  border: 2px solid color-mix(in srgb, var(--acc) 55%, var(--line));
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--acc) 12%, var(--card)) 0%, var(--card) 48%);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--ink) 6%, transparent);
}
.ma-join-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.ma-join-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--acc) 45%, var(--line));
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--acc-ink);
  background: color-mix(in srgb, var(--acc) 14%, transparent);
}
.ma-join-card__sel {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid var(--acc);
  box-shadow: inset 0 0 0 4px var(--card);
  background: var(--acc);
  flex-shrink: 0;
}
.ma-join-card__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.ma-join-card__price {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
}
.ma-join-benefits {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.ma-join-benefits li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}
.ma-join-benefits li svg {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  margin-top: 1px;
  color: var(--acc);
}
.ma-join-card__cta { margin-top: 18px; }
.ma-join-card__cta svg { width: 18px; height: 18px; }
.ma-join__footnote {
  text-align: center;
  margin: 8px 4px 0;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.ma-leadask {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--acc) 35%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--acc) 12%, var(--card)) 0%, var(--card) 70%);
}
.ma-leadask__body { flex: 1 1 180px; min-width: 0; }
.ma-leadask__body strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 2px;
}
.ma-leadask__body p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
}
.ma-leadask__form { flex: 0 0 auto; margin: 0; }
.ma-leadask__form .ma-btn svg { width: 16px; height: 16px; }
html[data-ma-theme="dark"] .ma-flash--ok { color: #6ee7b7; }
  html[data-ma-theme="dark"] .ma-flash--err { color: #fcd34d; }


/* Bottom tab bar — flush to the screen edge. Safe-area is ONLY padding-bottom
   (no min-height add-on — that double-counted on some iOS WebKits and left a tall white shelf).
   Translucent frost + soft top fade (no hard white shelf). */
.ma-tabbar {
  /* Higher opacity + lighter blur: cheaper than blur(22px) on mid/low phones. */
  --tabbar-fill: rgba(255, 255, 255, 0.82);
  --tabbar-fade-mid: rgba(255, 255, 255, 0.42);
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  margin: 0;
  z-index: 40;
  box-sizing: border-box;
  -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0);
  background: var(--tabbar-fill);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  box-shadow: none;
  border: 0;
  border-top: 0;
  /* Height = inner tabs + home-indicator pad only */
  height: auto;
  min-height: 0;
  padding: 0;
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow: visible;
}
/* Soft fade above the bar (~half FAB). No negative z-index — that hid the fade on iOS. */
.ma-tabbar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 28px;
  pointer-events: none;
  background: linear-gradient(
    to top,
    var(--tabbar-fill) 0%,
    var(--tabbar-fade-mid) 45%,
    rgba(255, 255, 255, 0) 100%
  );
}
/* Paint under the home indicator so overscroll doesn't flash page gray. */
.ma-tabbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 200px;
  pointer-events: none;
  background: #ffffff;
}
html[data-ma-theme="dark"] .ma-tabbar {
    --tabbar-fill: rgba(28, 28, 30, 0.62);
    --tabbar-fade-mid: rgba(28, 28, 30, 0.34);
  }
  html[data-ma-theme="dark"] .ma-tabbar::after { background: #1c1c1e; }
  html[data-ma-theme="dark"] .ma-tabbar::before {
    background: linear-gradient(
      to top,
      var(--tabbar-fill) 0%,
      var(--tabbar-fade-mid) 45%,
      rgba(28, 28, 30, 0) 100%
    );
  }

.ma-tabbar__inner {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  height: var(--tabbar-h);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  background: transparent;
}
.ma-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 1px;
  height: 100%;
  padding-bottom: 4px;
  box-sizing: border-box;
  text-decoration: none;
  color: var(--tab-muted);
  font-family: var(--font-text);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.ma-tab svg { width: 24px; height: 24px; display: block; }
.ma-tab.is-on { color: var(--acc); }
/* Shared label metrics so Review matches Home/Customers/etc. */
.ma-tab__label {
  display: block;
  font-family: var(--font-text);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.1;
  white-space: nowrap;
}
/* 24px icon slot — FAB tab uses this so the label baseline matches siblings. */
.ma-tab__slot {
  display: block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}
.ma-tab--fab { z-index: 1; overflow: visible; }
/* In-flow FAB: sits above the label (same font/baseline as other tabs). */
.ma-tab--fab .ma-tab__slot { display: none; }
.ma-tab--fab .ma-tab__fab {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: var(--acc);
  color: var(--on);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Half the circle above the frosted bar — not higher */
  margin-top: -26px;
  margin-bottom: 1px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--acc) 45%, transparent);
  border: 4px solid color-mix(in srgb, var(--bg) 70%, transparent);
  position: relative;
  z-index: 2;
  flex: 0 0 52px;
}
.ma-tab--fab .ma-tab__fab svg { width: 24px; height: 24px; color: inherit; }
.ma-tab--fab .ma-tab__label {
  position: relative;
  z-index: 3;
}
.ma-tab--fab.is-on { color: var(--acc); }
.ma-tab--fab.is-on .ma-tab__fab { color: var(--on); }

/* Install app modal */
.ma-install-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.ma-install-modal[hidden] { display: none !important; }
.ma-install-sheet {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  color: var(--ink);
  border-radius: 24px;
  padding: 20px 18px 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  max-height: min(85vh, 640px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.ma-install-sheet h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.ma-install-sheet .ma-install-lead {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}
.ma-install-sheet .ma-install-lead b { color: var(--acc); }
.ma-install-steps {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.ma-install-steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 14px;
  line-height: 1.4;
}
.ma-install-steps .ma-install-n {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--acc-soft);
  color: var(--acc);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}
.ma-install-actions {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}
.ma-install-actions .ma-btn { width: 100%; justify-content: center; }
/* .ma-btn { display:flex } would otherwise override the HTML hidden attribute */
.ma-install-actions .ma-btn[hidden] { display: none !important; }
.ma-install-close-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.ma-install-sheet { position: relative; }
html[data-ma-theme="dark"] .ma-install-modal { background: rgba(0, 0, 0, 0.65); }


/* Review tab */
.ma-qr { display: flex; flex-direction: column; align-items: center; text-align: center; }
.ma-qr__ask {
  width: 100%;
  min-height: 54px;
  font-size: 16px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--acc) 28%, transparent);
}
.ma-qr__ask svg { width: 22px; height: 22px; }
.ma-qr__ask-hint { margin: 8px 0 0; text-align: center; }
.ma-qr img { width: 220px; height: 220px; border-radius: 16px; background: #fff; padding: 10px; border: 1px solid var(--line); }
.ma-link-box { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 14px; background: var(--bg); border-radius: 14px; padding: 6px 6px 6px 12px; }
.ma-link-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ma-bars { display: grid; gap: 6px; }
.ma-bar { display: grid; grid-template-columns: 34px 1fr 30px; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.ma-bar__track { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.ma-bar__fill { height: 100%; background: var(--acc); border-radius: 999px; }
.ma-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.ma-kpi { background: var(--bg); border-radius: 14px; padding: 10px; text-align: center; }
.ma-kpi strong { display: block; font-family: var(--font-display); font-size: 20px; font-weight: 800; }
.ma-kpi span { font-size: 11px; color: var(--muted); font-weight: 700; }

/* Public review page */
.rv-wrap { max-width: 440px; margin: 0 auto; padding: calc(var(--safe-t) + 28px) 20px calc(var(--safe-b) + 32px); text-align: center; }
.rv-logo { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: #fff; box-shadow: 0 6px 20px rgba(15, 23, 42, 0.1); margin: 0 auto 14px; display: block; }
.rv-initials { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; background: var(--acc); color: var(--on); font-family: var(--font-display); font-weight: 900; font-size: 30px; }
/* In-app owner preview (stays inside the installed PWA; no Safari handoff) */
.rv-preview-bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(var(--safe-t) + 10px) 16px 10px;
  background: var(--navy); color: #fff; font-size: 13px; font-weight: 600;
}
.rv-preview-bar a { color: var(--acc); text-decoration: none; font-weight: 800; flex-shrink: 0; }
.rv-preview-bar span { opacity: 0.75; font-size: 11px; text-align: right; }
.rv-wrap--preview { padding-top: 18px; }
.rv-wrap h1 { font-size: 24px; font-weight: 800; margin: 0; }
.rv-sub { color: var(--muted); margin: 6px 0 22px; font-size: 15px; }
.rv-stars { display: flex; justify-content: center; gap: 6px; margin: 4px 0 8px; }
.rv-star { display: inline-block; width: 52px; height: 52px; border: 0; background: transparent; cursor: pointer; padding: 0; color: color-mix(in srgb, var(--muted) 40%, transparent); transition: transform 0.12s ease, color 0.12s ease; }
.rv-star svg { width: 100%; height: 100%; }
.rv-star.is-on { color: #fbbf24; }
.rv-star:active { transform: scale(0.9); }
.rv-panel { margin-top: 18px; text-align: left; }
.rv-panel[hidden] { display: none; }
.rv-links { display: grid; gap: 10px; margin-top: 12px; }
.rv-link { display: flex; align-items: center; gap: 12px; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; font-weight: 800; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.rv-field-label { display: flex; align-items: center; gap: 8px; }
.rv-field-badge {
  flex: 0 0 22px;
  width: 22px !important;
  height: 22px !important;
  max-width: 22px;
  max-height: 22px;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  align-self: center;
  color: #0f172a;
  font-weight: 900;
  font-size: 11px;
  border: 1px solid var(--line);
  overflow: hidden;
  box-sizing: border-box;
  background: #fff;
}
.rv-field-badge svg {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px;
  max-height: 14px;
  aspect-ratio: 1 / 1;
  flex: 0 0 14px;
  display: block;
  overflow: visible;
}
.rv-link__icon {
  flex: 0 0 36px;
  width: 36px !important;
  height: 36px !important;
  max-width: 36px;
  max-height: 36px;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  font-weight: 900;
  font-size: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  box-sizing: border-box;
  background: #fff;
}
.rv-link__icon svg {
  width: 22px !important;
  height: 22px !important;
  max-width: 22px;
  max-height: 22px;
  aspect-ratio: 1 / 1;
  flex: 0 0 22px;
  display: block;
}
.rv-link__go { margin-left: auto; color: var(--muted); }
.rv-links--quiet .rv-link { box-shadow: none; padding: 11px 14px; font-weight: 700; font-size: 14px; }
.rv-foot { margin-top: 28px; font-size: 12px; color: var(--muted); }

/* Appointment tracker (contractor portal inside member referral app) */
.ma-appt {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  margin: 0 0 16px;
  padding: 18px 16px 16px;
  color: #fff;
  background:
    radial-gradient(90% 80% at 100% 0%, color-mix(in srgb, var(--acc) 45%, transparent), transparent 55%),
    linear-gradient(135deg, var(--navy) 0%, #163a63 55%, var(--navy) 100%);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
}
.ma-appt__kicker {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--acc);
}
.ma-appt__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.ma-appt__sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.35;
}
.ma-appt__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.ma-appt__stats > div {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
}
.ma-appt__stats b {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.ma-appt__stats span {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}
.ma-appt__track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  position: relative;
  margin-top: 16px;
}
.ma-appt__track::before {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  top: 0.95rem;
  height: 2px;
  background: rgba(255, 255, 255, 0.18);
  z-index: 0;
}
.ma-appt__step { position: relative; z-index: 1; text-align: center; }
.ma-appt__dot {
  width: 1.9rem;
  height: 1.9rem;
  margin: 0 auto 0.3rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 900;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 39, 71, 0.45);
  color: rgba(255, 255, 255, 0.7);
}
.ma-appt__step.is-done .ma-appt__dot {
  background: var(--acc);
  border-color: var(--acc);
  color: var(--on);
}
.ma-appt__step.is-current .ma-appt__dot {
  background: #fff;
  border-color: var(--acc);
  color: var(--navy);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--acc) 35%, transparent);
}
.ma-appt__step small {
  display: block;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
.ma-appt__step.is-done small,
.ma-appt__step.is-current small { color: #fff; }
.ma-appt__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.ma-appt__actions .ma-btn { min-height: 40px; }
.ma-appt .ma-btn--ghost {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
}
.ma-appt .ma-btn--soft {
  background: rgba(255, 255, 255, 0.92);
  color: var(--navy);
}
html[data-ma-theme="dark"] .ma-appt {
    background:
      radial-gradient(90% 80% at 100% 0%, color-mix(in srgb, var(--acc) 28%, transparent), transparent 55%),
      linear-gradient(135deg, #020617 0%, #0f172a 60%, #020617 100%);
  }


/* Combined leads + referrals home */
.ma-hero--dash { min-height: 220px; }
.ma-hero__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.ma-hero__split .ma-hero__stat { margin-top: 0; font-size: 28px; }
.ma-tiles--6 { grid-template-columns: 1fr 1fr; }
.ma-dash-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ma-dash-actions .ma-btn { width: 100%; justify-content: center; }

/* Job photos + review-ask status */
.ma-photos{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0 0 14px}
.ma-photos__item{position:relative;margin:0;border-radius:14px;overflow:hidden;background:color-mix(in srgb,var(--muted) 12%,transparent)}
.ma-photos__item a{display:block;aspect-ratio:4/3}
.ma-photos__item img{width:100%;height:100%;object-fit:cover;display:block}
.ma-photos__item figcaption{padding:6px 10px 8px;font-size:12px;font-weight:600;color:var(--muted)}
.ma-photos__del{position:absolute;top:6px;right:6px;width:28px;height:28px;border:0;border-radius:999px;background:rgba(15,23,42,.72);color:#fff;font-size:18px;line-height:1;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
.ma-photos__note{
  position:absolute;left:6px;top:6px;z-index:2;
  width:34px;height:34px;border:0;border-radius:999px;padding:0;
  background:rgba(15,23,42,.72);color:#fff;
  cursor:pointer;display:inline-flex;align-items:center;justify-content:center;
  box-shadow:0 2px 8px rgba(15,23,42,.25);
}
.ma-photos__note svg{width:18px;height:18px;display:block}
.ma-photos__note.has-note{background:var(--acc);color:var(--on)}
.ma-photos__note:active{transform:scale(0.94)}

/* Take photo / Choose library sheet — z above tabbar; portal to body in JS
   so Cancel isn’t trapped under the Review FAB stacking context. */
.ma-photo-capture{margin-top:4px}
.ma-photo-modal{
  position:fixed;inset:0;z-index:100;
  display:flex;align-items:flex-end;justify-content:center;
  /* Clear tab bar so Cancel sits fully above it */
  padding:16px;
  padding-bottom:calc(
    16px + var(--tabbar-h) + var(--tabbar-fab-overhang) + env(safe-area-inset-bottom, 0px)
  );
  background:rgba(15,23,42,.45);
  -webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);
}
.ma-photo-modal[hidden]{display:none!important}
body.ma-photo-open .ma-tabbar{
  visibility:hidden;
  pointer-events:none;
}
.ma-photo-sheet{
  position:relative;width:min(440px,100%);
  max-height:min(78vh, 640px);
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  background:var(--card);color:var(--ink);
  border-radius:22px 22px 18px 18px;
  padding:22px 18px 18px;
  box-shadow:0 18px 40px rgba(15,23,42,.22);
  animation:ma-photo-up .22s ease;
}
@keyframes ma-photo-up{from{transform:translateY(18px);opacity:.6}to{transform:none;opacity:1}}
.ma-photo-sheet h2{margin:0 36px 6px 0;font-size:20px;font-weight:800}
.ma-photo-lead{margin:0 0 14px;font-size:14px;font-weight:600;color:var(--muted);line-height:1.4}
.ma-photo-note{margin-bottom:14px}
.ma-photo-note__box{
  position:relative;
  border-radius:14px;
  background:var(--card);
}
.ma-photo-note__input{
  display:block;
  width:100%;
  min-height:140px;
  max-height:55vh;
  height:140px;
  resize:none; /* custom grip — iOS ignores CSS resize */
  line-height:1.45;
  padding-bottom:28px;
  overflow:auto;
}
.ma-photo-note__grip{
  position:absolute;
  left:0;right:0;bottom:0;
  height:28px;
  border:0;
  margin:0;
  padding:0;
  background:transparent;
  cursor:ns-resize;
  touch-action:none;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:0 0 14px 14px;
}
.ma-photo-note__grip-bar{
  width:44px;
  height:5px;
  border-radius:999px;
  background:color-mix(in srgb, var(--muted) 45%, transparent);
}
.ma-photo-note__grip:active .ma-photo-note__grip-bar,
.ma-photo-note__box.is-resizing .ma-photo-note__grip-bar{
  background:var(--acc);
}
.ma-photo-file{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;
}
.ma-photo-actions{display:grid;gap:8px;margin-top:4px}
.ma-photo-actions .ma-btn{width:100%;justify-content:center}
html[data-ma-theme="dark"] .ma-photo-modal {background:rgba(0,0,0,.65)}

.ma-askstatus{display:flex;gap:10px;align-items:flex-start;margin:10px 0 0;padding:12px 14px;border-radius:14px;background:var(--acc-soft);color:var(--acc-ink)}
.ma-askstatus svg{width:20px;height:20px;flex-shrink:0;margin-top:1px}
.ma-askstatus strong{display:block;font-size:14px;font-weight:800}
.ma-askstatus span{display:block;font-size:12px;font-weight:600;opacity:.85;margin-top:2px;line-height:1.35}
.ma-askstatus--opened,.ma-askstatus--clicked,.ma-askstatus--reward_sent{background:rgba(16,185,129,.12);color:#047857}
.ma-askstatus--reminded,.ma-askstatus--reward_pending{background:rgba(245,158,11,.15);color:#92400e}
.ma-askstatus--reward_skipped{background:rgba(100,116,139,.12);color:#475569}
.ma-optional{font-weight:600;opacity:.7}
.ma-reward-pending{margin:12px 0}
.ma-reward-pending__row{display:flex;flex-direction:column;gap:10px;padding:12px 0;border-top:1px solid var(--line)}
.ma-reward-pending__row:first-of-type{border-top:0;padding-top:0}
.ma-reward-pending__who strong{display:block;font-size:15px;font-weight:800}
.ma-reward-pending__who span{display:block;font-size:12px;font-weight:600;opacity:.8;margin-top:2px}
.ma-reward-pending__actions{margin-top:0}
.ma-reward-pending--compact{margin:8px 0 0}
.ma-reward-pending--compact .ma-reward-pending__actions{justify-content:flex-start}
html[data-ma-theme="dark"] .ma-askstatus--opened,
html[data-ma-theme="dark"] .ma-askstatus--clicked,
html[data-ma-theme="dark"] .ma-askstatus--reward_sent {color:#6ee7b7}
html[data-ma-theme="dark"] .ma-askstatus--reminded,
html[data-ma-theme="dark"] .ma-askstatus--reward_pending {color:#fcd34d}
html[data-ma-theme="dark"] .ma-askstatus--reward_skipped {color:#cbd5e1}

/* Lightroom-style fullscreen photo viewer */
.ma-lr{
  position:fixed;inset:0;z-index:120;
  display:flex;flex-direction:column;
  background:#0a0a0a;
  color:#f5f5f5;
  -webkit-user-select:none;user-select:none;
}
.ma-lr[hidden]{display:none!important}
body.ma-lr-open{overflow:hidden}
body.ma-lr-open .ma-tabbar{visibility:hidden;pointer-events:none}
.ma-lr__chrome{
  flex:0 0 auto;
  display:flex;align-items:center;gap:10px;
  padding:max(10px, env(safe-area-inset-top, 0px)) 12px 10px;
  background:linear-gradient(180deg, rgba(0,0,0,.92), rgba(0,0,0,.55) 70%, transparent);
  position:relative;z-index:2;
}
.ma-lr__meta{flex:1;min-width:0;text-align:center}
.ma-lr__count{margin:0;font-size:11px;font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:rgba(255,255,255,.55)}
.ma-lr__caption{margin:2px 0 0;font-size:13px;font-weight:650;line-height:1.3;color:#fff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ma-lr__icon-btn{
  flex:0 0 auto;width:40px;height:40px;border:0;border-radius:999px;
  display:inline-flex;align-items:center;justify-content:center;
  background:rgba(255,255,255,.08);color:#fff;text-decoration:none;cursor:pointer;
}
.ma-lr__icon-btn svg{width:18px;height:18px;display:block}
.ma-lr__icon-btn:active{background:rgba(255,255,255,.16)}
.ma-lr__stage{
  flex:1 1 auto;min-height:0;position:relative;
  display:flex;align-items:center;justify-content:center;
  padding:8px 12px;
  touch-action:pan-y;
}
.ma-lr__img{
  max-width:100%;max-height:100%;
  width:auto;height:auto;
  object-fit:contain;
  border-radius:2px;
  box-shadow:0 12px 40px rgba(0,0,0,.55);
  background:#111;
  transition:opacity .18s ease, transform .18s ease;
}
.ma-lr.is-switching .ma-lr__img{opacity:.35;transform:scale(.985)}
.ma-lr__nav{
  position:absolute;top:50%;transform:translateY(-50%);
  width:44px;height:44px;border:0;border-radius:999px;
  display:inline-flex;align-items:center;justify-content:center;
  background:rgba(0,0,0,.45);color:#fff;cursor:pointer;
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);
  z-index:2;
}
.ma-lr__nav svg{width:20px;height:20px}
.ma-lr__nav--prev{left:8px}
.ma-lr__nav--next{right:8px}
.ma-lr__nav:active{background:rgba(255,255,255,.14)}
.ma-lr__nav[hidden]{display:none!important}
.ma-lr__film{
  flex:0 0 auto;
  display:flex;gap:8px;overflow-x:auto;-webkit-overflow-scrolling:touch;
  padding:10px 12px max(14px, env(safe-area-inset-bottom, 0px));
  background:linear-gradient(0deg, rgba(0,0,0,.95), rgba(0,0,0,.7) 75%, transparent);
  scrollbar-width:none;
}
.ma-lr__film::-webkit-scrollbar{display:none}
.ma-lr__thumb{
  flex:0 0 auto;width:56px;height:56px;padding:0;border:2px solid transparent;
  border-radius:8px;overflow:hidden;background:#1a1a1a;cursor:pointer;
}
.ma-lr__thumb img{width:100%;height:100%;object-fit:cover;display:block;opacity:.72}
.ma-lr__thumb.is-on{border-color:#fff}
.ma-lr__thumb.is-on img{opacity:1}
@media (min-width:720px){
  .ma-lr__nav--prev{left:18px}
  .ma-lr__nav--next{right:18px}
  .ma-lr__thumb{width:64px;height:64px}
}

/* Full-screen nav / open-contact progress (Reviews app). */
#maNavLoading {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
  background: color-mix(in srgb, var(--ink, #000) 18%, transparent);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
}
#maNavLoading.is-on { opacity: 1; }
#maNavLoading .ma-nav-loader {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#maNavLoading .ma-nav-loader-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: ma-nav-loader-spin 0.9s linear infinite;
}
#maNavLoading .ma-nav-loader-track {
  stroke: color-mix(in srgb, var(--acc) 18%, transparent);
  stroke-width: 3;
}
#maNavLoading .ma-nav-loader-arc {
  stroke: var(--acc);
  stroke-width: 3.25;
  stroke-linecap: round;
  stroke-dasharray: 62 128;
}
#maNavLoading .ma-nav-loader-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--acc);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--acc) 18%, transparent);
}
@keyframes ma-nav-loader-spin {
  to { transform: rotate(360deg); }
}
html.ma-nav-loading { cursor: progress; }
.ma-ghl-loading {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ma-ghl-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--acc) 25%, transparent);
  border-top-color: var(--acc);
  animation: ma-nav-loader-spin 0.7s linear infinite;
  flex: 0 0 14px;
}
@media (prefers-reduced-motion: reduce) {
  #maNavLoading {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: color-mix(in srgb, var(--ink, #000) 28%, transparent);
  }
  #maNavLoading .ma-nav-loader-ring,
  .ma-ghl-loading::before {
    animation: none;
  }
}

