/*
 * Biometric Lead brand theme, built on Bootstrap 5.3 CSS variables.
 * Mobile first; no !important overrides of Bootstrap.
 */

/* ---- Brand colours ------------------------------------------------------ */
:root,
[data-bs-theme="light"] {
  --brand: #0f766e;          /* teal-700: 5.5:1 on white */
  --brand-rgb: 15, 118, 110;
  --brand-hover: #115e59;    /* button fill: 7.6:1 with white text */
  --brand-active: #134e4a;
  --brand-accent: #10b981;   /* emerald, decorative gradients only */
  --bs-primary: var(--brand);
  --bs-primary-rgb: var(--brand-rgb);
  --bs-primary-text-emphasis: #134e4a;
  --bs-primary-bg-subtle: #ccfbf1;
  --bs-primary-border-subtle: #99f6e4;
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: var(--brand-rgb);
  --bs-link-hover-color: var(--brand-active);
  --bs-link-hover-color-rgb: 19, 78, 74;
  --bs-focus-ring-color: rgba(var(--brand-rgb), 0.35);
  --bs-border-radius: 0.75rem;
  --bs-border-radius-lg: 1rem;
  --bs-border-radius-xl: 1.25rem;
  --bs-box-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 2px 8px rgba(16, 24, 40, 0.06);
  --bs-box-shadow: 0 4px 12px rgba(16, 24, 40, 0.06), 0 12px 32px rgba(16, 24, 40, 0.08);
  --bs-body-font-family: "Plus Jakarta Sans", "Noto Sans Devanagari", "Nirmala UI", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --surface-muted: #f3f7f6;
  --bottom-nav-height: 64px;
  /* Chart colours (validated with the dataviz checks against #ffffff). */
  --chart-surface: #ffffff;
  --chart-grid: #e7e8ec;
  --chart-series-1: #2a78d6;
  --chart-series-2: #eb6834;
  --chart-status-open: #008300;
  --chart-status-assigned: #6250d6;
  --chart-status-submitted: #eda100;
  --chart-status-approved: #2a78d6;
  --chart-status-cancelled: #e34948;
  --chart-status-closed: #6c757d;
}

[data-bs-theme="dark"] {
  --brand: #0d9488;
  --brand-rgb: 13, 148, 136;
  --brand-hover: #0f766e;    /* button fill keeps white text (5.5:1) */
  --brand-active: #115e59;
  --brand-accent: #34d399;
  --bs-primary: var(--brand);
  --bs-primary-rgb: var(--brand-rgb);
  --bs-primary-text-emphasis: #99f6e4;
  --bs-primary-bg-subtle: #042f2e;
  --bs-primary-border-subtle: #115e59;
  --bs-link-color: #5eead4;  /* 11:1 on the dark body */
  --bs-link-color-rgb: 94, 234, 212;
  --bs-link-hover-color: #99f6e4;
  --bs-link-hover-color-rgb: 153, 246, 228;
  --bs-box-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.25);
  --surface-muted: #121a1b;
  /* Dark steps of the same hues, validated against the dark card (#212529). */
  --chart-surface: #212529;
  --chart-grid: #343a40;
  --chart-series-1: #3987e5;
  --chart-series-2: #d95926;
  --chart-status-open: #008300;
  --chart-status-assigned: #9085e9;
  --chart-status-submitted: #c98500;
  --chart-status-approved: #3987e5;
  --chart-status-cancelled: #e66767;
  --chart-status-closed: #868e96;
}

.btn-primary {
  --bs-btn-bg: var(--brand-hover);
  --bs-btn-border-color: var(--brand-hover);
  --bs-btn-hover-bg: var(--brand-active);
  --bs-btn-hover-border-color: var(--brand-active);
  --bs-btn-active-bg: var(--brand-active);
  --bs-btn-active-border-color: var(--brand-active);
  --bs-btn-disabled-bg: var(--brand-hover);
  --bs-btn-disabled-border-color: var(--brand-hover);
  --bs-btn-focus-shadow-rgb: var(--brand-rgb);
}
.btn-outline-primary {
  --bs-btn-color: var(--bs-link-color);
  --bs-btn-border-color: var(--bs-link-color);
  --bs-btn-hover-bg: var(--brand-hover);
  --bs-btn-hover-border-color: var(--brand-hover);
  --bs-btn-active-bg: var(--brand-active);
  --bs-btn-active-border-color: var(--brand-active);
  --bs-btn-focus-shadow-rgb: var(--brand-rgb);
}
.text-primary { color: var(--bs-link-color); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--brand-hover); }
.pagination {
  --bs-pagination-color: var(--bs-link-color);
  --bs-pagination-hover-color: var(--bs-link-hover-color);
  --bs-pagination-focus-color: var(--bs-link-hover-color);
  --bs-pagination-active-bg: var(--brand-hover);
  --bs-pagination-active-border-color: var(--brand-hover);
  --bs-pagination-focus-box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
}
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: rgba(var(--brand-rgb), 0.6);
  box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
}
.form-check-input:checked {
  background-color: var(--brand-hover);
  border-color: var(--brand-hover);
}

/* ---- Modern refresh: type, buttons, cards ------------------------------- */
h1, h2, h3, .h1, .h2, .h3, .display-5 { letter-spacing: -0.02em; }
h4, h5, h6, .h4, .h5, .h6, .navbar-brand { letter-spacing: -0.01em; }
::selection { background: rgba(var(--brand-rgb), 0.2); }

.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-padding-x: 1rem;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.btn-lg { --bs-btn-padding-x: 1.5rem; --bs-btn-border-radius: var(--bs-border-radius-lg); }
.btn-primary { box-shadow: 0 1px 2px rgba(var(--brand-rgb), 0.25), 0 4px 12px rgba(var(--brand-rgb), 0.2); }
.btn-primary:hover { box-shadow: 0 2px 4px rgba(var(--brand-rgb), 0.3), 0 8px 20px rgba(var(--brand-rgb), 0.25); }
.btn:active { transform: translateY(1px); }

.card {
  --bs-card-border-color: var(--bs-border-color-translucent);
  --bs-card-border-radius: var(--bs-border-radius-lg);
  --bs-card-inner-border-radius: calc(var(--bs-border-radius-lg) - 1px);
}
.card.shadow-sm { transition: box-shadow 0.2s ease; }
.badge { font-weight: 600; letter-spacing: 0.01em; }
.form-control, .form-select { border-radius: var(--bs-border-radius); }
.dropdown-menu {
  --bs-dropdown-border-color: var(--bs-border-color-translucent);
  --bs-dropdown-link-active-bg: var(--brand-hover);
  box-shadow: var(--bs-box-shadow);
  padding: 0.4rem;
}
.dropdown-item { border-radius: 0.5rem; }

/* ---- Layout ------------------------------------------------------------- */
html { scroll-padding-top: 5rem; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--surface-muted);
  overflow-x: hidden;
}
main:focus { outline: none; }

.site-navbar {
  --bs-bg-opacity: 0;         /* the frosted ::before layer paints the background */
  --bs-border-color: var(--bs-border-color-translucent);
  padding-top: max(0.5rem, env(safe-area-inset-top));
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
/* Frosted glass on a pseudo-element: backdrop-filter on the navbar itself would make
   it the containing block of the fixed offcanvas menus and widen the page on phones. */
.site-navbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(var(--bs-body-bg-rgb), 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
}
.nav-icon-btn {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bs-body-color);
}
.notif-badge {
  --bs-bg-opacity: 1;  /* the navbar sets 0 for its own glass background; the badge must stay solid red */
  position: absolute;
  top: 2px;
  left: 1.1rem;
  font-size: 0.65rem;
}
@media (max-width: 991.98px) {
  .notif-badge { position: static; margin-left: 0.5rem; }
  .offcanvas .nav-link { padding-top: 0.75rem; padding-bottom: 0.75rem; }
}
.offcanvas {
  padding-bottom: env(safe-area-inset-bottom);
}

.site-footer {
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

.site-toasts {
  z-index: 1090;
  /* top centre, below the sticky navbar so toasts never cover the menu */
  top: 0; left: 50%; transform: translateX(-50%);
  width: min(26rem, calc(100vw - 1.5rem)); max-width: 100%;
  padding: calc(4.25rem + env(safe-area-inset-top)) 0 0;
}
.site-toasts .toast {
  --bs-toast-bg: var(--bs-body-bg);   /* opaque, so text stays readable */
  --bs-toast-header-bg: var(--bs-tertiary-bg);
  --bs-toast-max-width: min(360px, calc(100vw - 2rem));
}

/* ---- Forms -------------------------------------------------------------- */
/* 16px+ inputs stop iOS Safari from zooming in on focus. */
.form-control,
.form-select,
.form-control-sm,
.form-select-sm {
  font-size: max(1rem, 16px);
}
.form-floating > .form-control,
.form-floating > .form-select {
  font-size: max(1rem, 16px);
}

.mobile-input .country-code {
  flex: 0 0 7.5rem;
  max-width: 7.5rem;
}
.mobile-input .country-code .form-select {
  padding-right: 1.75rem;
  padding-top: 0.375rem; padding-bottom: 0.375rem;  /* no visible label: the code sits in the middle */
}
.mobile-input > .form-floating { min-width: 0; }
/* Long floating labels get an ellipsis instead of widening the page. */
.form-floating > label { max-width: 100%; }
.otp-input {
  letter-spacing: 0.5em;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* Honeypot: off-screen for humans, still in the DOM for bots. */
.hp-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.password-strength .progress { background-color: var(--bs-secondary-bg); }
.asteriskField { margin-left: 0.15rem; color: var(--bs-danger-text-emphasis); }

/* ---- Touch targets ------------------------------------------------------ */
@media (pointer: coarse) {
  .btn:not(.btn-close):not(.btn-sm),
  .nav-link,
  .page-link,
  .dropdown-item {
    min-height: 44px;
  }
  .btn,
  .nav-link { display: inline-flex; align-items: center; justify-content: center; }
  .nav-link { justify-content: flex-start; }
  .btn-sm { min-height: 36px; }
  .form-check-input { width: 1.35em; height: 1.35em; }
  .btn-close { padding: 0.75rem; }
}

/* ---- Components --------------------------------------------------------- */
.auth-icon { width: 64px; height: 64px; }
.auth-card { border-radius: var(--bs-border-radius-lg); }
.profile-avatar { width: 96px; height: 96px; flex: 0 0 96px; }
.hero-mark { font-size: 12rem; opacity: 0.85; }
.quick-link { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.quick-link:hover,
.quick-link:focus-visible { transform: translateY(-2px); }

/* Visible focus for keyboard users everywhere. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(var(--brand-rgb), 0.6);
  outline-offset: 2px;
}

/* ---- Motion ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
    scroll-behavior: auto;
  }
}

/* ---- Print -------------------------------------------------------------- */
@media print {
  .site-navbar,
  .site-footer,
  .site-toasts,
  .btn,
  form { display: none; }
  body { background: #fff; }
  .card { border: 1px solid #ccc; box-shadow: none; }
}

/* ---- Home: hero & trust strip ------------------------------------------- */
.hero {
  background:
    radial-gradient(60rem 28rem at 85% -10%, rgba(var(--brand-rgb), 0.16), transparent 60%),
    radial-gradient(40rem 22rem at -10% 10%, rgba(16, 185, 129, 0.12), transparent 60%),
    linear-gradient(180deg, rgba(var(--brand-rgb), 0.05), transparent);
}
.hero-mark {
  background: linear-gradient(135deg, var(--brand), var(--brand-accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 12px 24px rgba(var(--brand-rgb), 0.25));
}
.trust-item {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--bs-box-shadow-sm);
  padding: 1rem 0.75rem;
  text-align: center;
  height: 100%;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.trust-item:hover { transform: translateY(-2px); box-shadow: var(--bs-box-shadow); }
.trust-value {
  display: flex; align-items: center; justify-content: center; gap: 0.2rem;
  font-size: clamp(1.5rem, 1.2rem + 0.9vw, 1.9rem); font-weight: 800; line-height: 1.15;
  letter-spacing: -0.02em; color: var(--bs-link-color); font-variant-numeric: tabular-nums;
}
.trust-label {
  display: block; margin-top: 0.2rem; font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--bs-secondary-color);
}

/* Hero type scale: headline in two lines on desktop, readable subtext, even benefit row */
.hero-title:not(.h2) {
  font-size: clamp(1.75rem, 1.1rem + 2.2vw, 2.6rem); font-weight: 800;
  line-height: 1.15; letter-spacing: -0.025em; max-width: 46rem; text-wrap: balance;
}
.hero-subtext {
  font-size: clamp(1rem, 0.94rem + 0.3vw, 1.15rem); line-height: 1.6;
  max-width: 44rem; text-wrap: pretty;
}
/* benefit points: one line of chips */
.hero-points { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.25rem; }
.hero-points li {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.8rem 0.35rem 0.6rem;
  border-radius: 999px; font-size: var(--fs-sm, 0.875rem); font-weight: 600;
  background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent);
}
.hero-points li .bi { color: var(--brand); font-size: 1rem; }
/* visitors' hero: tighter spacing, smaller mark and stat cards */
.hero-visitor { padding: 2.25rem 0 1.75rem; }
.hero-visitor .hero-subtext { margin: 0.75rem 0 1rem; }
.hero-visitor .hero-mark { font-size: 9.5rem; }
.hero-visitor .trust-strip { margin-top: 1.5rem; }
.hero-compact .trust-strip { margin-top: 1.25rem; }  /* members: room between the buttons and the numbers */
.hero-visitor .trust-item { padding: 0.7rem 0.6rem; }
@media (max-width: 575.98px) {
  .hero-visitor { padding: 1.5rem 0 1.25rem; }
  .hero-points li { font-size: var(--fs-xs, 0.8125rem); padding: 0.3rem 0.7rem 0.3rem 0.55rem; }
  .hero-visitor .trust-strip { margin-top: 1.1rem; }
}
:lang(hi) .hero-title:not(.h2), :lang(mr) .hero-title:not(.h2) { line-height: 1.35; letter-spacing: 0; }

/* ---- Lead lists --------------------------------------------------------- */
.lead-table th { white-space: nowrap; font-size: 0.85rem; }
.lead-title-cell { max-width: 12rem; }
@media (min-width: 1400px) { .lead-title-cell { max-width: 15rem; } }
/* In the lead table the title column takes the space that is left and truncates. */
td.lead-title-cell { max-width: 0; width: 100%; min-width: 6rem; }
.lead-card-actions > .btn { flex: 1 1 auto; }
.my-leads-tabs { scrollbar-width: thin; }
.status-badge { font-weight: 600; }

@media (min-width: 992px) {
  .filters-sidebar { position: sticky; top: 5.5rem; }
  .filters-panel .offcanvas-body {
    background: var(--bs-body-bg);
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--bs-box-shadow-sm);
    padding: 1.25rem;
  }
  .action-sticky { top: 5.5rem; z-index: 1; }
}

/* ---- Lead progress: 5 steps in one row; the line fills in as the lead moves on ---- */
.lead-progress { --step-dot: 2.5rem; --step-line: 3px; display: flex; align-items: flex-start; }
.lead-progress-step {
  flex: 1 1 0; min-width: 0; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem; text-align: center;
}
.lead-progress-step:not(:last-child)::after {  /* the line to the next step */
  content: ""; position: absolute; top: calc(var(--step-dot) / 2 - var(--step-line) / 2);
  left: calc(50% + var(--step-dot) / 2 + 0.3rem); right: calc(-50% + var(--step-dot) / 2 + 0.3rem);
  height: var(--step-line); border-radius: 999px; background: var(--bs-border-color);
}
.lead-progress-step.is-done:not(:last-child)::after,
.lead-progress-step.is-skipped::after { background: var(--bs-success); }
.lead-progress-step.is-done:has(+ .is-current)::after { background: linear-gradient(90deg, var(--bs-success), var(--brand)); }
.lead-progress-dot {
  width: var(--step-dot); height: var(--step-dot); flex: 0 0 auto; border-radius: 50%; position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem;
  background: var(--bs-body-bg); color: var(--bs-secondary-color); border: 2px solid var(--bs-border-color);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.lead-progress-step.is-done .lead-progress-dot {
  background: var(--bs-success); border-color: var(--bs-success); color: #fff; box-shadow: 0 2px 6px rgba(25, 135, 84, 0.25);
}
.lead-progress-step.is-current .lead-progress-dot {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), 0.15), 0 4px 10px rgba(var(--brand-rgb), 0.3);
}
.lead-progress-step.is-current .lead-progress-dot::before {  /* a soft ring that pulses on the current step */
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(var(--brand-rgb), 0.35); animation: progress-ring 2.2s ease-out infinite;
}
.lead-progress-step.is-skipped .lead-progress-dot { border: 2px dashed var(--bs-success); color: var(--bs-success); }
.lead-progress-label { font-size: 0.82rem; font-weight: 600; line-height: 1.25; color: var(--bs-secondary-color); overflow-wrap: anywhere; }
.lead-progress-step.is-done .lead-progress-label { color: var(--bs-body-color); }
.lead-progress-step.is-current .lead-progress-label { color: var(--brand); font-weight: 800; }
.lead-progress-note {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.4;
  padding: 0.05rem 0.5rem; border-radius: 999px; white-space: nowrap;
}
.lead-progress-step.is-current .lead-progress-note { background: rgba(var(--brand-rgb), 0.12); color: var(--brand); }
.lead-progress-step.is-skipped .lead-progress-note { background: var(--bs-secondary-bg); color: var(--bs-secondary-color); }
.lead-progress.is-complete .lead-progress-note { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
@keyframes progress-ring { from { transform: scale(0.9); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .lead-progress-step.is-current .lead-progress-dot::before { animation: none; display: none; }
  .lead-progress-dot { transition: none; }
}
@media (max-width: 575.98px) {  /* phones: same row, smaller */
  .lead-progress { --step-dot: 2.1rem; }
  .lead-progress-dot { font-size: 0.9rem; }
  .lead-progress-label { font-size: 0.7rem; }
  .lead-progress-note { font-size: 0.58rem; padding: 0 0.35rem; letter-spacing: 0.02em; }
  .lead-progress-step:not(:last-child)::after { left: calc(50% + var(--step-dot) / 2 + 0.15rem); right: calc(-50% + var(--step-dot) / 2 + 0.15rem); }
}

/* ---- Lightbox ------------------------------------------------------------ */
.lightbox-img { max-width: 100%; max-height: calc(100dvh - 8rem); object-fit: contain; }
.lightbox-modal .modal-content { padding-bottom: env(safe-area-inset-bottom); }

/* ---- Work submission, proof files, payment ------------------------------ */
.min-w-0 { min-width: 0; }
.proof-icon { width: 88px; height: 88px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 2.5rem; border-radius: var(--bs-border-radius); background: var(--bs-secondary-bg); }
.upi-qr { width: 160px; height: 160px; }
.star-input { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.star-input .btn { min-width: 3.25rem; }
fieldset > legend.h6 { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; }

@media print {
  .page-lead-detail .action-panel,
  .page-lead-detail #requests,
  .page-lead-detail #submit-work,
  .page-lead-detail .breadcrumb,
  .lead-progress { display: none; }
  .page-lead-detail .col-lg-8 { width: 100%; }
  .payment-card dl { font-size: 1rem; }
}

/* ---- Notifications ------------------------------------------------------ */
.notification-icon {
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bs-primary-bg-subtle); color: var(--bs-link-color); font-size: 1.1rem;
}
.notification-unread { background: rgba(var(--brand-rgb), 0.06); }
.notification-unread .notification-title { font-weight: 700; }
.unread-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--brand-hover); margin-top: 0.4rem; }
.filter-chips { scrollbar-width: thin; }
.filter-chips .nav-link { border: 1px solid var(--bs-border-color); font-size: 0.875rem; }

/* ---- Message thread ----------------------------------------------------- */
.message-thread { max-height: 24rem; overflow-y: auto; overscroll-behavior: contain; }
.message-bubble { max-width: min(85%, 32rem); padding: 0.5rem 0.75rem; border-radius: 1rem; word-wrap: break-word; }
.message-mine { background: var(--brand-hover); color: #fff; border-bottom-right-radius: 0.25rem; }
.message-mine a { color: #fff; }
.message-theirs { background: var(--bs-secondary-bg); border-bottom-left-radius: 0.25rem; }
.message-time { display: block; font-size: 0.7rem; opacity: 0.8; margin-top: 0.15rem; }
.message-form textarea { resize: vertical; }

/* ---- Dashboard ---------------------------------------------------------- */
.dashboard .card { border: 0; box-shadow: var(--bs-box-shadow-sm); background: var(--chart-surface); }
.stat-card { transition: transform 0.15s ease; }
.stat-card:hover, .stat-card:focus-within { transform: translateY(-2px); box-shadow: var(--bs-box-shadow); }
.stat-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--bs-secondary-color); }
.stat-label .bi { color: var(--bs-link-color); font-size: 1.1rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; margin: 0.35rem 0; font-variant-numeric: tabular-nums; }
.stat-unit { font-size: 0.85rem; font-weight: 500; color: var(--bs-secondary-color); }
.stat-attention { box-shadow: inset 4px 0 0 var(--bs-warning), var(--bs-box-shadow-sm); }
.chart-box { position: relative; height: 260px; min-height: 220px; }
.chart-card[data-chart="status"] .chart-box { height: 300px; }
.chart-box canvas { position: absolute; inset: 0; }
.chart-skeleton { position: absolute; inset: 0; display: flex; }
.chart-skeleton .placeholder { opacity: 0.15; }
.chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; margin: 0; }
.chart-empty[hidden], .chart-box canvas[hidden], .chart-skeleton[hidden] { display: none; }
.chart-table summary { cursor: pointer; color: var(--bs-link-color); }
.quick-links .list-group-item { background: transparent; }

/* ---- Home: Why section ---------------------------------------------------- */
.why-section { background: var(--bs-body-bg); }

/* Home: slim benefits strip (full section is on About) */
.why-strip { padding: 1rem 0 0.25rem; }
.why-strip-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem;
  padding: 0.85rem 1.25rem; border-radius: var(--bs-border-radius-xl);
  background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); box-shadow: var(--bs-box-shadow-sm);
}
.why-strip-list { display: flex; flex-wrap: wrap; gap: 0.6rem 1.75rem; }
.why-strip-list li { display: inline-flex; align-items: center; gap: 0.55rem; font-size: 0.92rem; font-weight: 600; }
.why-strip-icon {
  flex: 0 0 2rem; width: 2rem; height: 2rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.6rem; font-size: 1rem; background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis);
}
.why-strip-link { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.88rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.why-strip-link .bi { transition: transform 0.15s ease; }
.why-strip-link:hover .bi { transform: translateX(3px); }
@media (max-width: 575.98px) {
  .why-strip-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; width: 100%; }
  .why-strip-list li { font-size: 0.82rem; align-items: flex-start; }
  .why-strip-icon { flex-basis: 1.75rem; width: 1.75rem; height: 1.75rem; font-size: 0.9rem; }
  .why-strip-inner { padding: 0.85rem 1rem; }
}
@media (prefers-reduced-motion: reduce) { .why-strip-link .bi { transition: none; } }
.why-tag { width: 2rem; height: 2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.why-tag-problem { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }
.why-tag-solution { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.why-card { background: var(--surface-muted); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.why-card:hover { transform: translateY(-2px); box-shadow: var(--bs-box-shadow); }
.why-icon { width: 2.75rem; height: 2.75rem; border-radius: 0.75rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.why-icon-problem { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }
.why-icon-solution { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }

/* Fade-in on scroll (class added by JS only when motion is allowed). */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---- How It Works timeline ----------------------------------------------
   phones: vertical line on the left · tablets (md): 2-column grid ·
   desktop (lg+): horizontal numbered circles joined by a line            */
.how-tabs .nav-link { border: 1px solid var(--bs-border-color); }
.how-steps { position: relative; display: flex; flex-direction: column; gap: 1.25rem; padding-left: 0; }
.how-step { position: relative; display: flex; gap: 1rem; align-items: flex-start; }
.how-num {
  flex: 0 0 2.75rem; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-hover), var(--brand-active)); color: #fff; font-weight: 700; font-size: 1.1rem;
  position: relative; z-index: 1; box-shadow: 0 0 0 4px var(--bs-body-bg), 0 4px 12px rgba(var(--brand-rgb), 0.3);
}
.how-body { background: var(--bs-body-bg); border-radius: var(--bs-border-radius-lg); padding: 0.9rem 1rem; box-shadow: var(--bs-box-shadow-sm); flex: 1; }
.how-icon { font-size: 1.4rem; color: var(--bs-link-color); display: block; margin-bottom: 0.25rem; }
.how-step:not(:last-child)::before {   /* vertical connector (phones) */
  content: ""; position: absolute; left: calc(1.375rem - 1px); top: 2.75rem; bottom: -1.25rem;
  width: 2px; background: rgba(var(--brand-rgb), 0.3);
}
@media (min-width: 768px) and (max-width: 991.98px) {
  .how-steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .how-step:not(:last-child)::before { display: none; }
}
@media (min-width: 992px) {
  .how-steps { flex-direction: row; gap: 1rem; }
  .how-step { flex: 1 1 0; flex-direction: column; align-items: center; text-align: center; }
  .how-step:not(:last-child)::before {   /* horizontal connector */
    left: calc(50% + 1.375rem); right: calc(-50% - 1rem + 1.375rem); top: calc(1.375rem - 1px);
    bottom: auto; width: auto; height: 2px;
  }
  .how-body { width: 100%; height: 100%; }
}
.how-section { background: var(--surface-muted); }

/* ---- Status flow ---------------------------------------------------------- */
.status-chip { font-size: 0.85rem; padding: 0.55em 0.9em; cursor: help; min-height: 32px; }
@media (pointer: coarse) { .status-chip { min-height: 44px; padding: 0.75em 1em; } }

/* ---- Video facade ---------------------------------------------------------- */
.video-play {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
  width: 4.5rem; height: 4.5rem; border-radius: 50%; background: rgba(0, 0, 0, 0.65); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 2.5rem;
}
.video-facade iframe { border: 0; }

/* ---- Final call to action -------------------------------------------------- */
.final-cta-wrap { padding: 0 0 3.5rem; }
.final-cta {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1.5rem;
  padding: 2rem 1.5rem; border-radius: 1.5rem; color: #fff;
  background:
    radial-gradient(30rem 16rem at 90% 0%, rgba(52, 211, 153, 0.35), transparent 60%),
    linear-gradient(135deg, #134e4a, #115e59 55%, #0f766e);
  box-shadow: 0 18px 40px rgba(15, 118, 110, 0.25);
}
.final-cta-mark {
  position: absolute; z-index: -1; right: -1.5rem; bottom: -3rem;
  font-size: 13rem; line-height: 1; color: #fff; opacity: 0.07; pointer-events: none;
}
.final-cta-eyebrow {
  display: inline-flex; align-items: center; gap: 0.35rem; margin-bottom: 0.75rem;
  padding: 0.25rem 0.7rem; border-radius: 999px; background: rgba(255, 255, 255, 0.14);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #a7f3d0;
}
.final-cta #cta-title { margin-bottom: 0.4rem; color: #fff; }
.final-cta .cta-sub { margin: 0; max-width: 34rem; font-size: 1.0625rem; line-height: 1.55; color: rgba(255, 255, 255, 0.86); text-wrap: pretty; }
.final-cta-actions { display: flex; flex-direction: column; gap: 0.6rem; width: 100%; }
.final-cta .btn-light { color: #134e4a; font-weight: 700; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); }
.final-cta .btn-light:hover { background: #ecfdf5; }
.final-cta .btn-outline-light { font-weight: 600; border-width: 1.5px; }
@media (min-width: 576px) { .final-cta-actions { flex-direction: row; width: auto; } }
@media (min-width: 992px) {
  .final-cta { flex-direction: row; align-items: center; justify-content: space-between; gap: 2rem; padding: 2.75rem 3rem; }
  .final-cta-actions { flex: 0 0 auto; }
  .final-cta-mark { right: 26%; bottom: -4rem; font-size: 15rem; }
}

/* ---- Bottom navigation (phones) ------------------------------------------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
  background: rgba(var(--bs-body-bg-rgb), 0.9); border-top: 1px solid var(--bs-border-color-translucent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  box-shadow: 0 -0.25rem 1rem rgba(0, 0, 0, 0.06);
  padding: 0.25rem max(0.25rem, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(0.25rem, env(safe-area-inset-left));
}
.bottom-nav li { flex: 1 1 0; text-align: center; }
.bottom-nav-link, .bottom-nav-create {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 44px; min-height: 52px; padding: 0.25rem 0.35rem;
  color: var(--bs-secondary-color); text-decoration: none; font-size: 0.7rem; line-height: 1.2;
}
.bottom-nav-link .bi { font-size: 1.3rem; }
.bottom-nav-link.active { color: var(--bs-link-color); font-weight: 600; }
.bottom-nav-create { color: var(--bs-body-color); }
.bottom-nav-create-btn {
  width: 3.25rem; height: 3.25rem; margin-top: -1.5rem; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-hover), var(--brand-active)); color: #fff; font-size: 1.6rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0.35rem 0.9rem rgba(var(--brand-rgb), 0.45), 0 0 0 4px var(--bs-body-bg);
}
.bottom-nav-badge { position: absolute; top: 0.1rem; left: 50%; margin-left: 0.35rem; font-size: 0.6rem; }
@media (max-width: 767.98px) {
  body.has-bottom-nav { padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); }
  body.has-bottom-nav .site-toasts { padding-top: calc(4.25rem + env(safe-area-inset-top)); }
}
@media print { .bottom-nav, .final-cta-wrap, .how-tabs, .status-flow { display: none; } }

/* ---- Site-wide polish ------------------------------------------------------- */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 700; }
.card-title, .card h2.h5, .card h2.h6 { font-weight: 700; }
.form-label, .form-floating > label, legend { font-weight: 500; }

/* Navbar links: medium weight, tinted pill for the current page. */
.site-navbar .nav-link { font-weight: 500; color: var(--bs-secondary-color); border-radius: 0.6rem; }
.site-navbar .nav-link:hover { color: var(--bs-body-color); }
.site-navbar .nav-link.active { color: var(--bs-link-color); }
@media (min-width: 992px) {
  .site-navbar .navbar-nav .nav-link { padding-left: 0.75rem; padding-right: 0.75rem; }
  .site-navbar .nav-link:hover { background: var(--bs-tertiary-bg); }
  .site-navbar .nav-link.active { background: var(--bs-primary-bg-subtle); }
  /* keep the unread badge from sitting on the next link */
  .site-navbar .nav-link:has(.notif-badge:not(.d-none)) { margin-right: 0.6rem; }
}

/* Inline codes (token number, UPI ID) in brand colours instead of pink. */
code {
  color: var(--bs-primary-text-emphasis);
  background: var(--bs-primary-bg-subtle);
  padding: 0.15em 0.45em;
  border-radius: 0.4rem;
  font-size: 0.85em;
}

/* Tables: quiet uppercase header, compact cells, rounded inside cards. */
.table { --bs-table-hover-bg: rgba(var(--brand-rgb), 0.04); }
.table > thead > tr > th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bs-secondary-color);
  background: var(--bs-tertiary-bg);
  border-bottom-width: 1px;
  white-space: nowrap;
}
.table > :not(caption) > * > * { padding: 0.75rem 0.6rem; }
.table > :not(caption) > * > *:first-child { padding-left: 1rem; }
.table > :not(caption) > * > *:last-child { padding-right: 1rem; }
/* Clip the header corners on the card itself so the table can still scroll sideways. */
.card:has(> .table-responsive) { overflow: hidden; }
.lead-table .btn-sm { white-space: nowrap; }

/* Soft pills */
.badge.border { border-width: 1px; }
.nav-pills .nav-link:not(.active):hover { background: var(--bs-tertiary-bg); }
.nav-pills .nav-link { font-weight: 500; }

/* Dashboard stat tiles: icon in a tinted square. */
.stat-label .bi {
  width: 2rem; height: 2rem; flex: 0 0 2rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.6rem;
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
  font-size: 1rem;
}
.stat-value { font-weight: 800; letter-spacing: -0.02em; }
.dashboard .card { border: 1px solid var(--bs-border-color-translucent); }

/* ---- Dashboard refresh: hero, accented tiles, activity lists ---------------- */
.dashboard .card { border-radius: var(--bs-border-radius-lg); }
.dashboard .card-body { padding: 1.25rem; }

.dash-hero {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  border-radius: var(--bs-border-radius-xl);
  color: #fff;
  background:
    radial-gradient(22rem 12rem at 90% -10%, rgba(52, 211, 153, 0.5), transparent 70%),
    radial-gradient(16rem 10rem at 0% 120%, rgba(45, 212, 191, 0.3), transparent 70%),
    linear-gradient(135deg, #134e4a, #0f766e 55%, #0d9488);
  box-shadow: 0 10px 30px rgba(15, 118, 110, 0.25);
}
.dash-hero h1 { font-weight: 800; letter-spacing: -0.02em; }
.dash-hero-sub { color: rgba(255, 255, 255, 0.85); }
.dash-hero .btn-primary {
  --bs-btn-bg: #fff;
  --bs-btn-color: #134e4a;
  --bs-btn-border-color: #fff;
  --bs-btn-hover-bg: #ccfbf1;
  --bs-btn-hover-color: #134e4a;
  --bs-btn-hover-border-color: #ccfbf1;
  --bs-btn-active-bg: #99f6e4;
  --bs-btn-active-color: #134e4a;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
@media (min-width: 768px) { .dash-hero { padding: 2rem 2.25rem; } }

/* each tile gets its own accent: a top bar and a tinted icon */
.stat-grid > :nth-child(1) { --accent: #0f766e; }
.stat-grid > :nth-child(2) { --accent: #2563eb; }
.stat-grid > :nth-child(3) { --accent: #7c3aed; }
.stat-grid > :nth-child(4) { --accent: #d97706; }
.stat-grid > :nth-child(5) { --accent: #4f46e5; }
.stat-grid > :nth-child(6) { --accent: #059669; }
.stat-grid > :nth-child(7) { --accent: #db2777; }
.stat-grid > :nth-child(8) { --accent: #ea580c; }
[data-bs-theme="dark"] .stat-grid > :nth-child(1) { --accent: #2dd4bf; }
[data-bs-theme="dark"] .stat-grid > :nth-child(2) { --accent: #60a5fa; }
[data-bs-theme="dark"] .stat-grid > :nth-child(3) { --accent: #a78bfa; }
[data-bs-theme="dark"] .stat-grid > :nth-child(4) { --accent: #fbbf24; }
[data-bs-theme="dark"] .stat-grid > :nth-child(5) { --accent: #818cf8; }
[data-bs-theme="dark"] .stat-grid > :nth-child(6) { --accent: #34d399; }
[data-bs-theme="dark"] .stat-grid > :nth-child(7) { --accent: #f472b6; }
[data-bs-theme="dark"] .stat-grid > :nth-child(8) { --accent: #fb923c; }

.stat-grid .stat-card { overflow: hidden; }
.stat-grid .stat-card::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 35%, transparent));
  pointer-events: none;
}
.stat-grid .stat-label .bi {
  width: 2.5rem; height: 2.5rem; flex-basis: 2.5rem;
  border-radius: 0.8rem;
  font-size: 1.15rem;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.stat-grid .stat-label { font-weight: 600; color: var(--bs-body-color); }
.stat-grid .stat-value { font-size: 2rem; margin: 0.6rem 0 0.25rem; }
.stat-grid .stretched-link { font-weight: 600; color: var(--accent); text-decoration: none; }
.stat-grid .stat-card:hover .stretched-link { text-decoration: underline; }
.stat-card:hover, .stat-card:focus-within { transform: translateY(-3px); }
.stat-grid .stat-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

/* charts, quick links and activity cards */
.dashboard .chart-card h3,
.dashboard section > .card-body h2,
.dashboard .card-body > h3 { font-weight: 700; }
.quick-links .list-group-item {
  border-radius: 0.6rem; border: 0; margin-bottom: 0.15rem;
  font-weight: 500; transition: background-color 0.15s ease, padding-left 0.15s ease;
}
.quick-links .list-group-item .bi { color: var(--bs-link-color); }
.quick-links .list-group-item:hover { background: var(--bs-primary-bg-subtle); padding-left: 1.4rem; }

@media (prefers-reduced-motion: reduce) {
  .stat-card, .quick-links .list-group-item { transition: none; }
  .stat-card:hover, .stat-card:focus-within { transform: none; }
}

/* Breadcrumbs, alerts, modals, list groups */
.breadcrumb { font-size: 0.875rem; --bs-breadcrumb-divider-color: var(--bs-tertiary-color); }
.breadcrumb a { text-decoration: none; font-weight: 500; }
.alert { border-radius: var(--bs-border-radius-lg); }
.modal { --bs-modal-border-radius: var(--bs-border-radius-xl); --bs-modal-border-color: transparent; }
.modal-content { box-shadow: var(--bs-box-shadow); }
.offcanvas { --bs-offcanvas-border-color: var(--bs-border-color-translucent); }
.list-group { --bs-list-group-border-color: var(--bs-border-color-translucent); }
.accordion {
  --bs-accordion-border-color: var(--bs-border-color-translucent);
  --bs-accordion-active-bg: var(--bs-primary-bg-subtle);
  --bs-accordion-active-color: var(--bs-primary-text-emphasis);
  --bs-accordion-btn-focus-box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
  /* Bootstrap's chevrons are fixed blue images: the same chevron in the brand colours */
  --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23134e4a' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M2 5L8 11L14 5'/%3e%3c/svg%3e");
  --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%230f766e' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M2 5L8 11L14 5'/%3e%3c/svg%3e");
}
[data-bs-theme="dark"] .accordion, [data-bs-theme="dark"] .accordion-button::after {  /* Bootstrap sets its dark icons on ::after */
  --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%235eead4' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M2 5L8 11L14 5'/%3e%3c/svg%3e");
  --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2399f6e4' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M2 5L8 11L14 5'/%3e%3c/svg%3e");
}
.accordion-button { font-weight: 600; }

/* Footer: brand teal in both themes, light text */
.site-footer {
  --footer-text: rgba(255, 255, 255, 0.78);
  --footer-muted: rgba(255, 255, 255, 0.6);
  position: relative;
  padding-top: 3rem;
  color: var(--footer-text);
  background:
    radial-gradient(40rem 16rem at 100% 0%, rgba(52, 211, 153, 0.22), transparent 70%),
    linear-gradient(160deg, #0b3f3b, #0f4f4a 55%, #115e59);
  border-top: 3px solid var(--brand-accent);
}
.site-footer a { text-decoration: none; color: var(--footer-text); transition: color 0.15s ease; }
.site-footer a:hover, .site-footer a:focus-visible { color: #fff; }
.site-footer a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 0.25rem; }

.site-footer-brand { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 1.25rem; font-weight: 800; }
.site-footer .site-footer-brand { color: #fff; }
.site-footer-logo {
  width: 2.5rem; height: 2.5rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.8rem; font-size: 1.35rem; color: #fff;
  background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.site-footer-tagline { margin: 0.85rem 0 1rem; max-width: 22rem; font-size: 0.9rem; line-height: 1.6; }
.site-footer-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.site-footer-badges li {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.25rem 0.65rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; color: #fff;
  background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.site-footer-badges .bi { color: var(--brand-accent); }

.site-footer-heading {
  margin-bottom: 0.9rem; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: #fff;
}
.site-footer-links li + li { margin-top: 0.55rem; }
.site-footer-links a { position: relative; font-size: 0.92rem; }
.site-footer-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 0.2s ease;
}
.site-footer-links a:hover::after { transform: scaleX(1); }
@media (pointer: coarse) {
  /* Touch: a taller tap area per link, same spacing between the words */
  .site-footer-links a { display: inline-block; padding: 0.25rem 0; }
  .site-footer-links li + li { margin-top: 0.15rem; }
  .site-footer-links a::after { bottom: 0.15rem; }
}

.site-footer-contact li + li { margin-top: 0.6rem; }
.site-footer-contact a { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.92rem; word-break: break-word; }
.site-footer-icon {
  flex: 0 0 2rem; width: 2rem; height: 2rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255, 255, 255, 0.1); color: var(--brand-accent);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.site-footer-contact a:hover .site-footer-icon { background: var(--brand-accent); color: #0b3f3b; }
/* Support number: opens a small WhatsApp / call menu */
.support-phone-btn {
  display: inline-flex; align-items: center; gap: 0.6rem; padding: 0; border: 0;
  text-decoration: none; font-weight: 500; color: var(--brand);
}
.support-phone-caret { font-size: 0.7rem; transition: transform 0.2s ease; }
.support-phone-btn[aria-expanded="true"] .support-phone-caret { transform: rotate(180deg); }
.site-footer-phone { font-size: 0.92rem; color: var(--footer-text); }
.site-footer-phone:hover, .site-footer-phone:focus-visible, .site-footer-phone[aria-expanded="true"] { color: #fff; }
.site-footer-phone:hover .site-footer-icon, .site-footer-phone[aria-expanded="true"] .site-footer-icon { background: var(--brand-accent); color: #0b3f3b; }
.support-phone-menu { min-width: 16rem; padding: 0.4rem; border-radius: var(--bs-border-radius-lg); border-color: var(--bs-border-color-translucent); box-shadow: var(--bs-box-shadow); }
.support-phone-menu .dropdown-item,
.site-footer .support-phone-menu .dropdown-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0.65rem; border-radius: 0.6rem;
  color: var(--bs-body-color); font-size: 0.92rem; white-space: normal;
}
.support-phone-menu .dropdown-item:hover, .support-phone-menu .dropdown-item:focus { background: var(--bs-tertiary-bg); color: var(--bs-body-color); }
.support-phone-icon {
  flex: 0 0 2.25rem; width: 2.25rem; height: 2.25rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 1.1rem; color: #fff;
}
.support-phone-icon.is-whatsapp { background: #25d366; }
.support-phone-icon.is-call { background: var(--brand-hover); font-size: 0.95rem; }
@media (prefers-reduced-motion: reduce) { .support-phone-caret { transition: none; } }
.site-footer-social { display: flex; gap: 0.5rem; margin-top: 1rem; }
.site-footer-social a {
  width: 2.25rem; height: 2.25rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 1.05rem; background: rgba(255, 255, 255, 0.1);
}
.site-footer-social a:hover { background: var(--brand-accent); color: #0b3f3b; }

.site-footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem;
  margin-top: 2.5rem; padding: 1.25rem 0; border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem; color: var(--footer-muted);
}
.site-footer-bottom .bi-heart-fill { color: #f87171; font-size: 0.75rem; margin: 0 0.15rem; }
.site-footer .site-footer-top {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.85rem; border-radius: 999px; font-weight: 600;
  background: rgba(255, 255, 255, 0.1); color: #fff;
}
.site-footer .site-footer-top:hover { background: #fff; color: #0b3f3b; }
@media (max-width: 767.98px) {
  .site-footer { padding-top: 2.25rem; text-align: left; }
  .site-footer-bottom { justify-content: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .site-footer a, .site-footer-links a::after, .site-footer-icon { transition: none; }
}

/* ---- Login / logout popup ---------------------------------------------------- */
.auth-popup .modal-content { overflow: hidden; border: 0; }
.auth-popup .modal-dialog { max-width: 22rem; }
.auth-popup-band {
  position: relative;
  height: 7.5rem;
  display: flex; align-items: flex-end; justify-content: center;
  background:
    radial-gradient(14rem 7rem at 80% 0%, rgba(52, 211, 153, 0.55), transparent 70%),
    linear-gradient(135deg, #134e4a, #0f766e 60%, #0d9488);
}
.auth-popup-logout .auth-popup-band {
  background:
    radial-gradient(14rem 7rem at 80% 0%, rgba(148, 163, 184, 0.45), transparent 70%),
    linear-gradient(135deg, #1e293b, #334155 60%, #475569);
}
.auth-popup-icon {
  width: 4.5rem; height: 4.5rem; margin-bottom: -2.25rem;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bs-body-bg); color: var(--bs-link-color); font-size: 2rem;
  box-shadow: 0 0 0 6px rgba(var(--bs-body-bg-rgb), 0.35), 0 10px 24px rgba(0, 0, 0, 0.18);
  position: relative; z-index: 1;
  transform: scale(0.4); opacity: 0;
}
.auth-popup-logout .auth-popup-icon { color: var(--bs-secondary-color); }
.auth-popup.is-shown .auth-popup-icon { animation: auth-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.auth-popup .modal-body { padding-top: 3rem; }
.auth-popup.is-shown .modal-body > * { animation: auth-rise 0.45s ease both; }
.auth-popup.is-shown .modal-body > :nth-child(2) { animation-delay: 0.08s; }
.auth-popup.is-shown .modal-body > :nth-child(3) { animation-delay: 0.16s; }

/* little sparkles drifting up out of the band */
.auth-popup-spark {
  position: absolute; width: 0.5rem; height: 0.5rem; border-radius: 50%;
  background: rgba(255, 255, 255, 0.75); opacity: 0;
}
.auth-popup-spark.s1 { left: 18%; bottom: 1.5rem; }
.auth-popup-spark.s2 { left: 32%; bottom: 3.5rem; width: 0.35rem; height: 0.35rem; }
.auth-popup-spark.s3 { right: 22%; bottom: 2rem; }
.auth-popup-spark.s4 { right: 36%; bottom: 4.5rem; width: 0.3rem; height: 0.3rem; }
.auth-popup.is-shown .auth-popup-spark { animation: auth-spark 1.6s ease-out 0.2s both; }
.auth-popup.is-shown .auth-popup-spark.s2 { animation-delay: 0.35s; }
.auth-popup.is-shown .auth-popup-spark.s3 { animation-delay: 0.3s; }
.auth-popup.is-shown .auth-popup-spark.s4 { animation-delay: 0.5s; }

/* auto-close timer bar; hovering or focusing the popup pauses it */
.auth-popup-timer { height: 4px; background: var(--bs-tertiary-bg); }
.auth-popup-timer span {
  display: block; height: 100%; width: 100%; transform-origin: left;
  background: linear-gradient(90deg, var(--brand), var(--brand-accent));
}
.auth-popup-logout .auth-popup-timer span { background: var(--bs-secondary-color); }
.auth-popup.is-shown .auth-popup-timer span { animation: auth-timer 4.5s linear forwards; }
.auth-popup .modal-content:focus-within .auth-popup-timer span { animation-play-state: paused; }

@keyframes auth-pop { to { transform: scale(1); opacity: 1; } }
@keyframes auth-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes auth-spark {
  0% { opacity: 0; transform: translateY(0) scale(0.5); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-2.5rem) scale(1.2); }
}
@keyframes auth-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  .auth-popup-icon { transform: none; opacity: 1; }
  .auth-popup-timer { display: none; }
}

/* ---- Error & legal pages ---------------------------------------------------- */
.legal-page h2 { scroll-margin-top: 5rem; }

/* ---- Offline page ----------------------------------------------------------- */
.offline-page { min-height: 100dvh; }
.offline-card { max-width: 28rem; width: 100%; }

/* ---- Create / edit lead form ------------------------------------------------ */
.lead-form-hero {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.5rem; margin-bottom: 1.25rem;
  border-radius: var(--bs-border-radius-xl);
  color: #fff;
  background:
    radial-gradient(20rem 10rem at 95% -20%, rgba(52, 211, 153, 0.5), transparent 70%),
    linear-gradient(135deg, #134e4a, #0f766e 55%, #0d9488);
  box-shadow: 0 10px 30px rgba(15, 118, 110, 0.22);
}
.lead-form-hero h1 { font-weight: 800; letter-spacing: -0.02em; }
.lead-form-hero p { color: rgba(255, 255, 255, 0.86); }
.lead-form-hero-icon {
  flex: 0 0 3.25rem; width: 3.25rem; height: 3.25rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 1rem; font-size: 1.6rem;
  background: rgba(255, 255, 255, 0.16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.lead-form-perks { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }
.lead-form-perks li {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.25rem 0.7rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
  background: rgba(255, 255, 255, 0.14);
}
.lead-form-perks a { display: inline-flex; align-items: center; gap: 0.35rem; color: inherit; text-decoration: none; }
.lead-form-perks li:has(a) { transition: background-color 0.15s ease; }
.lead-form-perks li:has(a):hover { background: rgba(255, 255, 255, 0.26); }
@media (min-width: 768px) { .lead-form-hero { padding: 2rem; } }

/* ---- Image upload with the current picture beside it (edit profile) -------------- */
.image-field-row { display: flex; align-items: center; gap: 1rem; }
.image-field-body { flex: 1 1 auto; min-width: 0; }
.image-field-current {
  flex: 0 0 auto; width: 6rem; height: 6rem; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 1rem; background: var(--bs-tertiary-bg);
  box-shadow: 0 0 0 1px var(--bs-border-color), 0 4px 12px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.2s ease;
}
.image-field-current a { display: block; width: 100%; height: 100%; }
.image-field-current img { width: 100%; height: 100%; object-fit: cover; }
.image-field-current.is-new { box-shadow: 0 0 0 3px var(--brand), 0 4px 12px rgba(var(--brand-rgb), 0.2); }
.image-field-empty { font-size: 1.75rem; color: var(--brand); }
.avatar-field .image-field-current { border-radius: 50%; }
.avatar-field .image-field-empty { background: var(--bs-primary-bg-subtle); width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.qr-field .image-field-current { background: #fff; }
.qr-field .image-field-current img { object-fit: contain; padding: 0.35rem; }
.lead-form .image-field input[type="file"] { cursor: pointer; }
.lead-form .image-field input[type="file"]::file-selector-button {
  margin-right: 0.75rem; border: 0; border-radius: 999px; padding: 0.3rem 0.9rem;
  background: var(--brand-hover); color: #fff; font-weight: 600;
}
.image-field-clear .form-check-label { font-size: 0.85rem; color: var(--bs-danger-text-emphasis); }
@media (max-width: 575.98px) {
  .image-field-current { width: 4.75rem; height: 4.75rem; }
  .image-field-row { gap: 0.75rem; }
}

/* each fieldset is a card with a numbered icon */
.lead-form { counter-reset: form-section; }
.lead-form .form-section {
  counter-increment: form-section;
  position: relative;
  padding: 1.25rem 1.25rem 0.5rem;
  margin-bottom: 1rem;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--bs-box-shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.lead-form .form-section:hover { transform: translateY(-1px); box-shadow: var(--bs-box-shadow); }
.lead-form .form-section:focus-within {
  border-color: rgba(var(--brand-rgb), 0.55);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), 0.08), var(--bs-box-shadow);
}
.lead-form .form-section > legend {
  float: left; width: 100%;  /* Bootstrap's float keeps the legend inside the card, not on its border */
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1rem; padding-bottom: 0.85rem;
  border-bottom: 1px dashed var(--bs-border-color);
}
.form-section-icon {
  position: relative; flex: 0 0 2.5rem; width: 2.5rem; height: 2.5rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.8rem; font-size: 1.15rem;
  background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.form-section-icon::after {
  content: counter(form-section);
  position: absolute; top: -0.4rem; right: -0.4rem;
  min-width: 1.2rem; height: 1.2rem; padding: 0 0.25rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-size: 0.68rem; font-weight: 700;
  background: var(--brand-hover); color: #fff; box-shadow: 0 0 0 2px var(--bs-body-bg);
}
.lead-form .form-section:focus-within .form-section-icon { background: var(--brand-hover); color: #fff; }
.form-section-title { display: block; font-size: 1.1rem; font-weight: 700; line-height: 1.25; }
.form-section-hint { display: block; font-size: 0.82rem; font-weight: 400; color: var(--bs-secondary-color); }

/* fields */
.lead-form .form-label { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.35rem; }
.lead-form .asteriskField { color: var(--bs-danger); margin-left: 0.15rem; }
.lead-form .form-control,
.lead-form .form-select {
  min-height: 2.9rem; font-size: 1rem;
  background-color: var(--surface-muted);
  border-color: var(--bs-border-color-translucent);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.lead-form .form-control:hover:not(:focus),
.lead-form .form-select:hover:not(:focus) { border-color: rgba(var(--brand-rgb), 0.45); }
.lead-form .form-control:focus,
.lead-form .form-select:focus { background-color: var(--bs-body-bg); }
.lead-form .form-control::placeholder { color: var(--bs-tertiary-color); }
.lead-form .form-text { font-size: 0.8rem; }
.lead-form .invalid-feedback { font-weight: 500; }

/* radio buttons drawn as pills (urgency coloured by level, owner/tenant in the brand colour) */
.choice-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; clear: left; }
.choice-pills .form-check { --pill: var(--brand); position: relative; margin: 0; padding: 0; }
.choice-pills .form-check-input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice-pills .form-check-label {
  display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: 2.6rem; padding: 0.45rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--bs-border-color); background: var(--surface-muted);
  font-weight: 600; cursor: pointer; user-select: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.choice-pills .form-check-label::before {
  content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--pill);
}
.urgency-pills .form-check:nth-child(1) { --pill: var(--bs-success); }
.urgency-pills .form-check:nth-child(2) { --pill: var(--bs-info); }
.urgency-pills .form-check:nth-child(3) { --pill: var(--bs-warning); }
.urgency-pills .form-check:nth-child(4) { --pill: var(--bs-danger); }
.choice-pills .form-check-input:hover + .form-check-label { border-color: var(--pill); }
.choice-pills .form-check-input:checked + .form-check-label {
  border-color: var(--pill); color: var(--bs-body-color);
  background: color-mix(in srgb, var(--pill) 16%, var(--bs-body-bg));
  box-shadow: inset 0 0 0 1px var(--pill);
}
.choice-pills .form-check-input:focus-visible + .form-check-label { box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color); }

/* private token section */
.lead-form .form-section-private {
  background: linear-gradient(180deg, rgba(var(--bs-warning-rgb), 0.07), transparent 60%), var(--bs-body-bg);
  border-color: rgba(var(--bs-warning-rgb), 0.35);
}
.lead-form .form-section-private .form-section-icon { background: rgba(var(--bs-warning-rgb), 0.18); color: var(--bs-warning-text-emphasis); }

/* image upload as a drop area */
.lead-form .form-section-upload input[type="file"] {
  min-height: 5.5rem; padding: 1.75rem 1rem; text-align: center; cursor: pointer;
  border: 2px dashed rgba(var(--brand-rgb), 0.35); background: rgba(var(--brand-rgb), 0.04);
}
.lead-form .form-section-upload input[type="file"]:hover { border-color: var(--brand); background: rgba(var(--brand-rgb), 0.08); }
.lead-form .form-section-upload input[type="file"]::file-selector-button {
  margin-right: 0.75rem; border: 0; border-radius: 999px; padding: 0.4rem 1rem;
  background: var(--brand-hover); color: #fff; font-weight: 600;
}

/* actions stay in reach while scrolling */
.lead-form-actions {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem;
  margin: 1.25rem -0.25rem 0; padding: 0.85rem 1rem;
  border-radius: var(--bs-border-radius-lg);
  background: rgba(var(--bs-body-bg-rgb), 0.88);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border: 1px solid var(--bs-border-color-translucent);
  box-shadow: 0 -0.25rem 1.25rem rgba(16, 24, 40, 0.08);
}
.lead-form-actions .btn-primary { min-width: 11rem; }
@media (max-width: 575.98px) {
  .lead-form-actions .btn { flex: 1 1 auto; }
  .lead-form .form-section { padding: 1rem 1rem 0.25rem; }
}
@media (max-width: 767.98px) {
  body.has-bottom-nav .lead-form-actions { bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 0.25rem); }
}
@media (prefers-reduced-motion: reduce) {
  .lead-form .form-section, .lead-form .form-section-icon,
  .lead-form .form-control, .lead-form .form-select, .choice-pills .form-check-label { transition: none; }
  .lead-form .form-section:hover { transform: none; }
}

/* ---- Dashboard, second pass: hero to-dos, section titles, tiles ------------------ */
.dash-hero-date { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; color: rgba(255, 255, 255, 0.75); }
.dash-hero-todo { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.dash-hero-todo a {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.85rem; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600; color: #fff; text-decoration: none;
  background: rgba(255, 255, 255, 0.16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  transition: background-color 0.15s ease;
}
.dash-hero-todo a:hover, .dash-hero-todo a:focus-visible { background: rgba(255, 255, 255, 0.28); color: #fff; }
.dash-hero .btn-lg { padding: 0.65rem 1.4rem; }

.dash-section-title {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0.25rem 0 0.85rem;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--bs-secondary-color);
}
.dash-section-title::after { content: ""; flex: 1; height: 1px; background: var(--bs-border-color-translucent); }
.dash-section-title .bi { color: var(--bs-link-color); font-size: 0.95rem; }

.dash-card-title {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 1rem; font-weight: 700; margin-bottom: 0.9rem;
}
.chart-card .dash-card-title { margin-bottom: 0.1rem; }
.dash-card-icon {
  flex: 0 0 2rem; width: 2rem; height: 2rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.6rem; font-size: 1rem;
  background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis);
}
.dashboard .card { transition: box-shadow 0.15s ease, border-color 0.15s ease; }
.dashboard .card:hover { box-shadow: var(--bs-box-shadow); }

/* quick links: icon tiles */
.quick-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.quick-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem;
  padding: 0.85rem; border-radius: var(--bs-border-radius);
  border: 1px solid var(--bs-border-color-translucent); background: var(--surface-muted);
  color: var(--bs-body-color); font-size: 0.875rem; font-weight: 600; text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.quick-tile .bi { font-size: 1.3rem; color: var(--bs-link-color); }
.quick-tile:hover, .quick-tile:focus-visible {
  transform: translateY(-2px); color: var(--bs-body-color);
  border-color: rgba(var(--brand-rgb), 0.45); background: var(--bs-primary-bg-subtle);
}


@media (prefers-reduced-motion: reduce) {
  .dash-hero-todo a, .quick-tile, .dashboard .card { transition: none; }
  .quick-tile:hover { transform: none; }
}

/* ---- My Leads: page hero, tabs with counts, filter card, table, phone cards ------- */
.page-hero {
  padding: 1.25rem 1.5rem;
  border-radius: var(--bs-border-radius-xl);
  color: #fff;
  background:
    radial-gradient(20rem 10rem at 95% -20%, rgba(52, 211, 153, 0.5), transparent 70%),
    linear-gradient(135deg, #134e4a, #0f766e 55%, #0d9488);
  box-shadow: 0 10px 30px rgba(15, 118, 110, 0.22);
}
.page-hero h1 { font-weight: 800; letter-spacing: -0.02em; }
.page-hero p { color: rgba(255, 255, 255, 0.86); }
.page-hero-icon {
  flex: 0 0 3rem; width: 3rem; height: 3rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.9rem; font-size: 1.45rem;
  background: rgba(255, 255, 255, 0.16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.page-hero-btn { color: #134e4a; font-weight: 600; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15); }
@media (max-width: 575.98px) { .page-hero-btn { width: 100%; } }

/* tabs: a segmented control with counts */
.my-leads-tabs {
  gap: 0.25rem; padding: 0.3rem;
  background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent);
  border-radius: 999px; box-shadow: var(--bs-box-shadow-sm);
}
.my-leads-tabs .nav-link {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.5rem 0.95rem; border-radius: 999px;
  font-size: 0.9rem; font-weight: 600; color: var(--bs-secondary-color);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.my-leads-tabs .nav-link:hover { color: var(--bs-body-color); background: var(--bs-tertiary-bg); }
.my-leads-tabs .nav-link.active { color: #fff; background: var(--brand-hover); box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.3); }
.tab-count {
  min-width: 1.5rem; padding: 0.05rem 0.45rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
  background: var(--bs-secondary-bg); color: var(--bs-body-color);
}
.my-leads-tabs .nav-link.active .tab-count { background: rgba(255, 255, 255, 0.22); color: #fff; }
.my-leads-tabs .nav-link { white-space: nowrap; }
@media (max-width: 575.98px) {
  /* phones: tabs stay on one line and the row scrolls sideways (icons dropped to save room) */
  .my-leads-tabs { width: 100%; border-radius: 1rem; scrollbar-width: none; }
  .my-leads-tabs::-webkit-scrollbar { display: none; }
  .my-leads-tabs .nav-item { flex: 0 0 auto; }
  .my-leads-tabs .nav-link { white-space: nowrap; gap: 0.3rem; padding: 0.45rem 0.75rem; border-radius: 0.8rem; font-size: 0.82rem; }
  .my-leads-tabs .nav-link > .bi { display: none; }
}

/* filter panel (shared with Find Work on the home page) */
.filters-head { align-items: center; gap: 0.5rem; margin-bottom: 1rem; padding-bottom: 0.85rem; border-bottom: 1px dashed var(--bs-border-color); }
.filters-head h2 { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; }
.filter-form .form-label { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.25rem; color: var(--bs-secondary-color); }
.filter-form .form-control,
.filter-form .form-select {
  background-color: var(--surface-muted); border-color: var(--bs-border-color-translucent);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.filter-form .form-control:hover:not(:focus),
.filter-form .form-select:hover:not(:focus) { border-color: rgba(var(--brand-rgb), 0.45); }
.filter-form .form-control:focus,
.filter-form .form-select:focus { background-color: var(--bs-body-bg); }
@media (min-width: 992px) {
  .filters-panel .offcanvas-body { border: 1px solid var(--bs-border-color-translucent); }
}

/* table */
.my-leads-table thead th {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--bs-secondary-color); background: var(--surface-muted);
  border-bottom: 1px solid var(--bs-border-color-translucent); padding-top: 0.8rem; padding-bottom: 0.8rem;
}
.my-leads-table tbody td { padding-top: 0.85rem; padding-bottom: 0.85rem; }
.my-leads-table tbody tr { transition: background-color 0.15s ease; }
.my-leads-table tbody tr:hover > * { --bs-table-bg-state: rgba(var(--brand-rgb), 0.05); }
.my-leads-table .lead-title-cell { color: var(--bs-secondary-color); margin-top: 0.15rem; }
.ref-chip {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 0.45rem;
  font-family: var(--bs-font-monospace); font-size: 0.8rem; font-weight: 700; text-decoration: none;
  background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis);
  border: 1px solid var(--bs-primary-border-subtle);
}
.ref-chip:hover { background: var(--brand-hover); color: #fff; border-color: var(--brand-hover); }

/* phone cards: a status-coloured edge */
.lead-mini-card {
  border: 1px solid var(--bs-border-color-translucent); box-shadow: var(--bs-box-shadow-sm);
  border-left: 4px solid var(--edge, var(--bs-secondary));
}
.lead-mini-card .h6 { font-weight: 700; }
.edge-success { --edge: var(--bs-success); }
.edge-primary { --edge: var(--brand); }
.edge-warning { --edge: var(--bs-warning); }
.edge-info { --edge: var(--bs-info); }
.edge-danger { --edge: var(--bs-danger); }
.edge-secondary { --edge: var(--bs-secondary); }

/* empty list */
.empty-state-icon {
  width: 4.5rem; height: 4.5rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 2rem;
  background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis);
}

@media (prefers-reduced-motion: reduce) {
  .my-leads-tabs .nav-link, .filter-form .form-control, .filter-form .form-select, .my-leads-table tbody tr { transition: none; }
}

/* Server status bar under the header: green = working, red = not working */
.server-status-bar {
  border-bottom: 1px solid var(--bs-border-color-translucent);
  background: var(--bs-body-bg);
  font-size: 0.82rem;
}
.server-status-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; padding-top: 0.45rem; padding-bottom: 0.45rem; }
.server-status-title {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem;
  color: var(--bs-secondary-color);
}
.server-status-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.server-pill {
  --state: var(--bs-success);
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.2rem 0.75rem 0.2rem 0.6rem; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--state) 45%, transparent);
  background: color-mix(in srgb, var(--state) 12%, var(--bs-body-bg));
  font-weight: 600; cursor: default;
}
.server-pill.is-down { --state: var(--bs-danger); }
.server-dot {
  position: relative; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--state);
}
.server-dot::after {  /* a soft pulse so the state catches the eye */
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--state);
  animation: server-pulse 1.8s ease-out infinite;
}
.server-name { color: var(--bs-body-color); }
.server-state { color: color-mix(in srgb, var(--state) 80%, var(--bs-body-color)); font-weight: 700; }
.server-note { font-weight: 500; color: var(--bs-secondary-color); }
@keyframes server-pulse { from { transform: scale(1); opacity: 0.6; } to { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .server-dot::after { animation: none; display: none; } }
@media print { .server-status-bar { display: none; } }

/* Scrolling notice above How It Works (pauses on hover/focus; still for reduced motion) */
.notice-ticker {
  display: flex; align-items: stretch; margin-bottom: 2rem; overflow: hidden;
  border-radius: 999px; border: 1px solid rgba(var(--bs-warning-rgb), 0.45);
  background: rgba(var(--bs-warning-rgb), 0.12);
  box-shadow: var(--bs-box-shadow-sm);
}
.notice-ticker-label {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 1rem; font-size: 0.82rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  color: #fff; background: linear-gradient(135deg, #b45309, #d97706);
}
.notice-ticker-label .bi { animation: notice-ring 2.4s ease-in-out infinite; }
.notice-ticker-track { position: relative; flex: 1 1 auto; min-width: 0; overflow: hidden; display: flex; align-items: center; }
.notice-ticker-track::before, .notice-ticker-track::after {  /* soft fade at both edges */
  content: ""; position: absolute; top: 0; bottom: 0; width: 1.5rem; z-index: 1; pointer-events: none;
}
.notice-ticker-track::before { left: 0; background: linear-gradient(90deg, var(--notice-bg), transparent); }
.notice-ticker-track::after { right: 0; background: linear-gradient(-90deg, var(--notice-bg), transparent); }
.notice-ticker { --notice-bg: color-mix(in srgb, var(--bs-warning) 12%, var(--bs-body-bg)); }
.notice-ticker-move { display: flex; width: max-content; animation: notice-scroll 28s linear infinite; }
.notice-ticker-text {
  padding: 0.55rem 3rem 0.55rem 1.25rem; white-space: nowrap;
  font-size: 0.95rem; font-weight: 600; color: var(--bs-warning-text-emphasis);
}
.notice-ticker:hover .notice-ticker-move,
.notice-ticker-track:focus .notice-ticker-move { animation-play-state: paused; }
.notice-ticker-track:focus-visible { outline: 2px solid var(--bs-warning); outline-offset: -2px; }
@keyframes notice-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes notice-ring { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(-14deg); } 85% { transform: rotate(12deg); } }
@media (max-width: 575.98px) {
  .notice-ticker { border-radius: var(--bs-border-radius-lg); }
  .notice-ticker-label span, .notice-ticker-label { font-size: 0.72rem; padding: 0.5rem 0.7rem; }
  .notice-ticker-text { font-size: 0.88rem; }
}
@media (prefers-reduced-motion: reduce) {
  .notice-ticker-move { animation: none; width: auto; }
  .notice-ticker-text { white-space: normal; }
  .notice-ticker-text[aria-hidden="true"] { display: none; }
  .notice-ticker-label .bi { animation: none; }
}

/* "Posted between": two date inputs inside one bordered box */
.filter-form legend.form-label { float: none; width: auto; font-size: 0.8rem; }
.date-range {
  border: 1px solid var(--bs-border-color-translucent); border-radius: var(--bs-border-radius);
  background: var(--surface-muted); overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.date-range:hover { border-color: rgba(var(--brand-rgb), 0.45); }
.date-range:focus-within { border-color: var(--brand); box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color); background: var(--bs-body-bg); }
.date-range-row { display: flex; align-items: center; margin: 0; cursor: text; }
.date-range-row + .date-range-row { border-top: 1px dashed var(--bs-border-color); }
.date-range-label {
  flex: 0 0 3rem; padding-left: 0.75rem;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--bs-secondary-color);
}
.date-range input {
  flex: 1 1 auto; min-width: 0; padding: 0.5rem 0.75rem 0.5rem 0.25rem;
  border: 0; background: transparent; color: var(--bs-body-color); font: inherit; outline: 0;
}
.date-range input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.7; }
[data-bs-theme="dark"] .date-range input::-webkit-calendar-picker-indicator { filter: invert(1); }

/* result count + active filter chips above lead lists */
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.85rem; }
.active-filters-count { font-size: 0.85rem; font-weight: 700; color: var(--bs-secondary-color); margin-right: 0.25rem; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.5rem 0.3rem 0.75rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; text-decoration: none;
  background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis);
  border: 1px solid var(--bs-primary-border-subtle);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.filter-chip .bi {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.1rem; height: 1.1rem; border-radius: 50%; font-size: 0.6rem;
  background: rgba(var(--brand-rgb), 0.15);
}
.filter-chip:hover, .filter-chip:focus-visible { background: var(--brand-hover); color: #fff; border-color: var(--brand-hover); }
.filter-chip:hover .bi { background: rgba(255, 255, 255, 0.25); }

/* ---- Header: brand tile, underline for the current page, account menu ------------ */
.brand-tile {
  width: 2.3rem; height: 2.3rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.75rem; font-size: 1.3rem; color: #fff;
  background: linear-gradient(135deg, #0f766e, #0d9488);
  box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.3);
}
.brand-tile-sm { width: 2rem; height: 2rem; font-size: 1.1rem; border-radius: 0.6rem; }
.site-navbar .navbar-brand { font-size: 1.2rem; letter-spacing: -0.02em; }

@media (min-width: 992px) {
  .site-navbar .navbar-nav .nav-link { position: relative; }
  .site-navbar .navbar-nav .nav-link.active { background: transparent; font-weight: 600; }
  .site-navbar .navbar-nav .nav-link.active::after {  /* a short teal bar under the current page */
    content: ""; position: absolute; left: 50%; bottom: -0.15rem; width: 1.4rem; height: 3px;
    border-radius: 3px; background: var(--brand); transform: translateX(-50%);
  }
  .site-navbar .nav-bell { font-size: 1.15rem; padding-top: 0.35rem; padding-bottom: 0.35rem; }
  .site-navbar .nav-bell.active::after { bottom: -0.25rem; }
}
.nav-cta { font-weight: 600; border-radius: 999px; padding-left: 1.1rem; padding-right: 1.1rem; box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.25); }

.user-avatar {
  flex: 0 0 auto; width: 2.25rem; height: 2.25rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.02em; color: #fff;
  background: linear-gradient(135deg, #0d9488, #10b981);
}
.nav-user {
  display: inline-flex; align-items: center; gap: 0.3rem; margin-left: 0.25rem;
  padding: 0.2rem 0.45rem 0.2rem 0.2rem; border: 1px solid var(--bs-border-color-translucent); border-radius: 999px;
  background: var(--bs-body-bg); color: var(--bs-secondary-color);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.nav-user:hover, .nav-user[aria-expanded="true"] { border-color: rgba(var(--brand-rgb), 0.5); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.1); }
.user-menu { min-width: 15rem; padding: 0.4rem; border-radius: var(--bs-border-radius-lg); border-color: var(--bs-border-color-translucent); box-shadow: var(--bs-box-shadow); }
.user-menu-head { display: flex; align-items: center; gap: 0.65rem; padding: 0.5rem 0.6rem 0.75rem; margin-bottom: 0.3rem; border-bottom: 1px solid var(--bs-border-color-translucent); }
.user-menu .dropdown-item { display: flex; align-items: center; gap: 0.6rem; border-radius: 0.5rem; padding: 0.5rem 0.65rem; font-weight: 500; }
.user-menu .dropdown-item .bi { width: 1.1rem; color: var(--bs-secondary-color); }
.user-menu .dropdown-item.text-danger .bi { color: inherit; }
.user-menu .dropdown-item:active { background: var(--bs-primary-bg-subtle); color: var(--bs-body-color); }

/* phone menu (offcanvas) */
@media (max-width: 991.98px) {
  .site-menu { --bs-offcanvas-width: min(20rem, 88vw); }
  .site-menu .offcanvas-header { border-bottom: 1px solid var(--bs-border-color-translucent); }
  .site-menu .nav-link { display: flex; align-items: center; gap: 0.75rem; padding-left: 0.75rem; padding-right: 0.75rem; border-radius: 0.65rem; }
  .site-menu .nav-link .bi { width: 1.2rem; font-size: 1.1rem; color: var(--bs-secondary-color); }
  .site-menu .nav-link.active { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); font-weight: 600; }
  .site-menu .nav-link.active .bi { color: inherit; }
  .menu-user {
    display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; padding: 0.75rem;
    border-radius: var(--bs-border-radius-lg); text-decoration: none; color: var(--bs-body-color);
    background: var(--surface-muted); border: 1px solid var(--bs-border-color-translucent);
  }
  .menu-user .user-avatar { width: 2.75rem; height: 2.75rem; font-size: 0.95rem; }
  .menu-divider { margin: 0.5rem 0; border-top: 1px solid var(--bs-border-color-translucent); }
  .menu-logout { margin-top: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) { .nav-user { transition: none; } }

/* ---- Language switcher (header) ------------------------------------------------------ */
.lang-btn { gap: 0.3rem; padding-left: 0.5rem; padding-right: 0.5rem; color: var(--bs-secondary-color); text-decoration: none; }
.lang-btn:hover, .lang-btn[aria-expanded="true"] { color: var(--bs-body-color); }
.lang-current {
  min-width: 1.6rem; padding: 0.05rem 0.4rem; border-radius: 0.4rem; font-size: 0.75rem; font-weight: 800;
  background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); line-height: 1.4;
}
.lang-menu { min-width: 11rem; padding: 0.4rem; border-radius: var(--bs-border-radius-lg); border-color: var(--bs-border-color-translucent); box-shadow: var(--bs-box-shadow); }
.lang-menu .dropdown-item { display: flex; align-items: center; gap: 0.6rem; border-radius: 0.5rem; padding: 0.5rem 0.65rem; font-weight: 600; }
.lang-menu .dropdown-item.active { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }
.lang-code {
  width: 1.9rem; height: 1.6rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.4rem; font-size: 0.75rem; font-weight: 800; background: var(--bs-tertiary-bg);
}
.lang-menu .dropdown-item.active .lang-code { background: var(--brand-hover); color: #fff; }
/* Phones: keep logo, language, theme and menu on one row */
@media (max-width: 575.98px) {
  .site-navbar > .container { flex-wrap: nowrap; }
  .site-navbar .navbar-brand { font-size: 1.05rem; margin-right: 0.25rem; min-width: 0; }
  .site-navbar .navbar-brand > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .site-navbar .brand-tile { width: 2.25rem; height: 2.25rem; font-size: 1.15rem; }
  .lang-btn { padding-left: 0.35rem; padding-right: 0.35rem; }
  .lang-btn .bi-translate { display: none; }
}
/* ---- Header polish ----------------------------------------------------------------------- */
/* Soft shadow instead of the grey line once the page scrolls (main.js adds .is-scrolled) */
.site-navbar { transition: box-shadow 0.2s ease; }
.site-navbar.is-scrolled { border-bottom-color: transparent !important; box-shadow: 0 4px 18px rgba(16, 24, 40, 0.07); }
[data-bs-theme="dark"] .site-navbar.is-scrolled { box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45); }
/* The status bar reads as part of the header: no line between them */
/* (only the header's own line: --bs-border-color would also blank borders inside the ☰ menu) */
.site-navbar:has(+ .server-status-bar):not(.is-scrolled) { border-bottom-color: transparent !important; }

/* Phones: dark mode moves into the ☰ menu; the language button stays in the header */
@media (max-width: 991.98px) {
  .nav-tools > .nav-prefs [data-theme-toggle] { display: none; }  /* dark mode is in the menu; the language stays in the header */
  .app-menu-prefs { display: flex; gap: 0.5rem; padding-top: 0.75rem; border-top: 1px solid var(--bs-border-color-translucent); }
}
@media (max-width: 575.98px) {
  .site-navbar { padding-top: max(0.35rem, env(safe-area-inset-top)); padding-bottom: 0.35rem; }
  .site-navbar .navbar-brand { font-size: 1.08rem; padding-top: 0; padding-bottom: 0; }
  .site-navbar .brand-tile { width: 2rem; height: 2rem; font-size: 1.1rem; border-radius: 0.6rem; box-shadow: 0 3px 8px rgba(var(--brand-rgb), 0.25); }
}

/* Desktop: current page as a soft teal pill, tools grouped in one rounded box, slimmer buttons */
@media (min-width: 992px) {
  .site-navbar .navbar-nav .nav-link { padding-top: 0.4rem; padding-bottom: 0.4rem; border-radius: 999px; transition: background-color 0.15s ease, color 0.15s ease; }
  .site-navbar .navbar-nav .nav-link.active { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }
  .site-navbar .navbar-nav .nav-link.active::after { display: none; }
  .site-navbar .navbar-nav .btn { padding: 0.4rem 1.05rem; font-size: 0.92rem; font-weight: 600; border-radius: 999px; }
  .nav-prefs {
    display: inline-flex; align-items: center; gap: 0.1rem; margin-left: 0.35rem; padding: 0.15rem;
    border: 1px solid var(--bs-border-color-translucent); border-radius: 999px; background: var(--bs-tertiary-bg);
  }
  .nav-prefs .nav-icon-btn { min-width: 2.35rem; min-height: 2.35rem; padding: 0.25rem 0.45rem; border-radius: 999px; }
  .nav-prefs .nav-icon-btn:hover, .nav-prefs .nav-icon-btn[aria-expanded="true"] { background: var(--bs-body-bg); }
}
.nav-cta {
  border: 0; color: #fff;
  background: linear-gradient(135deg, var(--brand-hover), var(--brand));
  box-shadow: 0 3px 10px rgba(var(--brand-rgb), 0.28);
}
.nav-cta:hover, .nav-cta:focus-visible { color: #fff; background: linear-gradient(135deg, var(--brand-active), var(--brand-hover)); }

/* Status bar: one slim row; on phones the heading goes and the pills scroll sideways */
.server-status-inner { min-height: 2.5rem; }
.server-pill { transition: border-color 0.15s ease; }
.server-pill:hover { border-color: var(--state); }
@media (max-width: 575.98px) {
  .server-status-inner { flex-wrap: nowrap; gap: 0.5rem; padding-top: 0.35rem; padding-bottom: 0.35rem; min-height: 0; }
  .server-status-title { display: none; }
  .server-status-list { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .server-status-list::-webkit-scrollbar { display: none; }
  .server-pill { flex: 0 0 auto; font-size: 0.78rem; padding: 0.15rem 0.65rem 0.15rem 0.5rem; }
  .install-pill { flex: 0 0 auto; }
  /* Both pills and Install fit: the green dot says "Working" (still read aloud); "Not working" always shows */
  .server-pill.is-up .server-state { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { .site-navbar, .server-pill, .site-navbar .navbar-nav .nav-link { transition: none; } }

/* Devanagari needs a little more line height than Latin text */
:lang(hi), :lang(mr) { line-height: 1.6; }

/* ---- Login, register, password pages: brand panel + form ------------------------ */
.auth-shell {
  display: grid; grid-template-columns: 1fr;
  overflow: hidden;
  border-radius: var(--bs-border-radius-xl);
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color-translucent);
  box-shadow: 0 20px 50px rgba(16, 24, 40, 0.1);
}
@media (min-width: 992px) { .auth-shell { grid-template-columns: 5fr 7fr; } }

.auth-aside {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 1.25rem 1.5rem;
  color: rgba(255, 255, 255, 0.85);
  background:
    radial-gradient(22rem 14rem at 110% 0%, rgba(52, 211, 153, 0.45), transparent 70%),
    radial-gradient(18rem 12rem at -20% 110%, rgba(45, 212, 191, 0.3), transparent 70%),
    linear-gradient(150deg, #0b3f3b, #0f766e 60%, #0d9488);
}
.auth-aside-brand { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 1.2rem; font-weight: 800; color: #fff; text-decoration: none; }
.auth-aside-brand:hover { color: #fff; }
.auth-aside-logo {
  width: 2.4rem; height: 2.4rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.75rem; font-size: 1.3rem;
  background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
.auth-aside-body { display: none; }
.auth-aside-title { font-size: 1.6rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.02em; color: #fff; margin-bottom: 1.5rem; }
.auth-aside-points li { display: flex; gap: 0.85rem; align-items: flex-start; }
.auth-aside-points li + li { margin-top: 1.1rem; }
.auth-aside-points li > span {
  flex: 0 0 2.25rem; width: 2.25rem; height: 2.25rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.7rem; background: rgba(255, 255, 255, 0.12); color: var(--brand-accent); font-size: 1.05rem;
}
.auth-aside-points strong { display: block; color: #fff; font-size: 0.95rem; }
.auth-aside-points div { font-size: 0.85rem; line-height: 1.5; }
@media (min-width: 992px) {
  .auth-aside { padding: 2.5rem; }
  .auth-aside-body { display: flex; flex-direction: column; flex: 1; justify-content: center; margin-top: 2rem; }
}

.auth-main { padding: 1.5rem; }
@media (min-width: 576px) { .auth-main { padding: 2.25rem 2.5rem; } }
@media (min-width: 992px) { .auth-main { padding: 3rem; } }
.auth-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }
.auth-head .auth-icon {
  flex: 0 0 3.25rem; width: 3.25rem; height: 3.25rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 1rem; font-size: 1.5rem;
  background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis);
}
.auth-head h1 { font-weight: 800; letter-spacing: -0.02em; }

.auth-form .form-control,
.auth-form .form-select {
  background-color: var(--surface-muted); border-color: var(--bs-border-color-translucent);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-form .form-control:hover:not(:focus),
.auth-form .form-select:hover:not(:focus) { border-color: rgba(var(--brand-rgb), 0.45); }
.auth-form .form-control:focus,
.auth-form .form-select:focus { background-color: var(--bs-body-bg); }
.auth-form .form-floating > label { color: var(--bs-secondary-color); }
.auth-form .asteriskField { color: var(--bs-danger); }
.auth-form .btn-primary.btn-lg {
  padding-top: 0.8rem; padding-bottom: 0.8rem; font-weight: 700;
  box-shadow: 0 8px 20px rgba(var(--brand-rgb), 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.auth-form .btn-primary.btn-lg:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(var(--brand-rgb), 0.35); }
.auth-after:has(*) { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px dashed var(--bs-border-color); }
.auth-after p { margin: 0; text-align: center; color: var(--bs-secondary-color); }
.auth-after a { font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  .auth-form .form-control, .auth-form .form-select, .auth-form .btn-primary.btn-lg { transition: none; }
  .auth-form .btn-primary.btn-lg:hover { transform: none; }
}

/* ---- Home page type scale -------------------------------------------------------
   One set of sizes for the whole page: 12 / 13 / 14 / 15 / 16 / 17px for text,
   one size for every section heading, and calmer buttons. */
:root {
  --fs-2xs: 0.75rem;     /* 12px: table headers, tiny uppercase labels */
  --fs-xs: 0.8125rem;    /* 13px: meta text (time ago, hints) */
  --fs-sm: 0.875rem;     /* 14px: secondary text */
  --fs-md: 0.9375rem;    /* 15px: compact body (table, lists, footer) */
  --fs-btn: 1.0625rem;   /* 17px: large buttons */
  --fs-section: clamp(1.5rem, 1.25rem + 0.8vw, 1.875rem); /* 24 to 30px: section headings */
}

/* hero */
.hero .btn-lg, .final-cta .btn-lg, .how-section .btn-lg { font-size: var(--fs-btn); padding: 0.7rem 1.35rem; }
.trust-label { font-size: var(--fs-2xs); }

/* section headings share one size and weight */
#leads-title, #how-title, #cta-title {
  font-size: var(--fs-section); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
}
#how-title + p { font-size: var(--fs-md); }

/* lead table */
#leads .lead-table th { font-size: var(--fs-2xs); letter-spacing: 0.05em; }
#leads .lead-table td { font-size: var(--fs-md); }
#leads .lead-table td a { font-weight: 700; }
#leads .lead-table td .small, #leads .lead-table td small { font-size: var(--fs-xs); }
#leads .lead-table .badge { font-size: var(--fs-2xs); }
#leads .lead-table .btn { font-size: var(--fs-sm); }
#leads .form-label { font-size: var(--fs-xs); }
#leads .form-control, #leads .form-select { font-size: var(--fs-md); }

/* benefits row and notice */
.why-strip-list li { font-size: var(--fs-md); }
.why-strip-link { font-size: var(--fs-sm); }
.notice-ticker-label { font-size: var(--fs-2xs); letter-spacing: 0.06em; }
.notice-ticker-track { font-size: var(--fs-md); font-weight: 500; }

/* How It Works */
.how-tabs .nav-link { font-size: var(--fs-md); font-weight: 600; }
.how-step h3 { font-size: 1.0625rem; font-weight: 700; line-height: 1.3; }
.how-section .how-step p { font-size: var(--fs-sm); line-height: 1.55; }
.status-flow .status-chip { font-size: var(--fs-xs); font-weight: 600; padding: 0.45em 0.85em; }
.status-flow .small, .how-section p.small:not(.how-step p) { font-size: var(--fs-xs); }

/* footer */
.site-footer p, .site-footer-links a, .site-footer-contact a, .site-footer-phone { font-size: var(--fs-md); }
.site-footer-heading { font-size: var(--fs-2xs); }
.site-footer-bottom p, .site-footer-bottom a { font-size: var(--fs-xs); }

@media (max-width: 575.98px) {
  .why-strip-list li { font-size: var(--fs-xs); }
}
/* Devanagari reads small at the same pixel size: nudge tiny labels up */
:lang(hi) .trust-label, :lang(mr) .trust-label,
:lang(hi) .site-footer-heading, :lang(mr) .site-footer-heading,
:lang(hi) #leads .lead-table th, :lang(mr) #leads .lead-table th { font-size: var(--fs-xs); letter-spacing: 0; }
/* benefits row right after How It Works, before the closing call to action */
.how-section:has(+ .why-strip) { padding-bottom: 1.5rem; }
.how-section + .why-strip { padding: 0 0 3rem; }

/* How It Works, compact: icon beside the title, smaller cards, less padding */
.how-section { padding: 2.5rem 0; }
.how-section .how-step h3 { display: flex; align-items: center; gap: 0.4rem; font-size: 0.95rem; margin-bottom: 0.2rem !important; }
.how-section .how-icon { display: inline-block; margin: 0; font-size: 1.05rem; flex: 0 0 auto; }
.how-section .how-body { padding: 0.7rem 0.85rem; }
.how-section .how-step p { font-size: var(--fs-xs); line-height: 1.45; }
.how-section .how-steps { gap: 0.75rem; }
@media (min-width: 992px) {
  .how-section .how-step h3 { justify-content: center; }
  .how-section .how-body { padding: 0.8rem 0.75rem; }
}
.how-tabs .nav-link { padding: 0.4rem 0.95rem; }
.how-section .how-num { flex-basis: 2.1rem; width: 2.1rem; height: 2.1rem; font-size: 0.9rem; box-shadow: 0 0 0 3px var(--bs-body-bg), 0 3px 8px rgba(var(--brand-rgb), 0.28); }
.how-section .how-step { gap: 0.75rem; }
.how-section .how-step:not(:last-child)::before { left: calc(1.05rem - 1px); top: 2.1rem; bottom: -0.75rem; }
@media (min-width: 992px) {
  .how-section .how-step { gap: 0.6rem; }
  .how-section .how-steps { gap: 0.75rem; }
  .how-section .how-step:not(:last-child)::before {
    left: calc(50% + 1.05rem); right: calc(-50% - 0.75rem + 1.05rem); top: calc(1.05rem - 1px); bottom: auto;
  }
}

/* Agreement version (1.9 / 2.0): pill on the lead page, portal button for the approved Worker */
.agreement-badge { font-size: 0.8rem; font-weight: 600; padding: 0.4em 0.75em; background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); border: 1px solid var(--bs-primary-border-subtle); }

/* Create Lead, Work details: segmented toggles (.choice-row) and the customer fields.
   One label style, one control height (3rem toggles, 3.6rem floating fields), no nested boxes. */
.lead-form .choice-row { margin-bottom: 1.25rem; }
.lead-form .choice-row > [class*="col-"] > .mb-3 { margin-bottom: 0 !important; }
.lead-form .choice-row fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.lead-form .choice-row legend.form-label {
  float: none; width: auto; padding: 0; margin-bottom: 0.4rem;
  font-size: 0.9rem !important; font-weight: 600; color: var(--bs-body-color);
}
.choice-row .choice-pills {
  display: flex; flex-wrap: nowrap; gap: 0.25rem; padding: 0.25rem; min-height: 3rem;
  border-radius: var(--bs-border-radius-lg); background: var(--surface-muted);
  border: 1px solid var(--bs-border-color-translucent);
}
.choice-row .choice-pills .form-check { flex: 1 1 0; min-width: 0; display: flex; }
.choice-row .choice-pills .form-check-label {
  width: 100%; min-height: 2.45rem; justify-content: center; gap: 0.4rem; padding: 0.3rem 0.5rem;
  border: 0; border-radius: calc(var(--bs-border-radius-lg) - 0.2rem); background: transparent;
  font-size: 0.925rem; font-weight: 600; color: var(--bs-secondary-color); white-space: nowrap;
}
.choice-row .choice-pills .form-check-label::before {
  width: 0.5rem; height: 0.5rem; background: var(--bs-border-color); transition: background-color 0.15s ease;
}
.choice-row .choice-pills .form-check-input:hover + .form-check-label { color: var(--bs-body-color); background: var(--bs-body-bg); }
.choice-row .choice-pills .form-check-input:checked + .form-check-label {
  color: #fff; background: var(--brand-hover); box-shadow: 0 2px 8px rgba(var(--brand-rgb), 0.28);
}
.choice-row .choice-pills .form-check-input:checked + .form-check-label::before { background: #fff; }
.choice-row .choice-pills .form-check-input:focus-visible + .form-check-label { box-shadow: 0 0 0 0.2rem var(--bs-focus-ring-color); }
.choice-row .agreement-pills .form-check-label { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
/* urgency keeps each level's coloured dot, with a white ring when chosen */
.choice-row .urgency-pills .form-check-label::before { background: var(--pill); }
.choice-row .urgency-pills .form-check-input:checked + .form-check-label::before { background: var(--pill); box-shadow: 0 0 0 2px #fff; }
/* small divider title inside a section ("Customer") */
.lead-form .form-subhead {
  display: flex; align-items: center; gap: 0.45rem; margin: 0.25rem 0 0.9rem;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bs-secondary-color);
}
.lead-form .form-subhead::after { content: ""; flex: 1; height: 1px; background: var(--bs-border-color-translucent); }
.lead-form .form-subhead .bi { font-size: 0.9rem; color: var(--brand); }
/* customer name and contact number: two identical floating fields on one line */
.lead-form .customer-row > [class*="col-"] > .mb-3 { margin-bottom: 1rem; }
.lead-form .customer-row .form-floating > .form-control { min-height: 3.6rem; height: 3.6rem; }
/* floating labels: the label is the hint, so keep the placeholder hidden (our grey placeholder rule would show it) */
.lead-form .form-floating > .form-control::placeholder { color: transparent; }
.lead-form .customer-row .form-text { font-size: 0.78rem; margin-top: 0.35rem; }
@media (max-width: 575.98px) {
  .choice-row .urgency-pills .form-check-label { font-size: 0.8rem; padding-left: 0.25rem; padding-right: 0.25rem; gap: 0.25rem; }
  .choice-row .col-6 .form-check-label { font-size: 0.85rem; padding-left: 0.25rem; padding-right: 0.25rem; gap: 0.3rem; }
  .lead-form .choice-row .col-6 legend.form-label { font-size: 0.82rem !important; }
}

/* ---- Form checks (form-validation.js): mobile hint, per-field messages, Caps Lock ------- */
.mobile-hint { margin: 0.3rem 0 0; font-size: 0.78rem; color: var(--bs-secondary-color); font-variant-numeric: tabular-nums; min-height: 1.1em; }
.mobile-field .mobile-hint { margin-top: 0.3rem; }
.js-feedback { font-size: 0.82rem; font-weight: 500; margin-top: 0.3rem; }
.js-feedback:empty { display: none !important; }
.js-feedback::before { content: "\F33A"; font-family: "bootstrap-icons"; margin-right: 0.3rem; vertical-align: -0.1em; } /* bi-exclamation-circle */
.caps-warning {
  display: flex; align-items: center; gap: 0.4rem; margin: -0.35rem 0 0.75rem;
  font-size: 0.8rem; font-weight: 600; color: var(--bs-warning-text-emphasis);
}
.caps-warning[hidden] { display: none; }
.auth-form .alert-danger { display: flex; align-items: flex-start; gap: 0.25rem; border-radius: var(--bs-border-radius-lg); font-size: 0.92rem; }
.auth-form .alert-danger:focus { outline: 3px solid rgba(var(--bs-danger-rgb), 0.35); outline-offset: 2px; }
/* phones: 16px text so iOS does not zoom into the field; comfortable tap targets */
@media (max-width: 575.98px) {
  .auth-form .form-control, .auth-form .form-select { font-size: 16px; }
  .auth-form .btn-lg { min-height: 3.1rem; }
  .auth-form .form-check-label { padding-top: 0.1rem; }
}
.form-alert { display: flex; align-items: flex-start; gap: 0.55rem; border-radius: var(--bs-border-radius-lg); font-size: 0.92rem; font-weight: 500; }
.form-alert > .bi { font-size: 1.05rem; margin-top: 0.05rem; }
.form-alert:focus { outline: 3px solid rgba(var(--bs-danger-rgb), 0.35); outline-offset: 2px; }
/* Forms with live checks show problems only: no green ticks (a "valid" password says nothing on a
   login page, and the tick squeezed the country name). The country dropdown keeps its arrow. */
form[data-live-validation].was-validated .form-control:valid,
form[data-live-validation] .form-control.is-valid {
  border-color: var(--bs-border-color-translucent); padding-right: 0.75rem; background-image: none;
}
form[data-live-validation].was-validated .form-select:valid:not([multiple]):not([size]),
form[data-live-validation].was-validated .form-select:invalid:not([multiple]):not([size]) {
  --bs-form-select-bg-icon: none;
  border-color: var(--bs-border-color-translucent); padding-right: 2.25rem;
}
form[data-live-validation].was-validated .mobile-input .country-code .form-select:not([multiple]):not([size]) { padding-right: 1.75rem;
  --bs-form-select-bg-icon: none;  /* no tick on the code: it would hide "(+91)" */
}
form[data-live-validation].was-validated .form-control:valid:focus { box-shadow: var(--bs-focus-ring-x, 0) var(--bs-focus-ring-y, 0) 0 0.25rem var(--bs-focus-ring-color); }
form[data-live-validation].was-validated .form-check-input:valid { border-color: var(--bs-border-color); }
form[data-live-validation].was-validated .form-check-input:valid:checked { background-color: var(--brand-hover); border-color: var(--brand-hover); }
form[data-live-validation].was-validated .form-check-input:valid ~ .form-check-label { color: inherit; }

/* ---- Home: clickable numbers and their popups (partials/home_stat_modals.html) ------- */
button.trust-item {
  position: relative; width: 100%; display: block; cursor: pointer; color: inherit; font: inherit;
}
button.trust-item:hover { border-color: rgba(var(--brand-rgb), 0.45); }
button.trust-item:focus-visible { outline: 3px solid rgba(var(--brand-rgb), 0.45); outline-offset: 2px; }
.trust-more {
  position: absolute; top: 0.5rem; right: 0.55rem; font-size: 0.72rem; color: var(--bs-secondary-color);
  opacity: 0.55; transition: opacity 0.15s ease, color 0.15s ease;
}
button.trust-item:hover .trust-more, button.trust-item:focus-visible .trust-more { opacity: 1; color: var(--brand); }

.stat-modal .modal-content { border: 0; border-radius: var(--bs-border-radius-xl); box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25); }
.stat-modal .modal-header { align-items: flex-start; gap: 0.85rem; border-bottom: 1px solid var(--bs-border-color-translucent); padding: 1.1rem 1.25rem; }
.stat-modal .modal-header .btn-close { margin: 0 0 0 auto; }
.stat-modal-icon {
  flex: 0 0 2.75rem; width: 2.75rem; height: 2.75rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.85rem; font-size: 1.3rem; background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis);
}
.stat-modal-icon.is-star { background: rgba(var(--bs-warning-rgb), 0.18); color: var(--bs-warning-text-emphasis); }
.stat-modal .modal-title { font-weight: 700; margin-bottom: 0.1rem; }
.stat-modal-sub { font-size: 0.85rem; color: var(--bs-secondary-color); }
.stat-modal .modal-body { padding: 1.25rem; }
.stat-modal .modal-footer { border-top: 1px solid var(--bs-border-color-translucent); padding: 0.85rem 1.25rem; }
.stat-modal-heading {
  margin: 1.25rem 0 0.75rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--bs-secondary-color);
}
.stat-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.stat-tiles-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-tile {
  display: flex; flex-direction: column; align-items: center; padding: 0.8rem 0.5rem; border-radius: 0.85rem;
  background: var(--surface-muted); border: 1px solid var(--bs-border-color-translucent); text-align: center;
}
.stat-tile-value { font-size: 1.6rem; font-weight: 800; line-height: 1.1; color: var(--bs-link-color); font-variant-numeric: tabular-nums; }
.stat-tile-label { margin-top: 0.2rem; font-size: 0.75rem; font-weight: 600; color: var(--bs-secondary-color); }
.stat-bars li { display: grid; grid-template-columns: minmax(6.5rem, auto) 1fr 2.25rem; align-items: center; gap: 0.75rem; padding: 0.35rem 0; }
.stat-bar-label { font-size: 0.875rem; font-weight: 600; white-space: nowrap; }
.stat-bar-track { height: 0.6rem; border-radius: 999px; background: var(--bs-tertiary-bg); overflow: hidden; }
.stat-bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--brand-hover); min-width: 0.6rem; }
.stat-bar-fill.is-star { background: var(--bs-warning); }
.stat-bar-fill.status-open { background: var(--bs-success); }
.stat-bar-fill.status-assigned { background: var(--bs-info); }
.stat-bar-fill.status-work_submitted { background: var(--bs-warning); }
.stat-bar-fill.status-work_approved { background: var(--bs-primary); }
.stat-bar-fill.status-closed { background: var(--bs-secondary); }
.stat-bar-fill.status-cancelled { background: var(--bs-danger); }
.stat-bar-value { text-align: right; font-size: 0.875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-list li { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0; border-bottom: 1px solid var(--bs-border-color-translucent); }
.stat-list li:last-child { border-bottom: 0; }
.stat-list-main { flex: 1 1 auto; min-width: 0; font-size: 0.92rem; font-weight: 600; }
.stat-list-meta { flex: 0 0 auto; font-size: 0.8rem; color: var(--bs-secondary-color); white-space: nowrap; }
.stat-rank {
  flex: 0 0 1.6rem; width: 1.6rem; height: 1.6rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 0.75rem; font-weight: 700; background: var(--bs-tertiary-bg); color: var(--bs-secondary-color);
}
.stat-cities li:first-child .stat-rank { background: var(--brand-hover); color: #fff; }
.stat-rating-head { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 1rem; }
.stat-rating-value { font-size: 2.5rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) {
  .stat-tile-value { font-size: 1.35rem; }
  .stat-bars li { grid-template-columns: minmax(5.5rem, auto) 1fr 2rem; gap: 0.5rem; }
}
.stat-list .ref-chip { flex: 0 0 auto; white-space: nowrap; }
.stat-bar-fill.is-zero { min-width: 0; }
.stat-bars-rating li { grid-template-columns: 2.75rem 1fr 2.25rem; }
/* small divider title inside auth forms too (Register: "Security question") */
.auth-form .form-subhead {
  display: flex; align-items: center; gap: 0.45rem; margin: 0.5rem 0 0.85rem;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bs-secondary-color);
}
.auth-form .form-subhead::after { content: ""; flex: 1; height: 1px; background: var(--bs-border-color-translucent); }
.auth-form .form-subhead .bi { font-size: 0.9rem; color: var(--brand); }

/* My Leads, "All" tab: my part in each lead */
.role-badge {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25em 0.65em; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.role-badge.is-created { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); border-color: var(--bs-primary-border-subtle); }
.role-badge.is-requested { background: var(--bs-info-bg-subtle); color: var(--bs-info-text-emphasis); border-color: var(--bs-info-border-subtle); }
.role-badge.is-working { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); border-color: var(--bs-success-border-subtle); }

/* ---- "Install app" in the server-status bar, and its help popup ------------------------ */
.install-pill {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.75rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; color: #fff; background: var(--brand-hover);
  border: 1px solid var(--brand-hover); box-shadow: 0 2px 8px rgba(var(--brand-rgb), 0.25);
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.install-pill:hover { background: var(--brand-active, var(--brand)); transform: translateY(-1px); }
.install-pill:focus-visible { outline: 3px solid rgba(var(--brand-rgb), 0.4); outline-offset: 2px; }
.install-pill[hidden] { display: none; }
.install-modal .modal-content { border: 0; border-radius: var(--bs-border-radius-xl); }
.install-modal .modal-header { align-items: center; gap: 0.85rem; }
.install-modal .modal-header .btn-close { margin-left: auto; }
.install-modal-icon { border-radius: 0.8rem; box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15); }
.install-steps { padding: 0.85rem 1rem; border-radius: 0.9rem; border: 1px solid var(--bs-border-color-translucent); margin-bottom: 0.75rem; opacity: 0.75; }
.install-steps:last-child { margin-bottom: 0; }
.install-steps.is-current { opacity: 1; border-color: rgba(var(--brand-rgb), 0.45); background: rgba(var(--brand-rgb), 0.05); order: -1; }
.install-modal .modal-body { display: flex; flex-direction: column; }
.install-steps-title { display: flex; align-items: center; gap: 0.45rem; font-size: 0.95rem; font-weight: 700; margin-bottom: 0.5rem; }
.install-steps ol { margin: 0; padding-left: 1.2rem; font-size: 0.9rem; }
.install-steps li + li { margin-top: 0.25rem; }
@media (max-width: 575.98px) { .install-pill { padding: 0.2rem 0.6rem; } }
/* hidden install buttons stay hidden even with Bootstrap display classes (d-sm-inline-flex) */
[data-install-btn][hidden], [data-install-banner][hidden], [data-installed-note][hidden] { display: none !important; }

/* 2. footer "Get the app" (the whole box goes away inside the installed app) */
.footer-app {
  display: flex; align-items: center; gap: 0.75rem; margin-top: 1.1rem; padding: 0.75rem 0.85rem; max-width: 24rem;
  border-radius: 0.9rem; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12);
}
.footer-app:has([data-install-btn][hidden]) { display: none; }
.footer-app-icon { border-radius: 0.65rem; flex: 0 0 auto; }
.footer-app-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.footer-app-text strong { color: #fff; font-size: 0.9rem; }
.footer-app-text span { color: var(--footer-text); font-size: 0.78rem; }
.footer-app-btn { flex: 0 0 auto; font-weight: 700; color: #134e4a; border-radius: 999px; }

/* 3. dashboard banner */
.install-banner {
  display: flex; align-items: center; gap: 0.85rem; margin-bottom: 1rem; padding: 0.75rem 0.9rem;
  border-radius: var(--bs-border-radius-lg); background: var(--bs-body-bg);
  border: 1px solid rgba(var(--brand-rgb), 0.3); box-shadow: var(--bs-box-shadow-sm);
}
.install-banner-icon { border-radius: 0.65rem; flex: 0 0 auto; }
.install-banner-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.install-banner-text strong { font-size: 0.92rem; }
.install-banner-text span { font-size: 0.8rem; color: var(--bs-secondary-color); }
.install-banner .btn-primary { flex: 0 0 auto; border-radius: 999px; font-weight: 700; }
.install-banner .btn-close { flex: 0 0 auto; }
@media (max-width: 575.98px) {
  .install-banner { flex-wrap: wrap; }
  .install-banner-text { flex-basis: calc(100% - 6rem); }
  .install-banner .btn-primary { order: 3; width: 100%; }
}

.install-note { display: flex; gap: 0.45rem; margin-bottom: 0.85rem; font-size: 0.8rem; color: var(--bs-secondary-color); }
.install-note .bi { flex: 0 0 auto; margin-top: 0.1rem; }

/* ---- Installed app (html.is-app, set by theme.js) ---------------------------------------
   Only when the site runs from the home screen / its own window; the website is unchanged. */
.app-back, .app-title { display: none; }
html:not(.is-app) .bottom-nav-guest { display: none !important; }
html:not(.is-app) .bottom-nav .app-tab, .is-app .bottom-nav .web-tab { display: none; }

/* Native feel: no tap flash, no rubber-band bounce, no accidental text selection on controls */
.is-app body { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
.is-app .site-navbar, .is-app .bottom-nav, .is-app .btn, .is-app .nav-link, .is-app .server-status-bar {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
/* Pages fade in instead of flashing like a website reload */
.is-app main { animation: app-page-in 0.18s ease-out; }
@keyframes app-page-in { from { opacity: 0; } }
@media (display-mode: standalone) { @view-transition { navigation: auto; } }
@media (prefers-reduced-motion: reduce) { .is-app main { animation: none; } }

/* Header: back arrow on inner pages; on phones the page name replaces the brand, and
   language + dark mode move into the ☰ menu */
.is-app .site-navbar.is-inner .app-back { display: inline-flex; margin-left: -0.6rem; font-size: 1.35rem; }
@media (max-width: 991.98px) {
  .is-app .site-navbar .navbar-brand { font-size: 1.05rem; padding-top: 0; padding-bottom: 0; }
  .is-app .site-navbar .brand-tile { width: 2rem; height: 2rem; font-size: 1.1rem; border-radius: 0.6rem; box-shadow: none; }
  .is-app .site-navbar .navbar-toggler { padding: 0.25rem 0.4rem; }
  .is-app .site-navbar .navbar-toggler-icon { width: 1.3em; height: 1.3em; }
  .is-app .site-navbar.is-inner .navbar-brand { display: none !important; }
  .is-app .site-navbar.is-inner .app-title {
    display: block; flex: 1 1 0; min-width: 0; margin: 0 0.25rem;
    font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .app-menu-prefs .lang-switch { flex: 1 1 0; }
  .app-menu-prefs .lang-btn {
    width: 100%; justify-content: center; gap: 0.4rem;
    border: 1px solid rgba(var(--bs-body-color-rgb), 0.3); border-radius: var(--bs-border-radius); text-decoration: none;
  }
  .app-theme-btn { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; }
}

/* Server status: the bar under the header becomes a chip in the header; tap for details */
.app-status { display: none; }
.is-app .app-status { display: block; }
.is-app .server-status-bar { display: none; }
.app-status-btn {
  display: inline-flex; align-items: center; gap: 0.55rem; min-height: 2.25rem; padding: 0 0.7rem;
  border: 1px solid var(--bs-border-color-translucent); border-radius: 999px;
  background: var(--bs-tertiary-bg); color: var(--bs-body-color); font-size: 0.78rem; font-weight: 700;
}
.app-status-item, .app-status-row { --state: var(--bs-success); display: inline-flex; align-items: center; gap: 0.3rem; }
.app-status-item.is-down, .app-status-row.is-down { --state: var(--bs-danger); }
.app-status-menu { min-width: 15rem; padding: 0.5rem; border-radius: var(--bs-border-radius-lg); box-shadow: var(--bs-box-shadow); }
.app-status-head {
  margin: 0.15rem 0.5rem 0.4rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--bs-secondary-color);
}
.app-status-row { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.45rem 0.5rem; font-size: 0.88rem; }
.app-status-row .server-dot { margin-top: 0.4rem; flex: 0 0 auto; }

/* App bar on phones: brand colour, white text, the main pages as tabs underneath */
[data-bs-theme="light"] { --app-bar-bg: #0f766e; --app-bar-bg-2: #0f8f83; }
[data-bs-theme="dark"] { --app-bar-bg: #0c3532; --app-bar-bg-2: #10504a; }
.app-tabs { display: none; }
@media (max-width: 991.98px) {
  .is-app .site-navbar { border-bottom-color: transparent !important; }
  .is-app .site-navbar > .container { flex-wrap: wrap; }
  /* top edge stays --app-bar-bg, the phone's status bar colour (theme.js) */
  .is-app .site-navbar::before { background: linear-gradient(165deg, var(--app-bar-bg) 45%, var(--app-bar-bg-2)); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .is-app .site-navbar .navbar-brand, .is-app .site-navbar .app-title, .is-app .site-navbar .app-back { color: #fff; }
  .is-app .site-navbar .navbar-toggler-icon { filter: brightness(0) invert(1); }
  .is-app .site-navbar .brand-tile { background: rgba(255, 255, 255, 0.16); }
  .is-app .app-status-btn { min-height: 2rem; padding: 0 0.6rem; gap: 0.45rem; font-size: 0.74rem; background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.28); color: #fff; }
  .is-app .app-status-btn .server-dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9); }
  .is-app .app-status-btn .server-dot::after { display: none; }

  .is-app .app-tabs {
    order: 10; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 0.2rem; margin-top: 0.35rem; padding-bottom: 0.1rem;
    overflow-x: auto; scrollbar-width: none;
  }
  .is-app .app-tabs::-webkit-scrollbar { display: none; }
  .app-tab-link {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem;
    padding: 0.38rem 0.75rem; border-radius: 999px;
    color: rgba(255, 255, 255, 0.8); font-size: 0.84rem; font-weight: 600; white-space: nowrap; text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
  }
  .app-tab-link:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
  @media (max-width: 479.98px) { .app-tab-link .bi { display: none; } .app-tab-link { padding-left: 0.6rem; padding-right: 0.6rem; } }
  /* very narrow phones (320–379px): the name shortens with "…" rather than the top row wrapping */
  .is-app .site-navbar .navbar-brand { flex: 1 1 0; min-width: 0; }
  @media (max-width: 379.98px) {
    .is-app .app-tab-link { padding-left: 0.4rem; padding-right: 0.4rem; font-size: 0.76rem; }
    .is-app .app-tab-create { padding-left: 0.6rem; padding-right: 0.6rem; font-size: 0.76rem; }
    .is-app .app-tab-create .bi { display: none; }
    .is-app .app-status-btn { padding: 0 0.45rem; gap: 0.3rem; }
  }
  .app-tab-link.active { color: #fff; background: rgba(255, 255, 255, 0.2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
  .app-tab-create {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.25rem; margin-left: 0.15rem;
    padding: 0.38rem 0.75rem; border-radius: 999px; background: #fff; color: var(--brand-hover);
    font-size: 0.82rem; font-weight: 700; white-space: nowrap; text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  }
  .app-tab-create:hover, .app-tab-create.active { color: var(--brand-active); background: #e6fffa; }
}

/* Header bar: app-bar height, soft shadow once scrolled, slides away while scrolling down */
.is-app .site-navbar { padding-top: max(0.35rem, env(safe-area-inset-top)); padding-bottom: 0.35rem; transition: top 0.22s ease, box-shadow 0.2s ease; }
.is-app .site-navbar.is-scrolled { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12); }
/* Tucked = the sticky header sits partly above the screen. Moved with `top`, not transform: a
   transform would make the header the containing block of the fixed ☰ panel, which then sticks
   out to the right and makes phones zoom the page out. --tuck (main.js): the top row's height
   when the tabs show (they stay), else the whole header. */
.is-app .site-navbar.is-tucked { top: calc(-1 * var(--tuck, 0px)); }
.is-app .site-navbar .nav-tools { gap: 0.15rem !important; }
@media (prefers-reduced-motion: reduce) { .is-app .site-navbar { transition: none; } }

/* Footer: a light, compact app footer replaces the website's dark columns */
.app-footer, .app-top-btn, .app-ptr { display: none; }
.is-app .site-footer-main, .is-app .site-footer-bottom { display: none; }
.is-app .site-footer { background: none; border-top: 0; color: var(--bs-secondary-color); padding-top: 0.5rem; }
.is-app .site-footer::before, .is-app .site-footer::after { display: none; }
.is-app .app-footer {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem; text-align: center;
  margin-top: 1rem; padding: 1.25rem 0 0.5rem; border-top: 1px solid var(--bs-border-color-translucent);
  font-size: 0.78rem; color: var(--bs-secondary-color);
}
.app-footer-brand { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 700; font-size: 0.9rem; color: var(--bs-body-color); }
.app-footer-brand img { border-radius: 0.4rem; }
.app-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 0.9rem; margin: 0; }
.is-app .site-footer .app-footer-links a { color: var(--bs-link-color); font-weight: 600; }
.is-app .site-footer .app-footer-links a:focus-visible { outline-color: var(--bs-link-color); }
@media (pointer: coarse) {
  /* Touch: taller links, the rows stay as close as before */
  .app-footer-links { row-gap: 0; }
  .app-footer-links a { display: inline-block; padding: 0.3rem 0; }
}
.app-footer .bi-heart-fill { color: #ef4444; font-size: 0.7rem; }

/* Scrolling: section links land below the header and glide there */
html.is-app { scroll-padding-top: 4.5rem; }
@media (max-width: 991.98px) { html.is-app { scroll-padding-top: 7rem; } }
@media (prefers-reduced-motion: no-preference) { html.is-app { scroll-behavior: smooth; } }

/* Back-to-top button, above the bottom tab bar */
.is-app .app-top-btn {
  position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: calc(1.25rem + env(safe-area-inset-bottom)); z-index: 1025;
  width: 2.75rem; height: 2.75rem; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: var(--bs-body-bg); color: var(--bs-link-color); font-size: 1.2rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); transition: opacity 0.2s ease, transform 0.2s ease;
}
.is-app .app-top-btn[hidden] { display: inline-flex; opacity: 0; transform: scale(0.6); pointer-events: none; }
@media (max-width: 767.98px) { .is-app .app-top-btn { bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 0.9rem); } }

/* Pull to refresh: a round arrow follows the finger down from under the header */
.is-app .app-ptr {
  position: fixed; left: 50%; top: var(--ptr-top, 6rem); z-index: 1029;
  width: 2.5rem; height: 2.5rem; margin-left: -1.25rem; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--bs-body-bg); color: var(--bs-link-color); font-size: 1.25rem;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2); opacity: 0; pointer-events: none;
  transform: translateY(calc(var(--pull, 0) * 4.5rem - 3rem)) rotate(calc(var(--pull, 0) * 300deg));
}
.is-app .app-ptr.is-pulling { opacity: calc(0.35 + var(--pull, 0)); }
.is-app .app-ptr.is-ready { background: var(--brand-hover); color: #fff; }
.is-app .app-ptr.is-back { transition: transform 0.2s ease, opacity 0.2s ease; }
.is-app .app-ptr.is-refreshing { opacity: 1; background: var(--brand-hover); color: #fff; animation: app-ptr-spin 0.8s linear infinite; }
@keyframes app-ptr-spin { from { transform: translateY(1.5rem) rotate(0); } to { transform: translateY(1.5rem) rotate(360deg); } }

/* Visitors get the bottom tab bar in the app too */
@media (max-width: 767.98px) {
  .is-app body.has-guest-nav { padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); }
  /* room for the raised Create button of the tab bar */
  .is-app .app-footer { padding-bottom: 1.75rem; }
}

/* ---- Contact page ----------------------------------------------------------------- */
.contact-heading {
  margin-bottom: 0.75rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--bs-secondary-color);
}
.contact-quick { display: grid; gap: 0.75rem; }
.contact-tile {
  --tile: var(--brand-hover);
  display: flex; align-items: center; gap: 0.9rem; padding: 0.95rem 1.1rem;
  border: 1px solid var(--bs-border-color-translucent); border-radius: var(--bs-border-radius-xl);
  background: var(--bs-body-bg); box-shadow: var(--bs-box-shadow-sm);
  color: var(--bs-body-color); text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.contact-tile:hover, .contact-tile:focus-visible {
  color: var(--bs-body-color); transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--tile) 45%, transparent); box-shadow: var(--bs-box-shadow);
}
.contact-tile.is-whatsapp { --tile: #25d366; }
.contact-tile.is-email { --tile: #0284c7; }
.contact-tile.is-address { --tile: var(--brand); }
.contact-tile-icon {
  flex: 0 0 3rem; width: 3rem; height: 3rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.9rem; background: var(--tile); color: #fff; font-size: 1.35rem;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--tile) 35%, transparent);
}
.contact-tile-text { min-width: 0; flex: 1 1 auto; }
.contact-tile-title { display: block; font-weight: 700; font-size: 1rem; line-height: 1.3; }
.contact-tile-sub { display: block; font-size: 0.85rem; color: var(--bs-secondary-color); }
.contact-tile-go { color: var(--bs-secondary-color); transition: transform 0.15s ease; }
.contact-tile:hover .contact-tile-go { transform: translateX(3px); color: var(--tile); }

.contact-info {
  margin-top: 1rem; padding: 1.1rem; border-radius: var(--bs-border-radius-xl);
  background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); box-shadow: var(--bs-box-shadow-sm);
}
.contact-info-row { display: flex; align-items: center; gap: 0.8rem; }
.contact-info-icon {
  flex: 0 0 2.5rem; width: 2.5rem; height: 2.5rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.75rem; background: var(--bs-primary-bg-subtle); color: var(--bs-link-color); font-size: 1.15rem;
}
.contact-safety {
  display: flex; gap: 0.6rem; margin-top: 1rem; padding: 0.75rem 0.85rem; border-radius: var(--bs-border-radius-lg);
  background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); font-size: 0.85rem; line-height: 1.45;
}
.contact-safety .bi { flex: 0 0 auto; font-size: 1.05rem; margin-top: 0.05rem; }

.contact-form-card { border-radius: var(--bs-border-radius-xl); }
.contact-form-card .card-body { padding: 1.25rem; }
@media (min-width: 768px) { .contact-form-card .card-body { padding: 2rem; } }
.contact-form-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.contact-form .form-label { font-weight: 600; font-size: 0.92rem; }
.contact-form .form-control:not(textarea) { min-height: 3rem; }
.contact-form textarea.form-control { min-height: 8rem; }
.contact-submit { width: 100%; }
@media (min-width: 576px) { .contact-submit { width: auto; min-width: 14rem; } }

/* Tablets: the three tiles side by side */
@media (min-width: 576px) and (max-width: 991.98px) {
  .contact-quick { grid-template-columns: repeat(3, 1fr); }
  .contact-tile { flex-direction: column; text-align: center; gap: 0.6rem; }
  .contact-tile-go { display: none; }
}
@media (prefers-reduced-motion: reduce) { .contact-tile, .contact-tile-go { transition: none; } }


/* ==== Installed app: native feel ==========================================================
   Everything here is scoped to html.is-app, so the website is unchanged. */

@media (max-width: 767.98px) {
  /* Compact app typography and spacing */
  .is-app main.py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
  /* (the home headline keeps the website's size: the app home is the website's) */
  .is-app h1:not(.hero-title), .is-app .h1:not(.hero-title) { font-size: 1.55rem; }
  .is-app h2:not(.hero-title), .is-app .h2:not(.hero-title) { font-size: 1.3rem; }
  .is-app h3, .is-app .h3 { font-size: 1.15rem; }
  .is-app h4, .is-app .h4 { font-size: 1.05rem; }
  .is-app .card { border-radius: 1rem; }
  .is-app .page-hero { padding: 1rem 1.1rem; border-radius: 1.1rem; gap: 0.75rem !important; margin-bottom: 1rem !important; }
  .is-app .page-hero-icon { width: 2.5rem; height: 2.5rem; font-size: 1.2rem; border-radius: 0.75rem; }
  .is-app .page-hero h1 { font-size: 1.3rem; }
  .is-app .page-hero p { font-size: 0.88rem; }
  .is-app .page-hero-btn { display: none; }  /* Create Lead is in the tabs */

  /* Lead cards become compact list rows: price first, then place · age, then the actions */
  .is-app .lead-card .card-body { padding: 0.85rem 1rem; }
  .is-app .lead-card h3 { font-size: 1rem; margin-bottom: 0.1rem !important; }
  .is-app .lead-card dl { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.5rem; margin: 0.35rem 0 0.65rem !important; }
  .is-app .lead-card dl dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .is-app .lead-card dl dd { flex: 0 0 auto; width: auto; max-width: none; padding: 0; margin: 0 !important; color: var(--bs-secondary-color); }
  .is-app .lead-card dl dd:first-of-type { order: -1; width: 100%; font-size: 1.05rem; font-weight: 700; color: var(--bs-link-color); }
  .is-app .lead-card dl dd:nth-of-type(3)::before { content: "·"; margin-right: 0.5rem; }
  .is-app .lead-card-actions .btn { flex: 1 1 0; padding-top: 0.45rem; padding-bottom: 0.45rem; }
}

/* Bottom sheets: popups and the filters slide up from the bottom on phones */
@media (max-width: 575.98px) {
  .is-app .modal:not(.lightbox-modal) .modal-dialog {
    position: fixed; left: 0; right: 0; bottom: 0; margin: 0; width: 100%; max-width: none;
    height: auto; min-height: 0; max-height: 92dvh; display: flex; align-items: flex-end;
  }
  .is-app .modal:not(.lightbox-modal) .modal-content {
    width: 100%; max-height: 92dvh; border: 0; border-radius: 1.25rem 1.25rem 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .is-app .modal.fade:not(.lightbox-modal) .modal-dialog { transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .is-app .modal.show:not(.lightbox-modal) .modal-dialog { transform: none; }
  .is-app .modal:not(.lightbox-modal) .modal-header { position: relative; padding-top: 1.35rem; touch-action: none; }
  .is-app .modal:not(.lightbox-modal) .modal-header::before,
  .is-app .filters-panel .offcanvas-header::before {  /* the grab handle */
    content: ""; position: absolute; top: 0.5rem; left: 50%; width: 2.5rem; height: 4px; margin-left: -1.25rem;
    border-radius: 2px; background: var(--bs-border-color);
  }
}
@media (max-width: 991.98px) {
  .is-app .filters-panel.offcanvas-lg {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: auto; max-height: 85dvh;
    border: 0; border-radius: 1.25rem 1.25rem 0 0; transform: translateY(100%);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .is-app .filters-panel.offcanvas-lg.showing, .is-app .filters-panel.offcanvas-lg.show:not(.hiding) { transform: none; }
  .is-app .filters-panel .offcanvas-header { position: relative; padding-top: 1.35rem; touch-action: none; }
}

/* Loading: a thin bar at the very top, then grey placeholders if the page takes a moment */
.app-loading { display: none; }
.is-app .app-loading.is-on { display: block; }
.app-progress {
  position: fixed; top: 0; left: 0; z-index: 1100; height: 3px; width: 0;
  background: linear-gradient(90deg, #5eead4, #ffffff); box-shadow: 0 0 8px rgba(94, 234, 212, 0.8);
  animation: app-progress 8s cubic-bezier(0.1, 0.7, 0.2, 1) forwards;
}
@keyframes app-progress { 0% { width: 0; } 8% { width: 40%; } 100% { width: 92%; } }
.app-skeleton {
  position: fixed; left: 0; right: 0; top: var(--sk-top, 6rem); bottom: 0; z-index: 1020;
  padding: 1rem; background: var(--surface-muted); opacity: 0; animation: app-sk-in 0.15s ease 0.25s forwards;
}
@keyframes app-sk-in { to { opacity: 1; } }
.sk {
  margin-bottom: 0.85rem; border-radius: 1rem;
  background: linear-gradient(90deg, var(--bs-secondary-bg) 25%, var(--bs-tertiary-bg) 50%, var(--bs-secondary-bg) 75%);
  background-size: 200% 100%; animation: sk-shimmer 1.2s linear infinite;
}
.sk-title { height: 1.5rem; width: 55%; }
.sk-line { height: 0.9rem; width: 80%; }
.sk-card { height: 7.5rem; }
@keyframes sk-shimmer { to { background-position: -200% 0; } }

/* Page changes: the new page slides in (Back slides the other way); header and tab bar stay put */
@media (display-mode: standalone) and (prefers-reduced-motion: no-preference) {
  .site-navbar { view-transition-name: app-bar; }
  .bottom-nav { view-transition-name: app-tabbar; }
  main { view-transition-name: app-main; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  ::view-transition-old(app-main) { animation: vt-out 0.22s ease both; }
  ::view-transition-new(app-main) { animation: vt-in 0.26s ease both; }
  html:active-view-transition-type(back)::view-transition-old(app-main) { animation-name: vt-out-back; }
  html:active-view-transition-type(back)::view-transition-new(app-main) { animation-name: vt-in-back; }
}
@keyframes vt-out { to { opacity: 0; transform: translateX(-8%); } }
@keyframes vt-in { from { opacity: 0; transform: translateX(10%); } }
@keyframes vt-out-back { to { opacity: 0; transform: translateX(8%); } }
@keyframes vt-in-back { from { opacity: 0; transform: translateX(-10%); } }
@media (prefers-reduced-motion: reduce) {
  .app-progress, .sk, .app-skeleton { animation: none; }
  .app-skeleton { opacity: 1; }
  .is-app .modal.fade .modal-dialog { transition: none; }
}


/* ---- Phone notifications prompt (partials/push_prompt.html) --------------------------- */
.push-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 0.9rem; margin-bottom: 1rem; padding: 0.9rem 1rem;
  border: 1px solid var(--bs-border-color-translucent); border-radius: var(--bs-border-radius-xl);
  background: var(--bs-body-bg); box-shadow: var(--bs-box-shadow-sm);
}
.push-card[hidden] { display: none; }
.push-card-icon {
  flex: 0 0 2.5rem; width: 2.5rem; height: 2.5rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.75rem; background: var(--bs-primary-bg-subtle); color: var(--bs-link-color); font-size: 1.15rem;
}
.push-card-text { flex: 1 1 14rem; min-width: 0; font-size: 0.88rem; color: var(--bs-secondary-color); }
.push-card-text strong { display: block; font-size: 0.98rem; color: var(--bs-body-color); }
.push-card[data-push-state="on"] .push-card-icon { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.push-card[data-push-state="blocked"] .push-card-icon, .push-card[data-push-state="failed"] .push-card-icon { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
.push-card.is-row { margin: 0; padding: 0; border: 0; box-shadow: none; background: none; gap: 0.5rem 0.75rem; }


/* ---- Lead form: "Customer is: Both" -> Owner and Tenant boxes ---------------------------- */
.person-head {
  display: flex; align-items: center; gap: 0.4rem; margin: 0.25rem 0 0.6rem;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--bs-secondary-color);
}
.person-head .bi { color: var(--bs-link-color); font-size: 0.95rem; }
.person-head[hidden], .tenant-fields[hidden] { display: none; }
.tenant-fields { margin-top: 0.25rem; padding-top: 0.75rem; border-top: 1px dashed var(--bs-border-color-translucent); }


/* ---- Lead form: compact "Customer available time" ---------------------------------------- */
.form-section-compact .avail-row > div > .mb-3 { margin-bottom: 0.75rem !important; }
.form-section-compact .form-label { margin-bottom: 0.3rem; font-size: 0.85rem; }
.form-section-compact .avail-row .form-control,
.form-section-compact .avail-row .form-select { padding-left: 0.65rem; padding-right: 0.65rem; min-width: 0; }
.form-section-compact .avail-row .form-select { padding-right: 2rem; }

/* "More details": a slimmer photo drop area */
.lead-form .form-section-compact.form-section-upload input[type="file"] { min-height: 0; padding: 0.5rem 0.6rem; font-size: 0.88rem; }
.lead-form .form-section-compact.form-section-upload input[type="file"]::file-selector-button { padding: 0.3rem 0.85rem; margin-right: 0.5rem; }
.form-section-compact textarea.form-control { min-height: 3.75rem; }
.lead-form #id_address { min-height: 3.75rem; }  /* two lines are enough for an address */


/* ---- Searchable pick lists (combobox.js): Country and State on the lead form ------------- */
.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 1060; left: 0; right: 0; top: calc(100% + 0.25rem);
  max-height: 15rem; overflow-y: auto; margin: 0; padding: 0.3rem; list-style: none;
  background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent);
  border-radius: var(--bs-border-radius-lg); box-shadow: var(--bs-box-shadow);
}
.combo-list[hidden] { display: none; }
.combo-option { padding: 0.5rem 0.65rem; border-radius: 0.5rem; cursor: pointer; font-size: 0.92rem; line-height: 1.3; }
.combo-option strong { color: var(--bs-link-color); }
.combo-option:hover, .combo-option.is-active { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }
[data-country-other][hidden] { display: none !important; }

/* The section being filled in sits above the sections after it, so an open pick list (combobox.js)
   is not hidden under the next card */
.lead-form .form-section:focus-within { z-index: 5; }
.combo-up .combo-list { top: auto; bottom: calc(100% + 0.25rem); }  /* opened upward (combobox.js) */
@media (max-width: 991.98px) {  /* while a pick list is open on a phone, the sticky buttons step aside */
  .lead-form:has(.combo-list:not([hidden])) .lead-form-actions { visibility: hidden; }
}
/* forms with the sticky Cancel / Create bar: no back-to-top button over it */
.is-app body:has(.lead-form-actions) .app-top-btn { display: none !important; }



/* ---- Messages after an action (partials/toasts.html, BL.toast) ---------------------------- */
.site-toasts .flash-toast {
  --flash: var(--bs-info);
  width: 100%; max-width: none; margin-bottom: 0.6rem; overflow: hidden;
  border: 1px solid var(--bs-border-color-translucent); border-radius: var(--bs-border-radius-xl);
  background: var(--bs-body-bg); box-shadow: 0 10px 30px rgba(16, 24, 40, 0.16);
}
.flash-toast.flash-success { --flash: var(--bs-success); }
.flash-toast.flash-warning { --flash: #d97706; }
.flash-toast.flash-danger { --flash: var(--bs-danger); }
.flash-toast-body { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.85rem 0.85rem 0.8rem 0.9rem; }
.flash-toast-icon {
  flex: 0 0 2.1rem; width: 2.1rem; height: 2.1rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: color-mix(in srgb, var(--flash) 14%, transparent); color: var(--flash); font-size: 1.1rem;
}
.flash-toast-text { flex: 1 1 auto; min-width: 0; padding-top: 0.3rem; font-size: 0.92rem; font-weight: 500; line-height: 1.4; color: var(--bs-body-color); }
.flash-toast .btn-close { flex: 0 0 auto; margin-top: 0.35rem; font-size: 0.7rem; }
.flash-toast-timer { height: 3px; background: color-mix(in srgb, var(--flash) 12%, transparent); }
.flash-toast-timer span { display: block; height: 100%; width: 100%; background: var(--flash); transform-origin: left;
  animation: flash-timer 5s linear forwards; }
@keyframes flash-timer { to { transform: scaleX(0); } }
.flash-toast.showing, .flash-toast.show { animation: flash-in 0.25s ease-out; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } }
/* in the app the header is taller (tabs underneath) */
@media (max-width: 991.98px) { .is-app body .site-toasts { padding-top: calc(6.75rem + env(safe-area-inset-top)); } }
@media (prefers-reduced-motion: reduce) { .flash-toast-timer span, .flash-toast.show { animation: none; } }


/* ---- Direct assign: person picker (leads/_person_picker.html, assign.js) ------------------ */
[data-assign-direct][hidden], .person-picker [hidden] { display: none !important; }
.assign-direct { margin-top: 0.75rem; }
.person-picker-search { position: relative; }
.person-picker-search .bi { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--bs-secondary-color); pointer-events: none; }
.person-picker-search .form-control { padding-left: 2.5rem; }
.person-picker-list {
  margin: 0.4rem 0 0; padding: 0.3rem; max-height: 17rem; overflow-y: auto;
  border: 1px solid var(--bs-border-color-translucent); border-radius: var(--bs-border-radius-lg); background: var(--bs-body-bg);
  box-shadow: var(--bs-box-shadow-sm);
}
.person-list-head { padding: 0.35rem 0.6rem 0.2rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--bs-secondary-color); }
.person-empty { padding: 0.6rem; font-size: 0.88rem; color: var(--bs-secondary-color); }
.person-option {
  display: flex; align-items: center; gap: 0.7rem; width: 100%; padding: 0.5rem 0.6rem;
  border: 0; border-radius: 0.6rem; background: none; color: var(--bs-body-color); text-align: left;
}
.person-option:hover, .person-option:focus-visible { background: var(--bs-primary-bg-subtle); outline: none; }
.person-avatar {
  flex: 0 0 2.4rem; width: 2.4rem; height: 2.4rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: linear-gradient(135deg, #0d9488, #10b981); color: #fff; font-size: 0.82rem; font-weight: 800;
}
.person-text { min-width: 0; }
.person-name { display: block; font-weight: 700; line-height: 1.25; }
.person-meta { display: block; font-size: 0.8rem; color: var(--bs-secondary-color); }
.person-picker-chosen {
  display: flex; align-items: center; gap: 0.7rem; margin-top: 0.4rem; padding: 0.6rem 0.75rem;
  border: 1px solid rgba(var(--brand-rgb), 0.4); border-radius: var(--bs-border-radius-lg); background: var(--bs-primary-bg-subtle);
}
.person-change { margin-left: auto; flex: 0 0 auto; }
.person-invite { margin-top: 0.5rem; }
.private-note { color: var(--bs-secondary-color); }


/* ---- Contact the other side: WhatsApp / SMS / call (leads/_contact_box.html) ----------------- */
.contact-box { margin-top: 1rem; padding: 0.85rem; border-radius: var(--bs-border-radius-lg); background: var(--surface-muted);
  border: 1px solid var(--bs-border-color-translucent); }
.contact-box-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 0.75rem; margin-bottom: 0.6rem; }
.contact-box-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--bs-secondary-color); }
.contact-box-number { font-weight: 700; text-decoration: none; }
.contact-box-actions { display: flex; gap: 0.4rem; }
.contact-box-actions > * { flex: 1 1 0; }
.contact-btn { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; font-weight: 600;
  border-radius: 999px; color: #fff; border: 0; padding: 0.45rem 0.5rem; }
.contact-btn.is-whatsapp { background: #15803d; } /* WhatsApp green, darker: white text 5.1:1 */
.contact-btn.is-sms { background: #0369a1; } /* 5.9:1 */
.contact-btn.is-call { background: var(--brand-hover); }
.contact-btn:hover, .contact-btn:focus-visible, .contact-btn.show { color: #fff; filter: brightness(0.95); }
.contact-btn.dropdown-toggle::after { margin-left: 0.15rem; }
.contact-menu { min-width: 12rem; border-radius: var(--bs-border-radius-lg); box-shadow: var(--bs-box-shadow); }
.contact-box-note { margin: 0.55rem 0 0; font-size: 0.75rem; color: var(--bs-secondary-color); }


/* ---- Owner / tenant: call, WhatsApp, SMS (leads/_customer_contact.html) ------------------ */
.customer-contact { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.25rem; }
.customer-contact-btn { width: 2.1rem; display: inline-flex; align-items: center; justify-content: center; color: #fff; border: 0; border-radius: 999px; }
.customer-contact-btn.is-whatsapp { background: #15803d; }
.customer-contact-btn.is-sms { background: #0369a1; }
.customer-contact-btn:hover, .customer-contact-btn:focus-visible { color: #fff; filter: brightness(0.95); }

/* ==== Fit every screen ======================================================================
   Small phones (or phones set to a large "Display size" / "Font size") get a slightly smaller
   root size, so text, buttons and spacing (all in rem) shrink together and nothing sticks out.
   Inputs stay at 16px+ (rule near the top), so iPhones do not zoom in while typing. */
@media (max-width: 389.98px) {
  html { font-size: clamp(13px, 4.1vw, 16px); }
}
/* nothing may be wider than the screen */
img, video, canvas, svg, iframe { max-width: 100%; }
.chart-box { overflow: hidden; }
.chart-box canvas { width: 100% !important; }
main .card, main dd, main p, main li, .flash-toast-text { overflow-wrap: anywhere; }
/* the contact box buttons wrap on narrow phones */
.contact-box-actions { flex-wrap: wrap; }
.contact-box-actions > * { min-width: 0; flex: 1 1 5.5rem; }
.contact-btn { white-space: nowrap; }
/* very narrow screens: the app tab labels and bottom bar labels get a touch smaller */
@media (max-width: 339.98px) {
  .bottom-nav-link, .bottom-nav-create { font-size: 0.64rem; padding-left: 0.15rem; padding-right: 0.15rem; }
  .bottom-nav-link .bi { font-size: 1.15rem; }
  .bottom-nav-create-btn { width: 2.9rem; height: 2.9rem; font-size: 1.4rem; }
}
/* landscape phones in the app: keep the header compact so content has room */
@media (max-height: 500px) and (orientation: landscape) {
  .is-app .site-navbar .app-tabs { margin-top: 0.15rem; }
  .is-app .app-tab-link, .is-app .app-tab-create { padding-top: 0.25rem; padding-bottom: 0.25rem; }
}
/* landscape phones and small tablets held sideways: the tabs share the logo's row, so the header
   stays one short row (about 56px) instead of taking ~40% of the screen height */
@media (max-height: 500px) and (orientation: landscape) and (min-width: 600px) and (max-width: 991.98px) {
  /* one row needs the whole width (the 720px container left ~200px empty and cut "Create Lead") */
  .is-app .site-navbar > .container { flex-wrap: nowrap; max-width: none; }
  /* logo (or back + page name), then the tabs, then the status chip and menu */
  .is-app .site-navbar .app-tabs { order: 2; width: auto; flex: 1 1 0; min-width: 0; justify-content: center; margin: 0 0.4rem; padding-bottom: 0; }
  .is-app .site-navbar .nav-tools { order: 3; }
  .is-app .site-navbar .navbar-brand, .is-app .site-navbar .app-back { flex: 0 0 auto; }
  .is-app .site-navbar.is-inner .app-title { flex: 0 1 9rem; }
  .is-app .app-tab-link .bi, .is-app .app-tab-create .bi { display: none; }
  .is-app .app-tab-link, .is-app .app-tab-create { padding-left: 0.55rem; padding-right: 0.55rem; font-size: 0.82rem; }
  .is-app .site-navbar.is-tucked { top: 0; }  /* one row: nothing to tuck away */
}
/* landscape phones (narrower than 768px): the bottom tab bar already has these pages, so the
   header drops its tab row and stays one short row */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 767.98px) {
  .is-app .site-navbar .app-tabs { display: none; }
}
/* very short screens held sideways (folded phones, small phones in landscape): a compact
   bottom bar, icons only (the labels stay for screen readers) */
@media (max-height: 360px) and (orientation: landscape) {
  :root { --bottom-nav-height: 44px; }
  .bottom-nav-link, .bottom-nav-create { min-height: 40px; padding-top: 0.15rem; padding-bottom: 0.15rem; }
  .bottom-nav-link > span:not(.badge), .bottom-nav-create > span:not(.bottom-nav-create-btn) {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
  }
  .bottom-nav-create-btn { width: 2.3rem; height: 2.3rem; margin-top: 0; font-size: 1.15rem; box-shadow: 0 0.2rem 0.5rem rgba(var(--brand-rgb), 0.35); }
  .bottom-nav-badge { top: 0; }
}


/* ---- Phone menu: language as a row of buttons (partials/language_pills.html) ----------------- */
.app-menu-prefs { flex-wrap: wrap; }
.lang-pills {
  flex: 1 1 11rem; display: flex; align-items: center; gap: 0.25rem; padding: 0.25rem;
  border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); background: var(--surface-muted);
}
.lang-pills-icon { padding: 0 0.35rem; color: var(--bs-secondary-color); }
.lang-pill {
  flex: 1 1 0; min-height: 2.4rem; border: 0; border-radius: calc(var(--bs-border-radius) - 0.15rem);
  background: transparent; color: var(--bs-body-color); font-weight: 700; font-size: 0.9rem;
}
.lang-pill:hover { background: var(--bs-body-bg); }
.lang-pill.active { background: var(--brand-hover); color: #fff; box-shadow: 0 2px 6px rgba(var(--brand-rgb), 0.3); }
.app-menu-prefs .app-theme-btn { flex: 1 1 8rem; min-height: 2.9rem; }

/* while the ☰ menu (or the filters panel) is open, the bottom tab bar steps aside so it never
   covers the menu's lower part (the menu sits inside the header, below the bar's layer) */
body:has(#mainMenu.show, #mainMenu.showing, #filtersPanel.show, #filtersPanel.showing) .bottom-nav { visibility: hidden; }


/* ---- Language button in the header on every screen ---------------------------------------- */
@media (max-width: 991.98px) {
  .nav-tools > .nav-prefs { display: flex; align-items: center; }
  .nav-prefs .lang-btn { min-width: 2.6rem; padding-left: 0.3rem; padding-right: 0.3rem; }
  .nav-prefs .lang-btn .bi-translate { display: none; }
  .nav-prefs .lang-current { min-width: 2rem; padding: 0.15rem 0.45rem; font-size: 0.8rem; }
  .nav-prefs .lang-menu { z-index: 1100; }
}
/* in the app's teal header: a light chip like the server status chip */
.is-app .site-navbar .nav-prefs .lang-btn { color: #fff; }
@media (max-width: 991.98px) {
  .is-app .site-navbar .nav-prefs .lang-current { background: rgba(255, 255, 255, 0.16); color: #fff; border: 1px solid rgba(255, 255, 255, 0.28); }
}
/* narrow phones: the brand name gives way first, so logo, language, status and menu stay on one row */
@media (max-width: 379.98px) {
  .site-navbar .navbar-brand { min-width: 0; flex: 1 1 auto; }
  .site-navbar .navbar-brand > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .is-app .app-status-btn { gap: 0.25rem; padding: 0 0.4rem; }
}


@media (max-width: 991.98px) {  /* the member list (direct assign) open: the sticky buttons step aside too */
  .lead-form:has([data-person-list]:not([hidden])) .lead-form-actions { visibility: hidden; }
}

/* Tables scroll sideways instead of breaking words ("Bengalur|u"); main .card sets overflow-wrap:anywhere */
.table-responsive .table td { overflow-wrap: normal; }
/* How It Works on wide screens: the icon sits inline with a title that wraps to two lines */
@media (min-width: 992px) {
  .how-section .how-step h3 { display: block; }
  .how-section .how-step h3 .how-icon { margin-right: 0.35rem; vertical-align: -0.1em; }
}
/* Status flow: what this side does at each status, under the chip */
.status-flow .status-step { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; max-width: 7.5rem; text-align: center; }
.status-flow .status-step-do { font-size: var(--fs-2xs, 0.72rem); color: var(--bs-secondary-color); line-height: 1.25; }
.status-flow .status-arrow { padding-top: 0.45rem; }
@media (pointer: coarse) { .status-flow .status-arrow { padding-top: 0.7rem; } }
/* How It Works: the lead status each step happens in; other ways a lead or request can go */
.how-section .how-status { margin-top: 0.45rem; font-size: var(--fs-2xs, 0.72rem); font-weight: 600; }
.status-flow .status-other li { display: inline-flex; align-items: center; gap: 0.35rem; font-size: var(--fs-2xs, 0.72rem);
  color: var(--bs-secondary-color); background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent);
  border-radius: 999px; padding: 0.25rem 0.7rem; }
.status-flow .status-other .badge { font-size: inherit; font-weight: 600; }
@media (min-width: 992px) {  /* status badges line up at the bottom of the step cards */
  .how-section .how-body { display: flex; flex-direction: column; align-items: center; }
  .how-section .how-body p { margin-bottom: 0.45rem !important; }
  .how-section .how-status { margin-top: auto; }
}

/* New-user guide (PDF): a slim link on Register, a card on About (partials/guide_link.html) */
.guide-link { display: flex; align-items: center; justify-content: center; gap: 0.45rem; margin: 0 0 1rem; padding: 0.55rem 0.8rem;
  border-radius: var(--bs-border-radius-lg); background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis);
  font-size: var(--fs-sm, 0.9rem); font-weight: 600; text-decoration: none; text-align: center; }
.guide-link:hover, .guide-link:focus-visible { text-decoration: underline; }
.guide-card { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; padding: 1.25rem 1.5rem;
  border-radius: var(--bs-border-radius-xl); background: var(--bs-body-bg); box-shadow: var(--bs-box-shadow-sm);
  border: 1px solid var(--bs-border-color-translucent); }
.guide-card-icon { flex: 0 0 3rem; height: 3rem; border-radius: 0.9rem; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.5rem; background: var(--bs-primary-bg-subtle); color: var(--bs-link-color); }
.guide-card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
@media (max-width: 575.98px) { .guide-card-actions, .guide-card .btn { width: 100%; } }
.guide-link.guide-link-sm { margin: 1rem 0 0; padding: 0.4rem 0.7rem; font-size: var(--fs-xs, 0.8rem); }

/* Dashboard summary cards open a popup with the list behind the number (dashboard-details.js) */
.stat-card .stat-card-more { display: inline-flex; align-items: center; gap: 0.2rem; margin-top: 0.35rem; padding: 0; border: 0; background: none;
  color: var(--bs-link-color); font-size: var(--fs-sm, 0.875rem); font-weight: 600; }
.stat-card .stat-card-more:focus-visible { outline: none; }
.stat-card:has(.stat-card-more:focus-visible) { outline: 2px solid var(--bs-link-color); outline-offset: 2px; }
.stat-card:has(.stat-card-more) { cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.stat-card:has(.stat-card-more):hover { transform: translateY(-2px); box-shadow: var(--bs-box-shadow); }
.card-detail-heading { font-size: var(--fs-xs, 0.8rem); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--bs-secondary-color); margin-bottom: 0.5rem; }
.card-detail-list li + li { border-top: 1px solid var(--bs-border-color-translucent); }
.card-detail-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.25rem; color: inherit; text-decoration: none; border-radius: 0.5rem; }
.card-detail-row:hover, .card-detail-row:focus-visible { background: var(--bs-tertiary-bg); }
.card-detail-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.card-detail-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-detail-meta { font-size: var(--fs-xs, 0.8rem); color: var(--bs-secondary-color); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-detail-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.2rem; flex: 0 0 auto; text-align: right; }
@media (prefers-reduced-motion: reduce) { .stat-card:has(.stat-card-more) { transition: none; } }

/* "Download this list" bar (partials/export_buttons.html) */
.export-bar { display: flex; justify-content: flex-end; margin: 0 0 1rem; }
.history-filter { flex: 1 1 10rem; min-width: 0; }
@media (max-width: 575.98px) { .history-filter:first-child { flex-basis: 100%; } }  /* the "Show" choice reads in full */

/* Printable statement and receipt (payments/print_base.html): A4, light, no menus */
.print-doc { background: #f3f4f6; color: #1f2937; }
.print-actions { max-width: 210mm; margin: 1rem auto 0; padding: 0 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.print-actions p { flex-basis: 100%; }
.print-sheet { max-width: 210mm; margin: 1rem auto 2rem; background: #fff; padding: 14mm 12mm; border-radius: 0.5rem; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); }
.print-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid #0f766e; padding-bottom: 0.75rem; margin-bottom: 1.25rem; }
.print-brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; font-size: 1.2rem; color: #134e4a; }
.print-brand-tile { width: 2rem; height: 2rem; border-radius: 0.5rem; background: #0f766e; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.print-site { color: #4b5563; font-size: 0.9rem; }
.print-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.75rem; }
.print-meta { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin-bottom: 1rem; }
.print-meta dt { color: #4b5563; font-weight: 600; }
.print-meta dd { margin: 0; }
.print-meta-wide { gap: 0.55rem 1.5rem; font-size: 1.05rem; }
.print-paid { display: inline-flex; align-items: center; gap: 0.4rem; color: #166534; background: #dcfce7; border-radius: 999px; padding: 0.3rem 0.9rem; font-size: 1.05rem; }
.print-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 1rem; }
.print-totals div { border: 1px solid #d1d5db; border-radius: 0.5rem; padding: 0.5rem 0.75rem; display: flex; flex-direction: column; }
.print-totals span { font-size: 0.8rem; color: #4b5563; }
.print-totals strong { font-size: 1.15rem; }
.print-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.print-table th, .print-table td { border-bottom: 1px solid #e5e7eb; padding: 0.4rem 0.35rem; text-align: left; vertical-align: top; }
.print-table th { background: #f0fdfa; color: #134e4a; font-weight: 700; }
.print-table .num { text-align: right; white-space: nowrap; }
.print-table tr { break-inside: avoid; }
.print-foot { margin-top: 1.5rem; padding-top: 0.75rem; border-top: 1px solid #e5e7eb; color: #6b7280; font-size: 0.8rem; }
/* Lead page: the Worker's saved payment details when the job was marked done without proof */
.payee-box { border: 1px solid var(--bs-border-color-translucent); border-radius: 0.75rem; padding: 0.75rem 1rem; background: var(--bs-tertiary-bg); }

/* Your data: the account, then one titled table per part */
.print-totals.is-4 { grid-template-columns: repeat(4, 1fr); }
.print-section { font-size: 1.05rem; font-weight: 800; color: #134e4a; margin: 1.5rem 0 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.print-count { font-size: 0.75rem; font-weight: 700; color: #134e4a; background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 999px; padding: 0 0.5rem; }
.print-part { break-inside: auto; }
.print-part .print-section { break-after: avoid; }
.print-table-wrap { overflow-x: auto; }
@media (max-width: 575.98px) { .print-sheet { padding: 1.25rem 1rem; margin: 0.75rem; } .print-totals, .print-totals.is-4 { grid-template-columns: 1fr 1fr; } }
@media print {
  @page { size: A4; margin: 12mm; }
  .print-doc { background: #fff; }
  .print-sheet { box-shadow: none; margin: 0; padding: 0; max-width: none; border-radius: 0; }
  .print-head, .print-table th, .print-paid, .print-brand-tile { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Lead form: a small heading inside a section ("Customer available time" in More details) */
.lead-form .form-subheading { font-size: 0.9rem; font-weight: 600; margin: 0 0 0.5rem; color: var(--bs-body-color); }

/* Submit work: proof and payment details as two separate, numbered parts */
.submit-part { border: 1px solid var(--bs-border-color); border-radius: 0.75rem; padding: 1rem; margin: 0 0 1rem; background: var(--bs-body-bg); }
.submit-part-title { float: left; width: 100%; display: flex; align-items: center; gap: 0.35rem; font-size: 1rem; font-weight: 600; margin: 0 0 0.35rem; }
.submit-part-num { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--brand); color: #fff; font-size: 0.8rem; font-weight: 700; margin-right: 0.15rem; }
.submit-part-title + * { clear: left; }
.submit-part > :last-child { margin-bottom: 0; }

/* Submit work: a proof file box and "Add another file" on one line */
.proof-input-row { display: flex; gap: 0.5rem; align-items: stretch; }
.proof-input-row > input[type="file"] { flex: 1 1 auto; min-width: 0; }
.proof-input-row > .proof-add-btn { flex: 0 0 auto; white-space: nowrap; }
.proof-input-row ~ .invalid-feedback { display: block; } /* the box moved into the row; crispy adds this only with an error */


/* Dark mode: Bootstrap's grey and red outline buttons are too faint on dark cards (3.3:1); lighter text */
[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-color: #c4cbd2; --bs-btn-border-color: #8a939b; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #6c757d; --bs-btn-hover-border-color: #6c757d; }
[data-bs-theme="dark"] .btn-outline-danger { --bs-btn-color: #f1aeb5; --bs-btn-border-color: #ea868f; --bs-btn-hover-color: #1f1f1f; --bs-btn-hover-bg: #ea868f; --bs-btn-hover-border-color: #ea868f; }

/* Touch screens: small buttons and boxes in the page get a finger-sized height (40px+) */
@media (pointer: coarse) {
  main .btn-sm, main .form-select-sm, main .form-control-sm, .contact-btn { min-height: 2.5rem; }
  main .btn-sm { display: inline-flex; align-items: center; justify-content: center; }
  .contact-box-number { display: inline-block; padding: 0.5rem 0; }
}

/* Light mode: the grey outline button ("Filters") a shade darker for 4.5:1 on the page background */
[data-bs-theme="light"] .btn-outline-secondary, :root:not([data-bs-theme="dark"]) .btn-outline-secondary { --bs-btn-color: #565e64; }
/* Dark mode: the red required-field star readable on dark cards */
[data-bs-theme="dark"] .asteriskField { color: #f1aeb5 !important; }
@media (pointer: coarse) {
  main table .ref-chip { display: inline-flex; align-items: center; min-height: 2.5rem; padding-inline: 0.65rem; } /* BL-000123 links in tables (cards have a View button) */
  .why-strip a { display: inline-block; padding-block: 0.6rem; }
}

/* Cities Covered popup: each city is a link to its open leads */
.stat-cities li { padding: 0; }
.stat-city-link { display: flex; align-items: center; gap: 0.6rem; width: calc(100% + 0.8rem); min-height: 2.75rem; padding: 0.55rem 0.4rem; margin: 0 -0.4rem;
  color: inherit; text-decoration: none; border-radius: 0.6rem; }
.stat-city-link:hover, .stat-city-link:focus-visible { background: rgba(var(--brand-rgb), 0.08); color: inherit; }
.stat-city-go { color: var(--bs-secondary-color); font-size: 0.8rem; }

/* Home number popups: every tile and status row links to its list */
a.stat-tile { display: flex; text-decoration: none; color: inherit; transition: border-color 0.15s, background-color 0.15s; }
a.stat-tile:hover, a.stat-tile:focus-visible { border-color: var(--brand); background: rgba(var(--brand-rgb), 0.06); }
.stat-bars li { display: block; padding: 0; }
.stat-bar-link { display: grid; grid-template-columns: minmax(6.5rem, auto) 1fr 2.25rem; align-items: center; gap: 0.75rem;
  min-height: 2.5rem; padding: 0.3rem 0.4rem; margin: 0 -0.4rem; color: inherit; text-decoration: none; border-radius: 0.6rem; }
.stat-bar-link:hover, .stat-bar-link:focus-visible { background: rgba(var(--brand-rgb), 0.08); color: inherit; }
@media (max-width: 575.98px) { .stat-bar-link { grid-template-columns: minmax(5.5rem, auto) 1fr 2rem; gap: 0.5rem; } }
.stat-list li:has(> .stat-city-link) { padding: 0; }
@media (pointer: coarse) {
  /* BL-000123 chips in cards: a bigger invisible tap area, the chip itself keeps its size */
  .ref-chip, .tap-area { position: relative; }
  .ref-chip::after, .tap-area::after { content: ""; position: absolute; inset: -0.45rem -0.35rem; }
}

/* Settings: the three Appearance buttons share the row and wrap their words on phones */
.theme-choice .btn { flex: 1 1 0; min-height: 3.5rem; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem; }
.theme-choice .btn .bi { font-size: 1.15rem; }
.settings-links .list-group-item { padding-left: 0; padding-right: 0; background: transparent; min-height: 2.75rem; display: flex; align-items: center; flex-wrap: wrap; }

/* Help and support: the ways to reach us as tappable tiles */
.help-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; height: 100%; padding: 1rem; border-radius: 0.85rem;
  background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); box-shadow: var(--bs-box-shadow-sm);
  color: inherit; text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.help-tile:hover, .help-tile:focus-visible { border-color: var(--brand); color: inherit; transform: translateY(-1px); }
.help-tile-icon { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 0.7rem; font-size: 1.2rem;
  background: rgba(var(--brand-rgb), 0.12); color: var(--brand); }
.help-tile-icon.is-whatsapp { background: #15803d; color: #fff; }
.help-tile-title { font-weight: 700; }
.help-tile-sub { font-size: 0.8rem; color: var(--bs-secondary-color); }
