/* =====================================================================
   TRUSTED HOME NURSE — Healthcare Edition stylesheet
   Color palette (TRUSTED HOME NURSE design system):
     --brand-blue:   #21668E  (Primary Brand Blue — headings, nav, primary buttons)
     --brand-red:    #DA373A  (Secondary Accent Red — CTAs, important actions, phone)
     --sky-blue:     #7BCCE4  (Decorative elements, icon backgrounds)
     --bg-light:     #F1FAFD  (Light Blue Background — hero & alt sections)
     --bg-soft:      #E7F7FB  (Soft Blue Section — why choose us, etc.)
     --heading-dark: #173B4F  (Dark Heading/Text)
     --body-text:    #4B6470  (Body Text)
     --muted-text:   #71848D  (Secondary Text)
     --border-soft:  #DCECF2  (Borders)
     --success:      #2E8B57  (Success)
     --warning:      #E6A23C  (Warning)
     --error:        #D01818  (Error)
     --white:        #FFFFFF
   ===================================================================== */

:root {
  /* New TRUSTED HOME NURSE palette */
  --brand-blue:    #21668E;
  --brand-blue-hover: #174D6B;       /* Primary button hover */
  --brand-red:     #DA373A;
  --brand-red-hover: #B92A2D;        /* CTA button hover */
  --sky-blue:      #7BCCE4;
  --bg-light:      #F1FAFD;          /* Hero and alternate sections */
  --bg-soft:       #E7F7FB;          /* Why choose us / soft section */
  --heading-dark:  #173B4F;          /* Main headings and strong text */
  --body-text:     #4B6470;          /* Body text */
  --muted-text:    #71848D;          /* Secondary text */
  --border-soft:   #DCECF2;          /* Borders */
  --success:       #2E8B57;
  --warning:       #E6A23C;
  --error:         #D01818;
  --white:         #FFFFFF;

  /* Backwards-compatible aliases (existing rules use these) */
  --primary-blue:  var(--brand-blue);
  --dark-navy:     var(--heading-dark);
  --light-blue:    var(--bg-light);
  --soft-blue:     var(--border-soft);

  /* Semantic tokens */
  --bg:            var(--white);
  --bg-soft:       var(--bg-soft);     /* keep soft section token working */
  --text:          var(--body-text);
  --muted:         var(--muted-text);
  --border:        var(--border-soft);

  --info:          var(--brand-blue);

  --radius:        14px;
  --radius-sm:     10px;
  /* Healthcare-focused soft shadow using brand blue tint */
  --shadow-sm:     0 1px 3px rgba(33,102,142,.06);
  --shadow-md:     0 8px 30px rgba(33,102,142,.10);
  --shadow-lg:     0 14px 40px rgba(33,102,142,.16);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --container-max: 1200px;
  --header-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* Horizontal overflow is clipped at the VIEWPORT level (on <html>).
   NEVER put overflow-x:hidden on <body> — that turns <body> into its
   own scroll container, which breaks position:sticky for the site
   header on iOS Safari / older mobile browsers (the header scrolled
   away with the page instead of staying pinned at the top). With the
   clip on <html> the propagation rules hand it to the viewport and the
   sticky header keeps working on every browser. */
html { overflow-x: hidden; }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Make sure body never horizontally scrolls — content wraps instead
     (the actual horizontal clipping happens on <html>, see above) */
  word-wrap: break-word;
  overflow-wrap: break-word;
}
a { color: var(--brand-blue); text-decoration: none; word-break: break-word; }
a:hover { text-decoration: underline; color: var(--brand-red); }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--heading-dark);
  margin: 0 0 .5em;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: break-word;
}
p { overflow-wrap: break-word; word-break: break-word; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1em; }
pre, code {
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: pre-wrap;
}
pre {
  max-width: 100%;
  overflow-x: auto;
}
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
small { color: var(--muted); }

.container {
  max-width: var(--container-max);
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* ----------------------- Header ----------------------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.site-header .container {
  display: flex;
  align-items: center;
  min-height: var(--header-h);
  gap: 18px;
}
.site-logo {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--brand-blue);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.site-logo:hover { text-decoration: none; color: var(--brand-blue); }
.site-logo .logo-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-blue), var(--heading-dark));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
}
.site-logo-img {
  height: 48px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
.site-logo-text {
  font-weight: 800;
  color: var(--brand-blue);
  font-size: 1.05rem;
  line-height: 1.15;
  letter-spacing: -.01em;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
/* The site-logo-text now wraps a .brand-wm — keep it visible on every screen size,
   but shrink it on very small phones so the header doesn't overflow. */
@media (max-width: 600px) {
  .site-logo-img { height: 40px; }
  .site-logo-text { font-size: .95rem; }
  .site-logo-text .brand-wm.header { font-size: .95rem; }
}
@media (max-width: 400px) {
  .site-logo-img { height: 34px; }
  .site-logo-text { font-size: .82rem; }
  .site-logo-text .brand-wm.header { font-size: .82rem; }
}

/* =====================================================================
   BRAND WORDMARK — "Trusted Home Nurse" (blue-red-blue)
   Used in header, footer, hero, and anywhere the brand name appears.
   ===================================================================== */
.brand-wm {
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
  padding: 0;
  /* inline-block (not inline-flex) so the inner spans stay naturally
     inline with whitespace between them — guarantees they render on
     ONE row and never wrap to separate lines. */
  display: inline-block;
  white-space: nowrap;
  letter-spacing: -.01em;
  vertical-align: baseline;
}
.brand-wm .wm-trusted,
.brand-wm .wm-nurse { color: var(--brand-blue); }
.brand-wm .wm-home   { color: var(--brand-red); }

/* Size presets — overridden by context if needed */
.brand-wm.header        { font-size: 1.15rem; font-weight: 800; }
.brand-wm.footer        { font-size: 1.6rem;  font-weight: 800; }
.brand-wm.footer-bottom { font-size: 1rem;    font-weight: 700; }
.brand-wm.sm            { font-size: 1rem;    font-weight: 700; }
.brand-wm.md            { font-size: 1.4rem;  font-weight: 800; }
.brand-wm.lg            { font-size: 2rem;    font-weight: 800; }
.brand-wm.xl            { font-size: 2.8rem;  font-weight: 800; }

@media (max-width: 540px) {
  .brand-wm.footer        { font-size: 1.3rem; }
  .brand-wm.lg            { font-size: 1.7rem; }
  .brand-wm.xl            { font-size: 2.1rem; }
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  margin-left: auto;
}
.site-nav a {
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
}
.site-nav a:hover { background: var(--light-blue); text-decoration: none; }
.site-nav a.btn { color: #fff; }
.nav-toggle { display: none; }

/* =====================================================================
   HEADER LOGIN / REGISTER BUTTONS — palette hover (no black)
   ===================================================================== */
.site-nav .header-login-btn {
  color: var(--heading-dark);
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.site-nav .header-login-btn:hover {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue);
  text-decoration: none;
}
.site-nav .header-register-btn {
  background: var(--brand-red);
  color: #fff !important;
  transition: background .15s, color .15s;
}
.site-nav .header-register-btn:hover {
  background: var(--brand-red-hover);
  color: #fff !important;
  text-decoration: none;
}

/* Logout button — palette hover (no black) */
.site-nav .header-logout-btn {
  background: var(--brand-blue);
  color: #fff !important;
  transition: background .15s, color .15s;
}
.site-nav .header-logout-btn:hover {
  background: var(--brand-blue-hover);
  color: #fff !important;
  text-decoration: none;
}

/* =====================================================================
   HEADER SEARCH TOGGLE (icon) — tablet & mobile only
   ===================================================================== */
.header-search-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: var(--heading-dark);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
  margin-left: auto; /* push to the right side of the header on mobile */
}
.header-search-toggle.active {
  background: var(--bg-light);
  color: var(--brand-blue);
}
.header-search-toggle:hover {
  background: var(--bg-light);
  color: var(--brand-blue);
}
.header-search-toggle svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* On mobile, keep search toggle and nav-toggle together on the right */
@media (max-width: 992px) {
  /* On tablet, search toggle pushes itself + nav to the right as a group */
  .header-search-toggle { margin-left: auto; }
  /* Remove the auto margin from nav so it sits right next to the search toggle */
  .site-nav { margin-left: 0 !important; }
  /* On mobile (<=768px), nav-toggle has no margin so it sits right next to search toggle */
  .nav-toggle { margin-left: 0 !important; }
}

/* =====================================================================
   HEADER SEARCH OVERLAY — drops down below header on tablet/mobile
   ===================================================================== */
.header-search-overlay {
  display: none; /* hidden by default; opened via JS */
  position: absolute;
  top: calc(100% + 8px); /* just below the header */
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 520px;
  background: var(--bg-light);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 6px 6px 6px 14px;
  box-shadow: var(--shadow-md);
  z-index: 60;
  align-items: center;
  gap: 10px;
}
.header-search-overlay.open {
  display: flex;
}
.header-search-overlay .hsi-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  color: var(--muted-text);
  margin-right: 6px;
}
.header-search-overlay input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: .95rem;
  color: var(--body-text);
  padding: 9px 0;
  font-family: inherit;
  min-width: 0;
}
.header-search-overlay input::placeholder { color: var(--muted-text); }
.header-search-overlay input:focus { outline: none; }
.header-search-overlay:focus-within {
  background: #fff;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(33,102,142,.14);
}
.header-search-overlay button {
  background: var(--brand-blue);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
  flex-shrink: 0;
}
.header-search-overlay button:hover { background: var(--brand-blue-hover); }

/* ----------------------- Hero (Healthcare) ----------------------- */
.hero-healthcare {
  background:
    radial-gradient(1200px 400px at 80% -100%, rgba(33,102,142,.25), transparent 60%),
    linear-gradient(135deg, var(--bg-light) 0%, var(--bg-soft) 100%);
  padding: 64px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero-healthcare::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.5) 0, transparent 40%),
    radial-gradient(circle at 90% 70%, rgba(28,100,242,.15) 0, transparent 35%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; text-align: center; }
.hero h1 {
  font-size: 2.6rem;
  margin-bottom: .25em;
  color: var(--dark-navy);
  letter-spacing: -.01em;
}
.hero p.lead {
  font-size: 1.15rem;
  color: var(--dark-navy);
  opacity: .8;
  max-width: 720px;
  margin: 0 auto 1.75em;
}

/* When the hero is sitting on top of a background image (dark overlay),
   switch ALL text to white so it stays readable. */
.hero.unsplash-hero-bg h1,
.hero.unsplash-hero-bg p.lead {
  color: #fff;
  opacity: 1;
  text-shadow: 0 2px 12px rgba(0,0,0,.45);
}
.hero.unsplash-hero-bg .quick-pill-label { color: rgba(255,255,255,.92); }
.hero.unsplash-hero-bg .quick-pill {
  background: rgba(255,255,255,.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,.4);
  backdrop-filter: blur(4px);
}
.hero.unsplash-hero-bg .quick-pill:hover {
  background: var(--brand-red);
  color: #fff;
  border-color: var(--brand-red);
}
.hero-search {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr;
  gap: 10px;
  background: #fff;
  padding: 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  margin: 0 auto;
  max-width: 820px;
}
.hero-search input {
  padding: 13px 16px;
  font-size: 1rem;
  border: 1px solid var(--soft-blue);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  width: 100%;
}
.hero-search input:focus {
  outline: 2px solid var(--brand-blue);
  outline-offset: -1px;
  border-color: var(--brand-blue);
}
.hero-search button {
  background: var(--primary-blue);
  color: #fff;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 0 20px;
  font-size: 1rem;
}
.hero-search button:hover { background: var(--brand-blue-hover); }

.quick-pills {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}
.quick-pill-label { color: var(--muted-text); font-size: .9rem; margin-right: 4px; }
.quick-pill {
  background: rgba(255,255,255,.85);
  color: var(--brand-blue);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 600;
  border: 1px solid rgba(33,102,142,.2);
  transition: all .15s;
}
.quick-pill:hover {
  background: var(--brand-blue);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

/* ----------------------- Trust Badges ----------------------- */
.trust-badges-section {
  padding: 40px 0;
  background: var(--white);
}
.trust-badges {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.trust-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.trust-badge:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-blue);
}
.trust-icon {
  flex-shrink: 0;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(15,23,42,.08);
}
.trust-icon svg {
  width: 26px; height: 26px;
}
.trust-icon.trust-icon-blue {
  background: linear-gradient(135deg, var(--brand-blue), var(--heading-dark));
}
.trust-icon.trust-icon-green {
  background: linear-gradient(135deg, var(--success), #3aa56f);
}
.trust-icon.trust-icon-purple {
  background: linear-gradient(135deg, #7C3AED, #4F46E5);
}
.trust-icon.trust-icon-orange {
  background: linear-gradient(135deg, #F59E0B, #D97706);
}
.trust-text strong {
  display: block;
  color: var(--dark-navy);
  font-size: .95rem;
  line-height: 1.3;
  margin-bottom: 2px;
}
.trust-text small {
  font-size: .8rem;
  color: var(--muted);
}

/* ----------------------- Sections ----------------------- */
.section { padding: 60px 0; }
.section.alt { background: var(--light-blue); }
.section h2.section-title { text-align: center; margin-bottom: 8px; }
.section-subtitle { margin: 0 auto 36px; max-width: 600px; }

.how-it-works {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.how-step {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.how-step .step-num {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary-blue);
  color: #fff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(28,100,242,.3);
}

/* ----------------------- Cards / grids ----------------------- */
.grid { display: grid; gap: 18px; }
.grid > * { min-width: 0; } /* allow children to shrink + wrap text inside */
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s, border-color .15s;
  display: block;
  color: var(--text);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-blue);
  text-decoration: none;
}
.card .card-title { font-size: 1.05rem; margin-bottom: 6px; color: var(--dark-navy); font-weight: 700; }
.card .card-meta { font-size: .85rem; color: var(--muted); line-height: 1.4; }
.card .card-image {
  width: 100%; aspect-ratio: 16/9;
  background: var(--light-blue);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: .9rem;
  background-size: cover; background-position: center;
}

/* Service card with icon */
.service-card {
  text-align: left;
}
.service-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--light-blue), var(--soft-blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 14px;
}
.card-cta {
  margin-top: 12px;
  color: var(--primary-blue);
  font-weight: 600;
  font-size: .9rem;
}
.card:hover .card-cta { color: var(--dark-navy); }

.location-card { text-align: center; }

/* Provider card (used on home + search) */
.provider-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
  color: var(--text);
}
.provider-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.provider-card.sponsored {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 2px rgba(33,102,142,.18), var(--shadow-md);
}
.provider-card .pc-cover {
  width: 100%;
  height: 110px;
  background: linear-gradient(135deg, var(--bg-light), var(--bg-soft));
  background-size: cover;
  background-position: center;
}
.provider-card .pc-cover.no-cover {
  background: linear-gradient(135deg, var(--bg-light), var(--bg-soft));
}
.provider-card .pc-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--border-soft) center/cover;
  background-color: var(--border-soft);
  border: 3px solid #fff;
  margin: -28px 0 0 16px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  color: var(--dark-navy); font-weight: 700;
  box-shadow: var(--shadow-md);
}
.provider-card .pc-avatar.is-initial { font-size: 1.25rem; }
.provider-card .pc-body { padding: 8px 16px 16px; min-width: 0; overflow-wrap: break-word; word-break: break-word; }
.provider-card .pc-name {
  font-weight: 700;
  color: var(--dark-navy);
  font-size: 1rem;
  margin-bottom: 4px;
  overflow-wrap: break-word;
  word-break: break-word;
  /* Clamp to 2 lines for grid layout */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.provider-card .pc-meta {
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 4px;
  overflow-wrap: break-word;
  word-break: break-word;
  /* Clamp long meta lines to 2 lines for grid layout */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.provider-card .pc-meta:last-of-type {
  /* description meta — clamp tighter */
  -webkit-line-clamp: 2;
}
.provider-card .card-cta {
  margin-top: 8px;
  color: var(--primary-blue);
  font-weight: 600;
  font-size: .85rem;
}
.provider-card:hover .card-cta { color: var(--dark-navy); }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  background: var(--soft-blue);
  color: var(--dark-navy);
  vertical-align: middle;
  margin-left: 6px;
}
.badge.verified {
  background: var(--success);
  color: #fff;
}
.badge.sponsored {
  background: #e9ecef;
  color: #888;
  font-weight: 600;
  font-size: .68rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
}
.badge.pending { background: var(--warning); color: #fff; }
.badge.approved { background: var(--success); color: #fff; }
.badge.rejected { background: var(--error); color: #fff; }
.badge.suspended { background: var(--error); color: #fff; }
.badge.draft { background: var(--muted); color: #fff; }

/* ----------------------- Footer ----------------------- */
.site-footer {
  background: var(--heading-dark);
  color: #cdd9e5;
  padding: 48px 0 24px;
  margin-top: 60px;
}
.site-footer h4 { color: #fff; margin-bottom: 12px; }
.site-footer a { color: #cdd9e5; }
.site-footer a:hover { color: var(--sky-blue); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 30px; }
.footer-bottom {
  /* ROUND 33 — full-width white separator line above the copyright bar.
     .footer-bottom now sits OUTSIDE the .container in layout.php, so this
     border-top spans the entire footer edge-to-edge. Supersedes the r32
     "no line above the copyright" state. */
  border-top: 1px solid #FFFFFF;
  padding-top: 18px;
  margin-top: 30px;
  text-align: center;
  font-size: .85rem;
  color: #8a9aa8;
  /* The copyright line stays on a single row whenever it FITS (a plain
     wrap only breaks the line when it would otherwise overflow). At very
     large browser text sizes on phones the old white-space:nowrap forced
     the line ~42px past the viewport and the clipped end disappeared
     behind body overflow-x:hidden — now it wraps to a second centered
     line instead, so the full text is always visible. */
  white-space: normal;
  max-width: 100%;
}
.footer-bottom .brand-wm { display: inline-block; white-space: nowrap; }
.footer-bottom .brand-wm span { white-space: nowrap; }

/* Footer brand column — logo only (no wordmark text) + tagline */
.footer-brand-col { display: flex; flex-direction: column; gap: 14px; }
.footer-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.footer-logo:hover { text-decoration: none; }
.footer-logo-img {
  /* Transparent PNG sits directly on the dark footer bg — no border, no white bg.
     Just the raw logo image, sized to look prominent. */
  height: 72px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  background: transparent;
  padding: 0;
  border: 0;
  border-radius: 0;
  transition: transform .15s;
}
.footer-logo:hover .footer-logo-img {
  transform: translateY(-1px);
}
.footer-tagline { color: #cdd9e5; font-size: .9rem; line-height: 1.5; margin: 0; }
.footer-bottom-wm { display: inline; margin: 0 4px; }
/* ROUND 33 — the wordmark span carries the legacy .footer-bottom class; it
   must NOT inherit the new white separator border (that belongs to the
   copyright BAR only). Higher specificity (0,3,0) than both .footer-bottom
   blocks, so it wins regardless of source order. */
.footer-bottom-wm .brand-wm.footer-bottom { font-size: 1rem; border-top: 0; }

@media (max-width: 768px) {
  .footer-logo-img { height: 60px; max-width: 180px; }
}
@media (max-width: 480px) {
  .footer-logo-img { height: 52px; max-width: 160px; }
  .footer-bottom-wm .brand-wm.footer-bottom { font-size: .9rem; }
  /* Shrink the copyright line a touch on tiny phones so the
     whole "© 2026 Trusted Home Nurse. All rights reserved."
     stays on a single row without horizontal scrolling. */
  .footer-bottom { font-size: .76rem; }
  .footer-bottom .brand-wm.footer-bottom { font-size: .82rem; }
}
@media (max-width: 360px) {
  .footer-bottom { font-size: .68rem; }
  .footer-bottom .brand-wm.footer-bottom { font-size: .74rem; }
}

/* ----------------------- Forms ----------------------- */
.form-row { margin-bottom: 14px; min-width: 0; }
.form-row label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--dark-navy); overflow-wrap: break-word; }
/* Checkbox/radio are EXCLUDED — they have their own fixed square sizing
   (see the global input[type="checkbox"] rule + section 67). Without this
   exclusion, width:100% + padding stretched them into giant tick boxes
   (e.g. /admin/roles permissions, /admin/credit-plans create "Active?"). */
.form-row input:not([type="checkbox"]):not([type="radio"]),
.form-row select,
.form-row textarea {
  width: 100%;
  max-width: 100%;
  padding: 11px 13px;
  font-size: 1rem;
  border: 1px solid var(--soft-blue);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  /* Prevent inputs from forcing parent width on long values */
  min-width: 0;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(33,102,142,.12);
}
.form-row textarea { resize: vertical; min-height: 100px; }
.form-row .hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ----------------------- Buttons ----------------------- */
/* Primary button: #21668E background + #FFFFFF text, hover #174D6B */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  background: var(--brand-blue);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background .15s, transform .1s, color .15s;
}
.btn:hover { background: var(--brand-blue-hover); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }

/* Secondary / CTA button: #DA373A background + #FFFFFF text, hover #B92A2D */
.btn.cta, .btn.red, .btn.secondary-cta {
  background: var(--brand-red);
  color: #fff;
}
.btn.cta:hover, .btn.red:hover, .btn.secondary-cta:hover {
  background: var(--brand-red-hover);
  color: #fff;
}

/* Outline button: transparent + #21668E border/text; hover #21668E bg + #fff text */
.btn.outline, .btn.secondary {
  background: transparent;
  color: var(--brand-blue);
  border: 1.5px solid var(--brand-blue);
}
.btn.outline:hover, .btn.secondary:hover {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue);
}

.btn.danger { background: var(--error); }
.btn.danger:hover { background: #9a1212; }
.btn.warning { background: var(--warning); }
.btn.warning:hover { background: #b87d27; }
.btn.success { background: var(--success); }
.btn.success:hover { background: #1f663f; }
.btn.ghost { background: transparent; color: var(--brand-blue); border: 1px solid transparent; }
.btn.ghost:hover { background: var(--bg-light); color: var(--brand-blue); }
.btn.sm { padding: 7px 12px; font-size: .85rem; }
.btn.lg { padding: 14px 28px; font-size: 1.05rem; }
.btn.block { display: flex; width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-whatsapp { background: #25D366; }
.btn-whatsapp:hover { background: #1da851; color: #fff; }

/* Submit button with processing state — for forms that upload files
   (provider registration etc.). Hover is brand-blue-hover; "Processing..." shows
   a spinner via ::before. */
.btn-submit-processing { position: relative; }
.btn-submit-processing:hover { background: var(--brand-blue-hover); color: #fff; }
.btn-submit-processing.is-processing {
  background: var(--brand-blue-hover);
  color: #fff;
  cursor: wait;
  opacity: .9;
}
.btn-submit-processing.is-processing::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin .7s linear infinite;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* ----------------------- Terms checkbox ----------------------- */
.terms-row { margin: 18px 0 8px; }
.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: .92rem;
  color: var(--dark-navy);
  font-weight: 500;
  line-height: 1.4;
  user-select: none;
}
/* Use the ACTUAL checkbox input — the global input[type="checkbox"] rule
   already styles it as a perfect square with a Unicode ✓ checkmark.
   We just need to make it visible (not hidden) inside the .terms-check label. */
.terms-check input[type="checkbox"] {
  position: static !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
  margin-top: 1px !important;
}
/* Hide the custom .terms-check-box span — we use the real checkbox now */
.terms-check-box {
  display: none !important;
}
.terms-check-text { padding-top: 1px; }
.terms-check-text a {
  color: var(--primary-blue);
  text-decoration: underline;
  font-weight: 600;
}
.terms-check-text a:hover { color: var(--brand-red); }

/* =====================================================================
   GLOBAL — Make ALL checkboxes SQUARE across the site
   (admin forms, provider forms, customer forms, etc.)
   Uses a background SVG checkmark for the checked state — this is the
   most reliable cross-browser approach (works on iOS Safari, Chrome,
   Firefox, Edge). The ::after content approach is unreliable when
   appearance:none is set on some mobile browsers.
   ===================================================================== */
input[type="checkbox"] {
  border-radius: 4px !important;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  border: 2px solid var(--border-soft, #DCECF2);
  background: #fff;
  vertical-align: middle;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
  display: inline-block;
}
input[type="checkbox"]:checked {
  background-color: var(--brand-blue, #21668E);
  border-color: var(--brand-blue, #21668E);
  /* SVG checkmark — white tick on transparent bg, scaled to fit */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='5 13 9 17 19 7'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
}
/* Remove the old ::after pseudo-element — no longer needed */
input[type="checkbox"]:checked::after {
  content: none !important;
}
input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(33,102,142,.18);
}
/* Larger checkbox specifically for the terms-check (registration forms) */
.terms-check input[type="checkbox"] {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  border-width: 3px !important;
  border-color: var(--brand-blue, #21668E) !important;
  background-color: #fff !important;
  background-image: none !important;
  border-radius: 6px !important;
  box-shadow: 0 1px 4px rgba(33,102,142,.15) !important;
}
.terms-check input[type="checkbox"]:checked {
  background-color: var(--brand-blue, #21668E) !important;
  border-color: var(--brand-blue, #21668E) !important;
  /* Larger SVG checkmark for the bigger checkbox */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='5 13 9 17 19 7'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 20px 20px !important;
}
.terms-check input[type="checkbox"]:checked::after {
  content: none !important;
}
.terms-check input[type="checkbox"]:focus {
  outline: none !important;
  box-shadow: 0 0 0 4px rgba(33,102,142,.2), 0 1px 4px rgba(33,102,142,.15) !important;
}
/* Shake animation when the user submits without checking the terms box */
.terms-check.shake {
  animation: terms-shake .4s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes terms-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
/* Pulse glow on the checkbox border so users notice it */
.terms-check.shake input[type="checkbox"] {
  border-color: var(--brand-red, #DA373A) !important;
  box-shadow: 0 0 0 4px rgba(218,55,58,.15);
}
/* NOTE: The old .terms-check input[type="checkbox"] hiding rules have been
   removed. We now use the ACTUAL checkbox input (styled as a square by the
   global rule above) and the .terms-check-box span is hidden with display:none.
   See the terms-check section above for the full styling. */

/* ----------------------- Flash messages ----------------------- */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin: 12px 0;
  border-left: 4px solid var(--info);
  background: var(--light-blue);
  color: var(--dark-navy);
}
.flash-success { border-color: var(--success); background: #E7F6EC; color: var(--success); }
.flash-error   { border-color: var(--error);   background: #FBEBE9; color: var(--error); }
.flash-info    { border-color: var(--info);    background: var(--light-blue); }

/* ----------------------- Tables ----------------------- */
table.data {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  /* Allow table to scroll horizontally on tiny screens instead of breaking layout */
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 769px) {
  table.data { display: table; overflow: visible; }
}
table.data th, table.data td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--light-blue);
  font-size: .92rem;
  vertical-align: top;
  overflow-wrap: break-word;
  word-break: break-word;
}
table.data th { background: var(--light-blue); font-weight: 700; color: var(--dark-navy); }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #f8fbff; }

/* ----------------------- Tabs ----------------------- */
/* 3 equal-width side-by-side sections — no horizontal scrollbar */
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 2px solid var(--bg-light);
  margin-bottom: 22px;
  gap: 0;
}
.tabs .tab {
  padding: 13px 10px;
  cursor: pointer;
  border: 0;
  background: none;
  color: var(--muted-text);
  font-weight: 600;
  font-size: .98rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
  text-align: center;
  width: 100%;
  min-width: 0;
  transition: color .15s, border-color .15s, background .15s;
  border-radius: 8px 8px 0 0;
}
.tabs .tab:hover {
  color: var(--brand-blue);
  background: var(--bg-light);
}
.tabs .tab.active {
  color: var(--brand-blue);
  border-color: var(--brand-blue);
  background: #fff;
  font-weight: 700;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ----------------------- Auth pages ----------------------- */
.auth-wrap {
  max-width: 480px;
  margin: 60px auto;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.auth-wrap h1 { text-align: center; margin-bottom: 8px; color: var(--heading-dark); }
.auth-wrap .auth-sub { text-align: center; color: var(--muted-text); margin-bottom: 24px; }

/* Auth page responsive — phones */
@media (max-width: 540px) {
  .auth-wrap {
    margin: 16px 10px;
    padding: 18px 16px;
    border-radius: 12px;
  }
  .auth-wrap h1 { font-size: 1.5rem; margin-bottom: 6px; }
  .auth-wrap .auth-sub { font-size: .9rem; margin-bottom: 18px; }
  /* Tabs stay as 3 equal sections — just shrink font + padding */
  .tabs { margin-bottom: 18px; }
  .tabs .tab { padding: 11px 6px; font-size: .88rem; }
  /* Make form inputs full-width and easy to tap on phones */
  .auth-wrap .form-row label { font-size: .9rem; }
  .auth-wrap .form-row input:not([type="checkbox"]):not([type="radio"]),
  .auth-wrap .form-row select,
  .auth-wrap .form-row textarea {
    padding: 12px 14px;
    font-size: 16px; /* >=16px prevents iOS Safari auto-zoom on focus */
  }
  .auth-wrap .form-actions .btn { padding: 13px 18px; font-size: 1rem; }
  .auth-wrap .text-center { font-size: .88rem; }
}
@media (max-width: 360px) {
  .auth-wrap { margin: 12px 6px; padding: 14px 12px; }
  .auth-wrap h1 { font-size: 1.3rem; }
  .tabs .tab { padding: 10px 4px; font-size: .8rem; }
}

/* ----------------------- Dashboard layout ----------------------- */
.dash-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - var(--header-h));
}
.dash-sidebar {
  background: var(--heading-dark);
  color: #cdd9e5;
  padding: 20px 0;
}
.dash-sidebar h3 {
  color: #fff;
  padding: 0 18px 12px;
  font-size: 1.05rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin: 0 0 12px;
}
.dash-sidebar a {
  display: block;
  padding: 10px 18px;
  color: #cdd9e5;
  font-size: .92rem;
  border-left: 3px solid transparent;
}
.dash-sidebar a:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.dash-sidebar a.active { background: rgba(33,102,142,.18); color: #fff; border-color: var(--brand-blue); }
.dash-main { padding: 28px; background: var(--bg-light); min-height: 600px; min-width: 0; overflow-x: hidden; }

.dash-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.dash-card {
  background: #fff;
  padding: 18px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--primary-blue);
}
.dash-card.success { border-color: var(--success); }
.dash-card.warning { border-color: var(--warning); }
.dash-card.error { border-color: var(--error); }
.dash-card .label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dash-card .value { font-size: 1.6rem; font-weight: 700; color: var(--dark-navy); margin-top: 4px; }

/* ----------------------- Admin layout ----------------------- */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.admin-sidebar {
  background: var(--heading-dark);
  color: #cdd9e5;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-sidebar .brand {
  padding: 18px;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.admin-sidebar .group {
  padding: 12px 12px 4px;
  font-size: .72rem;
  text-transform: uppercase;
  color: #8a9aa8;
  letter-spacing: .08em;
  font-weight: 700;
}
.admin-sidebar a {
  display: block;
  padding: 8px 18px;
  color: #cdd9e5;
  font-size: .9rem;
  border-left: 3px solid transparent;
}
.admin-sidebar a:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.admin-sidebar a.active { background: rgba(33,102,142,.25); color: #fff; border-color: var(--brand-blue); }
.admin-main { padding: 22px 28px; background: var(--bg-light); min-height: 100vh; min-width: 0; overflow-x: hidden; }
.admin-topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; padding: 14px 22px; border-radius: var(--radius); margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 10px;
}
.admin-topbar h1 { font-size: 1.3rem; margin: 0; }

/* ----------------------- Maintenance toggle (admin top-bar) ----------------------- */
.maint-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
  letter-spacing: .02em;
}
.maint-toggle-btn .maint-toggle-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(255,255,255,.5);
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}
.maint-toggle-btn.maintenance-on {
  background: #FFF3CD;
  color: #856404;
  border-color: #FFE69C;
}
.maint-toggle-btn.maintenance-off {
  background: #E7F6EC;
  color: #1E7E34;
  border-color: #B7E2C2;
}
.maint-toggle-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.85); }
}
/* When maintenance is OFF, kill the pulse animation */
.maint-toggle-btn.maintenance-off .maint-toggle-dot { animation: none; }

/* ----------------------- Pagination ----------------------- */
.pagination {
  display: flex; gap: 6px; justify-content: center;
  margin-top: 20px;
}
.pagination a {
  padding: 6px 12px; border: 1px solid var(--soft-blue); border-radius: 6px;
  background: #fff; color: var(--primary-blue);
}
.pagination a.active { background: var(--primary-blue); color: #fff; }

/* ----------------------- Search results ----------------------- */
/* 3 columns on PC, 2 columns on tablet, 1 column on phone */
.search-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 columns on PC */
  gap: 18px;
}
@media (max-width: 992px) {
  .search-results { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
@media (max-width: 540px) {
  .search-results { grid-template-columns: 1fr; gap: 12px; }
}

/* ----------------------- Provider Profile Page (with cover banner) ----------------------- */
.provider-profile-page { padding-bottom: 60px; }

.provider-cover {
  width: 100%;
  min-height: 280px;
  background-color: var(--soft-blue);
  background-size: cover;
  background-position: center;
  position: relative;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
.provider-cover.no-cover {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-navy) 100%);
}
.provider-cover-overlay {
  background: linear-gradient(180deg, rgba(15,23,42,.55) 0%, rgba(15,23,42,.75) 100%);
  width: 100%; height: 100%;
  min-height: 280px;
  display: flex; align-items: flex-end;
  padding: 30px 0 24px;
}
.provider-cover-inner { width: 100%; }
.cover-crumbs { color: #fff; opacity: .95; margin-bottom: 16px; font-size: .85rem; }
.cover-crumbs a { color: #fff; text-decoration: underline; }
.cover-crumbs span { color: rgba(255,255,255,.85); }

.provider-cover-grid {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 22px;
  align-items: center;
}
.provider-avatar-wrap { position: relative; }
.provider-avatar {
  width: 110px; height: 110px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: #fff;
  border: 4px solid #fff;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--primary-blue);
}
.provider-avatar.is-initial { background: linear-gradient(135deg, var(--soft-blue), var(--primary-blue)); color: #fff; }
.verify-tick {
  position: absolute;
  bottom: 6px; right: 6px;
  width: 32px; height: 32px;
  background: var(--success);
  color: #fff;
  border-radius: 50%;
  border: 3px solid #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: .9rem;
  box-shadow: var(--shadow-md);
}

.provider-cover-info { color: #fff; min-width: 0; }
.provider-cover-name {
  color: #fff;
  font-size: 2rem;
  margin: 0 0 8px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  overflow-wrap: break-word;
  word-break: break-word;
}
.provider-cover-meta {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px;
  overflow-wrap: break-word;
}
.meta-pill {
  background: rgba(255,255,255,.18);
  color: #fff;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 500;
  backdrop-filter: blur(6px);
}
.provider-cover-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.provider-cover-actions .btn {
  background: rgba(255,255,255,.95);
  color: var(--primary-blue);
}
.provider-cover-actions .btn:hover { background: #fff; }
.provider-cover-actions .btn-whatsapp { background: #25D366; color: #fff; }
.provider-cover-actions .btn-whatsapp:hover { background: #1da851; color: #fff; }

.profile-body { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; margin-top: 30px; min-width: 0; }
.profile-body > * { min-width: 0; }
.profile-section {
  background: #fff; padding: 22px; border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  overflow: hidden;
}
.profile-section h3 { margin-top: 0; color: var(--dark-navy); }
.profile-section p { overflow-wrap: break-word; word-break: break-word; }

.lock-phone {
  background: var(--light-blue);
  border: 1px dashed var(--primary-blue);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.lock-phone .masked {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--dark-navy);
  margin: 10px 0;
}
.phone-revealed {
  background: linear-gradient(135deg, var(--light-blue), #fff);
  border: 1px solid var(--success);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.phone-number {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--success);
  margin: 8px 0 14px;
  letter-spacing: 1px;
}

/* Mobile sticky contact bar */
.mobile-contact-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  z-index: 100;
  box-shadow: 0 -4px 14px rgba(15,23,42,.08);
}
.mobile-contact-bar .btn { width: 100%; }

/* ----------------------- Provider CTA ----------------------- */
/* Distinct from other sections — deep navy → brand blue gradient with red CTA accent */
.provider-cta {
  background:
    radial-gradient(900px 320px at 80% -100%, rgba(218,55,58,.22), transparent 60%),
    linear-gradient(135deg, var(--heading-dark) 0%, var(--brand-blue) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 60px 0;
  margin-top: 30px;
  box-shadow: var(--shadow-md);
}
.provider-cta h2 { color: #fff; }
.provider-cta p { color: rgba(255,255,255,.9); max-width: 600px; margin: 0 auto 24px; }
/* The CTA button inside this section — red accent */
.provider-cta .btn,
.provider-cta .btn.cta-style {
  background: var(--brand-red);
  color: #fff;
  border: 0;
  box-shadow: 0 4px 14px rgba(218,55,58,.35);
}
.provider-cta .btn:hover,
.provider-cta .btn.cta-style:hover {
  background: var(--brand-red-hover);
  color: #fff;
}

/* ----------------------- Charts ----------------------- */
.chart-wrap {
  background: #fff; padding: 18px; border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 12px; }
.chart-bars .bar {
  flex: 1; background: var(--primary-blue); border-radius: 4px 4px 0 0;
  min-height: 2px; position: relative; transition: height .3s;
}
.chart-bars .bar:hover { background: var(--dark-navy); }
.chart-bars .bar .lbl {
  position: absolute; bottom: -22px; left: 0; right: 0; text-align: center;
  font-size: .7rem; color: var(--muted);
}

/* ----------------------- Responsive ----------------------- */
@media (max-width: 992px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .dash-cards { grid-template-columns: repeat(2, 1fr); }
  .profile-body { grid-template-columns: 1fr; }
  .how-it-works { grid-template-columns: repeat(2, 1fr); }
  .trust-badges { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 2rem; }
}
@media (max-width: 768px) {
  .site-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: #fff;
    padding: 10px;
    border-bottom: 1px solid var(--border);
    margin-left: 0;
    z-index: 60; /* same stack as search overlay so toggling works cleanly */
    box-shadow: var(--shadow-md);
  }
  .site-nav.open { display: flex; }
  .nav-toggle {
    display: inline-flex; background: none; border: 0; font-size: 1.5rem;
    cursor: pointer; color: var(--dark-navy);
    padding: 6px 10px;
  }
  .hero h1 { font-size: 1.7rem; }
  .hero p.lead { font-size: 1rem; }
  .hero-search { grid-template-columns: 1fr; }
  .hero-search button { padding: 13px; }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  /* On mobile, sidebars become slide-out drawers (handled by the
     .admin-sidebar.open / .dash-sidebar.open transform rules added
     in the v8 CSS block at the end of this file). The grid is 1-col
     so the main content takes full width while the sidebar is hidden. */
  .dash-layout, .admin-layout { grid-template-columns: 1fr; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .trust-badges { grid-template-columns: 1fr; }
  .mobile-contact-bar { display: block; }
  .provider-profile-page { padding-bottom: 80px; }
  .provider-cover-grid { grid-template-columns: 80px 1fr; gap: 14px; }
  .provider-avatar { width: 80px; height: 80px; font-size: 1.8rem; }
  .provider-cover-name { font-size: 1.4rem; }
  .admin-main, .dash-main { padding: 18px 16px; }
}
@media (max-width: 540px) {
  .dash-cards { grid-template-columns: 1fr; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .how-it-works { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  /* .auth-wrap responsive rules are defined above in the Auth pages section */
  .hero h1 { font-size: 1.5rem; }
  .quick-pills { justify-content: flex-start; overflow-x: auto; padding-bottom: 4px; }
}

/* ----------------------- Print ----------------------- */
@media print {
  .site-header, .site-footer, .dash-sidebar, .admin-sidebar, .nav-toggle, .mobile-contact-bar { display: none; }
  .dash-layout, .admin-layout { display: block; }
}

/* ----------------------- Misc utilities ----------------------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 16px; }
.hide { display: none; }
.tag-list { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  background: var(--light-blue);
  color: var(--primary-blue);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 500;
  border: 1px solid var(--soft-blue);
}
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }

.alert-info { background: var(--light-blue); padding: 12px; border-radius: 6px; margin-bottom: 12px; overflow-wrap: break-word; word-break: break-word; }
.alert-warning { background: #FFF3CD; padding: 12px; border-radius: 6px; margin-bottom: 12px; color: var(--warning); }
.alert-danger { background: #FBEAE9; padding: 12px; border-radius: 6px; margin-bottom: 12px; color: var(--error); }

.cover-preview { margin-bottom: 10px; }

/* Breadcrumbs */
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumbs a { color: var(--primary-blue); }
.breadcrumbs span { color: var(--text); }

/* =====================================================================
   HEADER SEARCH BAR (direct search above nav)
   ===================================================================== */
.site-header { padding-bottom: 0; }
.site-header .container.header-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  min-height: var(--header-h);
}
.header-search-bar {
  flex: 0 1 380px;
  min-width: 220px;
  margin: 0;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--light-blue);
  border: 1px solid var(--soft-blue);
  border-radius: 999px;
  padding: 4px 4px 4px 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.header-search-bar:focus-within {
  background: #fff;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(33,102,142,.14);
}
.header-search-bar .hsi-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  color: var(--muted-text);
  margin-right: 8px;
}
.header-search-bar input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: .92rem;
  color: var(--body-text);
  padding: 7px 0;
  font-family: inherit;
}
.header-search-bar input::placeholder { color: var(--muted-text); }
.header-search-bar button {
  background: var(--brand-blue);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.header-search-bar button:hover { background: var(--brand-blue-hover); }

/* Header credit pill (customer) */
.header-credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--bg-light), var(--bg-soft));
  color: var(--heading-dark);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  border: 1px solid var(--border-soft);
  text-decoration: none;
  white-space: nowrap;
}
.header-credit-pill:hover { text-decoration: none; background: #fff; border-color: var(--brand-blue); }
.header-credit-pill .pill-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 800;
}
.header-credit-pill .pill-value { color: var(--brand-blue); }

/* Responsive: tighten header on tablet, collapse on mobile */
@media (max-width: 992px) {
  /* Hide the inline header search bar on tablet — show search icon toggle instead */
  .header-search-bar { display: none !important; }
  .header-search-toggle { display: inline-flex; }

  .site-nav a { padding: 8px 8px; font-size: .85rem; }
  .header-credit-pill { padding: 6px 10px; font-size: .8rem; }
  .header-credit-pill .pill-icon { width: 16px; height: 16px; font-size: .65rem; }
}

/* Responsive: hide header search on tiny screens, show toggle */
@media (max-width: 768px) {
  .header-search-bar { display: none !important; }
  .header-search-toggle { display: inline-flex; }
  .site-header .container.header-row { flex-wrap: nowrap; padding-bottom: 0; gap: 10px; }
}

/* =====================================================================
   SERVICES PAGE — attractive listing + detail
   ===================================================================== */
.services-hero {
  background:
    radial-gradient(900px 320px at 80% -100%, rgba(33,102,142,.22), transparent 60%),
    linear-gradient(135deg, var(--bg-light) 0%, var(--bg-soft) 100%);
  padding: 50px 0 56px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
}
.services-hero::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,.55) 0, transparent 38%),
    radial-gradient(circle at 90% 70%, rgba(33,102,142,.15) 0, transparent 35%);
  pointer-events: none;
}
.services-hero .container { position: relative; z-index: 1; }
.services-hero h1 {
  font-size: 2.2rem;
  margin-bottom: .2em;
  letter-spacing: -.01em;
}
.services-hero p.lead {
  font-size: 1.05rem;
  color: var(--dark-navy);
  opacity: .82;
  max-width: 680px;
  margin: 0 0 18px;
}
.services-hero .services-search {
  display: grid;
  grid-template-columns: 2fr 1.4fr auto;
  gap: 10px;
  max-width: 720px;
  background: #fff;
  padding: 10px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.services-hero .services-search input {
  padding: 11px 14px;
  border: 1px solid var(--soft-blue);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  width: 100%;
  outline: none;
}
.services-hero .services-search input:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(33,102,142,.1); }
.services-hero .services-search button {
  background: var(--primary-blue);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 22px;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.services-hero .services-search button:hover { background: var(--brand-blue-hover); }

.section-pad { padding: 50px 0; }
.section-pad.alt { background: var(--light-blue); }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}
.section-head h2 { margin: 0; font-size: 1.45rem; }
.section-head .head-link { color: var(--primary-blue); font-weight: 600; font-size: .9rem; }

/* Category cards */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.category-card {
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: transform .15s, box-shadow .15s, border-color .15s;
  position: relative;
  overflow: hidden;
}
.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(33,102,142,.06), rgba(123,204,228,.12));
  opacity: 0;
  transition: opacity .15s;
}
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-blue);
  text-decoration: none;
}
.category-card:hover::before { opacity: 1; }
.category-card .cc-icon {
  width: 54px; height: 54px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--bg-light), var(--bg-soft));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--brand-blue);
  position: relative;
  z-index: 1;
}
.category-card .cc-name {
  font-weight: 700;
  color: var(--heading-dark);
  font-size: 1rem;
  position: relative;
  z-index: 1;
}
.category-card .cc-count {
  font-size: .8rem;
  color: var(--muted);
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

/* Service cards */
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 columns on PC */
  gap: 18px;
}
.service-tile {
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.service-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-blue);
  text-decoration: none;
}
.service-tile .st-image {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--bg-light), var(--bg-soft));
  background-size: cover;
  background-position: center;
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-blue);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: .03em;
}
.service-tile .st-body { padding: 16px 18px; }
.service-tile .st-title {
  font-weight: 700;
  color: var(--heading-dark);
  font-size: 1.05rem;
  margin: 0 0 4px;
}
.service-tile .st-meta {
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
.service-tile .st-cta {
  margin-top: 10px;
  color: var(--primary-blue);
  font-size: .85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.service-tile:hover .st-cta { color: var(--dark-navy); }

/* Service detail header */
.service-detail-hero {
  background:
    linear-gradient(135deg, var(--bg-light) 0%, var(--bg-soft) 100%);
  padding: 36px 0 30px;
  border-bottom: 1px solid var(--border-soft);
}
.service-detail-hero h1 {
  font-size: 2rem;
  margin-bottom: .2em;
}
.service-detail-hero p { color: var(--heading-dark); opacity: .8; max-width: 760px; margin: 0; }

/* =====================================================================
   LOCATION DETAIL HERO — full-bleed city image with overlay
   ===================================================================== */
.location-detail-hero {
  width: 100%;
  min-height: 260px;
  background-size: cover;
  background-position: center;
  position: relative;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
.location-detail-hero-overlay {
  background: linear-gradient(180deg, rgba(23,59,79,.55) 0%, rgba(23,59,79,.78) 100%);
  width: 100%;
  min-height: 260px;
  display: flex;
  align-items: flex-end;
  padding: 30px 0 26px;
}
.location-detail-hero-overlay .container { position: relative; z-index: 1; }
.location-detail-hero-overlay .breadcrumbs { color: rgba(255,255,255,.85); margin-bottom: 10px; }
.location-detail-hero-overlay .breadcrumbs a { color: var(--sky-blue); }
.location-detail-hero-overlay .breadcrumbs span { color: #fff; }
.location-detail-hero-overlay h1 {
  color: #fff;
  font-size: 2.2rem;
  margin: 0 0 .15em;
  text-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.location-detail-hero-overlay p {
  color: rgba(255,255,255,.92);
  font-size: 1rem;
  margin: 0;
}
@media (max-width: 540px) {
  .location-detail-hero, .location-detail-hero-overlay { min-height: 200px; }
  .location-detail-hero-overlay { padding: 22px 0 18px; }
  .location-detail-hero-overlay h1 { font-size: 1.7rem; }
  .location-detail-hero-overlay p { font-size: .9rem; }
}

/* =====================================================================
   SERVICE DETAIL SEARCH — premium hero search bar
   ===================================================================== */
.svc-detail-search {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 10px;
  align-items: stretch;
  background: #fff;
  padding: 10px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-width: 860px;
  margin: 24px 0 0;
}
.svc-detail-search .sds-field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}
.svc-detail-search .sds-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
  flex-shrink: 0;
}
.svc-detail-search .sds-field input {
  width: 100%;
  padding: 13px 14px 13px 42px;
  border: 1px solid var(--soft-blue);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  min-width: 0;
}
.svc-detail-search .sds-field input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(33,102,142,.12);
}
.svc-detail-search .sds-field input::placeholder {
  color: var(--muted-text);
}
.svc-detail-search button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--brand-blue);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 26px;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.svc-detail-search button svg {
  width: 18px; height: 18px;
}
.svc-detail-search button:hover {
  background: var(--brand-blue-hover);
  color: #fff;
}
.svc-detail-search button:active {
  transform: translateY(1px);
}
@media (max-width: 768px) {
  .svc-detail-search {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }
  .svc-detail-search .sds-field input {
    padding: 12px 14px 12px 42px;
    font-size: 1rem;
  }
  .svc-detail-search button {
    padding: 13px;
    width: 100%;
    justify-content: center;
  }
}

/* Provider result card v2 — more attractive */
.provider-card.v2 {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.provider-card.v2 .pc-cover-block {
  background: linear-gradient(135deg, var(--primary-blue), var(--dark-navy));
  background-size: cover;
  background-position: center;
  min-height: 160px;
  position: relative;
}
.provider-card.v2 .pc-cover-block.has-image { background-color: var(--soft-blue); }
.provider-card.v2 .pc-cover-block .pc-avatar-mini {
  position: absolute;
  bottom: -28px; left: 18px;
  width: 64px; height: 64px;
  border-radius: 50%;
  background-size: cover; background-position: center;
  background-color: #fff;
  border: 3px solid #fff;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  color: var(--primary-blue);
  font-size: 1.3rem;
}
.provider-card.v2 .pc-info {
  padding: 18px 22px 18px 100px;
  display: flex; flex-direction: column; justify-content: center;
}
.provider-card.v2 .pc-actions {
  padding: 18px 22px;
  display: flex; flex-direction: column; gap: 8px; justify-content: center;
  align-items: stretch;
  border-left: 1px solid var(--border);
  background: var(--light-blue);
  min-width: 160px;
}
.provider-card.v2 .pc-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 8px 0 4px;
}
.provider-card.v2 .pc-tag {
  background: var(--light-blue);
  color: var(--primary-blue);
  border: 1px solid var(--soft-blue);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.provider-card.v2 .pc-loc {
  font-size: .85rem; color: var(--muted);
  margin: 4px 0;
  display: flex; align-items: center; gap: 6px;
}
.provider-card.v2 .pc-loc-dot {
  width: 8px; height: 8px;
  background: var(--primary-blue);
  border-radius: 50%;
  display: inline-block;
}
.provider-card.v2 .pc-desc {
  font-size: .88rem; color: var(--text);
  line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin: 4px 0 0;
}
.provider-card.v2 .pc-actions .btn { width: 100%; }

@media (max-width: 768px) {
  .provider-card.v2 { grid-template-columns: 1fr; }
  .provider-card.v2 .pc-cover-block { min-height: 130px; }
  .provider-card.v2 .pc-info { padding: 36px 18px 14px; }
  .provider-card.v2 .pc-actions { border-left: 0; border-top: 1px solid var(--border); flex-direction: row; flex-wrap: wrap; }
  .provider-card.v2 .pc-actions .btn { flex: 1; min-width: 120px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  /* Service grid: 2 columns on phone (was 1fr) */
  .service-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .services-hero .services-search { grid-template-columns: 1fr; }
  .services-hero .services-search button { padding: 12px; }
}

/* Very small phones: keep service grid at 2 columns but tighten */
@media (max-width: 480px) {
  .service-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .service-tile .st-image { aspect-ratio: 4/3; }
  .service-tile .st-body { padding: 10px 12px; }
  .service-tile .st-title { font-size: .92rem; }
  .service-tile .st-meta { font-size: .78rem; min-height: 0; }
  .service-tile .st-cta { font-size: .78rem; margin-top: 6px; }
}

/* =====================================================================
   PROVIDER PROFILE PAGE (admin view)
   ===================================================================== */
.profile-cover-wrap {
  background: linear-gradient(135deg, var(--primary-blue), var(--dark-navy));
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
  padding: 36px 28px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.profile-cover-wrap.no-cover {
  background: linear-gradient(135deg, var(--primary-blue), var(--dark-navy));
}
.profile-cover-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,.15), rgba(15,23,42,.55));
  pointer-events: none;
}
.profile-cover-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 22px;
  align-items: center;
}
.profile-cover-inner .pc-avatar-large {
  width: 110px; height: 110px;
  border-radius: 50%;
  background-size: cover; background-position: center;
  background-color: #fff;
  border: 4px solid #fff;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; font-weight: 800; color: var(--primary-blue);
}
.profile-cover-inner .pc-info-block { color: #fff; }
.profile-cover-inner .pc-info-block h2 {
  color: #fff;
  font-size: 1.7rem;
  margin: 0 0 6px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.profile-cover-inner .pc-meta-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 10px;
}
.profile-cover-inner .pc-meta-pill {
  background: rgba(255,255,255,.18);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 500;
  backdrop-filter: blur(6px);
}
.profile-cover-inner .pc-status {
  font-size: .85rem;
  opacity: .9;
}
.profile-cover-inner .pc-stats {
  display: flex;
  gap: 14px;
  align-items: center;
}
.profile-cover-inner .pc-stat {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  text-align: center;
  min-width: 100px;
  backdrop-filter: blur(8px);
}
.profile-cover-inner .pc-stat .num {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  display: block;
}
.profile-cover-inner .pc-stat .lbl {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  opacity: .85;
}

.profile-info-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  margin-top: 22px;
}
.profile-info-grid .info-block {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.profile-info-grid .info-block h3 {
  margin: 0 0 14px;
  font-size: 1.1rem;
  color: var(--dark-navy);
  display: flex; align-items: center; gap: 8px;
}
.profile-info-grid .info-block h3::before {
  content: '';
  width: 4px; height: 18px;
  background: var(--primary-blue);
  border-radius: 2px;
  display: inline-block;
}
.profile-info-grid .info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
}
.profile-info-grid .info-list li {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.profile-info-grid .info-list li .lbl {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 600;
}
.profile-info-grid .info-list li .val {
  font-size: .95rem;
  color: var(--dark-navy);
  font-weight: 500;
  margin-top: 2px;
  word-break: break-word;
}
.profile-info-grid .desc-block {
  margin-top: 16px;
  padding: 14px;
  background: var(--light-blue);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-blue);
}
.profile-info-grid .desc-block p {
  margin: 0;
  color: var(--dark-navy);
  line-height: 1.6;
}
.profile-action-row {
  margin-top: 18px;
  display: flex; flex-wrap: wrap; gap: 10px;
}
.profile-action-row .btn { flex: 0 0 auto; }

.profile-side-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.profile-side-card h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--dark-navy);
  display: flex; align-items: center; gap: 8px;
}
.profile-side-card h3::before {
  content: '';
  width: 4px; height: 16px;
  background: var(--primary-blue);
  border-radius: 2px;
  display: inline-block;
}
.profile-side-card .stat-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.profile-side-card .stat-line:last-child { border-bottom: 0; }
.profile-side-card .stat-line .lbl { color: var(--muted); font-size: .88rem; }
.profile-side-card .stat-line .val { color: var(--dark-navy); font-weight: 700; }

.profile-keyword-cloud {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px;
}

@media (max-width: 992px) {
  .profile-info-grid { grid-template-columns: 1fr; }
  .profile-info-grid .info-list { grid-template-columns: 1fr; }
  .profile-cover-inner { grid-template-columns: 80px 1fr; }
  .profile-cover-inner .pc-avatar-large { width: 80px; height: 80px; font-size: 1.8rem; }
  .profile-cover-inner .pc-stats { grid-column: 1 / -1; justify-content: flex-start; margin-top: 14px; }
  .profile-cover-inner .pc-stat { min-width: 80px; padding: 10px 12px; }
  .profile-cover-inner .pc-stat .num { font-size: 1.2rem; }
}

/* =====================================================================
   CAMPAIGN CREATE / EDIT — Run Ad form
   ===================================================================== */
.run-ad-wrap { max-width: 920px; }
.run-ad-header {
  background: linear-gradient(135deg, var(--primary-blue), var(--dark-navy));
  color: #fff;
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.run-ad-header::before {
  content: '';
  position: absolute;
  right: -60px; top: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,.15), transparent 70%);
  pointer-events: none;
}
.run-ad-header h1 { color: #fff; margin: 0 0 6px; font-size: 1.6rem; }
.run-ad-header p { color: rgba(255,255,255,.9); margin: 0; font-size: .95rem; max-width: 580px; }
.run-ad-header .run-ad-tag {
  display: inline-block;
  background: rgba(255,255,255,.18);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.form-card h3 {
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--light-blue);
  font-size: 1.1rem;
  color: var(--dark-navy);
  display: flex; align-items: center; gap: 10px;
}
.form-card h3 .fc-num {
  width: 28px; height: 28px;
  background: var(--primary-blue);
  color: #fff;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 800;
}
.form-card .auto-link-note {
  background: var(--light-blue);
  border: 1px solid var(--soft-blue);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: .88rem;
  color: var(--dark-navy);
  margin: 12px 0;
  display: flex; align-items: flex-start; gap: 10px;
}
.form-card .auto-link-note .aln-icon {
  width: 20px; height: 20px;
  background: var(--primary-blue);
  color: #fff;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}
.form-card .auto-link-note a { color: var(--primary-blue); font-weight: 600; }

/* Image upload with preview */
.ad-image-upload {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  align-items: start;
}
.ad-image-preview {
  width: 200px;
  height: 140px;
  border: 2px dashed var(--soft-blue);
  border-radius: var(--radius-sm);
  background: var(--light-blue);
  background-size: cover;
  background-position: center;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  font-size: .85rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.ad-image-preview.has-image { border-style: solid; border-color: var(--primary-blue); }
.ad-image-preview .placeholder-text {
  padding: 12px;
  line-height: 1.4;
}
.ad-image-upload .ad-image-actions {
  display: flex; flex-direction: column; gap: 8px;
}
.ad-image-upload .ad-image-actions input[type="file"] {
  font-size: .9rem;
}
.ad-image-upload .ad-image-actions .hint {
  font-size: .82rem; color: var(--muted); margin-top: 4px;
}

/* Manual location field combo */
.location-combo {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
}
.location-combo .form-row { margin: 0; }
@media (max-width: 768px) {
  .location-combo { grid-template-columns: 1fr; }
  .ad-image-upload { grid-template-columns: 1fr; }
  .ad-image-preview { width: 100%; max-width: 280px; }
}

/* Run Ad CTA button — prominent */
.btn-run-ad {
  background: linear-gradient(135deg, var(--primary-blue), var(--dark-navy));
  color: #fff;
  border: 0;
  padding: 14px 32px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(28,100,242,.35);
  transition: transform .12s, box-shadow .15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-run-ad:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(28,100,242,.45);
  color: #fff;
  text-decoration: none;
}
.btn-run-ad:active { transform: translateY(0); }

/* Budget preset pills */
.budget-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.budget-pill {
  background: #fff;
  color: var(--primary-blue);
  border: 1px solid var(--soft-blue);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s, border-color .15s;
}
.budget-pill:hover, .budget-pill.active {
  background: var(--primary-blue);
  color: #fff;
  border-color: var(--primary-blue);
}

/* =====================================================================
   ENHANCED FORM (profile_edit + general)
   ===================================================================== */
.form-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.form-section h3 {
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--light-blue);
  font-size: 1.1rem;
  color: var(--dark-navy);
  display: flex; align-items: center; gap: 10px;
}
.form-section h3 .fs-num {
  width: 26px; height: 26px;
  background: var(--primary-blue);
  color: #fff;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 800;
}

/* Image preview for profile edit */
.image-preview-tile {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  background-color: var(--light-blue);
  border: 2px solid var(--soft-blue);
  margin-bottom: 8px;
}
.image-preview-tile.cover {
  aspect-ratio: 3/1;
  max-width: 100%;
}
.image-preview-tile.empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  font-size: .85rem;
}

/* Gallery grid in profile edit */
.gallery-grid-edit {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.gallery-grid-edit .gallery-thumb {
  position: relative;
  height: 180px;            /* FIXED HEIGHT — consistent thumbnails in the edit grid */
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-color: var(--light-blue);
  border: 1px solid var(--border);
}
.gallery-grid-edit .gallery-thumb .remove-btn {
  position: absolute;
  top: 4px; right: 4px;
  width: 24px; height: 24px;
  background: rgba(15,23,42,.7);
  color: #fff;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
}
.gallery-grid-edit .gallery-thumb .remove-btn:hover { background: var(--error); }

@media (max-width: 768px) {
  .gallery-grid-edit { grid-template-columns: repeat(2, 1fr); }
}

/* =====================================================================
   PUBLIC PROVIDER PROFILE enhancements
   ===================================================================== */
.provider-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}
.provider-stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.provider-stat-card .num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-blue);
  display: block;
}
.provider-stat-card .lbl {
  font-size: .8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 2px;
}
@media (max-width: 768px) {
  .provider-stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* =====================================================================
   CAMPAIGN LIST — better card UI
   ===================================================================== */
.campaign-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  transition: box-shadow .15s, border-color .15s;
}
.campaign-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-blue); }
.campaign-card .cc-info h4 { margin: 0 0 4px; font-size: 1.05rem; color: var(--dark-navy); }
.campaign-card .cc-info p { margin: 0; color: var(--muted); font-size: .88rem; }
.campaign-card .cc-stats {
  display: flex; gap: 14px;
  margin-top: 8px;
  font-size: .82rem;
  color: var(--muted);
}
.campaign-card .cc-stats .cc-stat strong { color: var(--dark-navy); }
.campaign-card .cc-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
@media (max-width: 768px) {
  .campaign-card { grid-template-columns: 1fr; }
  .campaign-card .cc-actions { flex-direction: row; flex-wrap: wrap; align-items: stretch; }
  .campaign-card .cc-actions .btn { flex: 1; }
}

/* =====================================================================
   ADMIN PANEL — image sizing & media cards
   ===================================================================== */
.admin-media-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.admin-media-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.admin-media-box h4 {
  margin: 0 0 10px;
  font-size: .95rem;
  color: var(--dark-navy);
}
.admin-media-box .media-frame {
  background: var(--light-blue);
  border: 1px dashed var(--soft-blue);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.admin-media-box .media-frame.is-avatar {
  width: 160px;
  height: 160px;
  margin: 0 auto;
  border-radius: 50%;
  padding: 0;
  border-style: solid;
}
.admin-media-box .media-frame.is-cover {
  width: 100%;
  height: 180px;
  padding: 0;
  border-style: solid;
}
.admin-media-box .media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}
.admin-media-box.is-avatar .media-frame img {
  border-radius: 50%;
}
.admin-media-box .media-empty {
  color: var(--muted);
  font-size: .85rem;
  text-align: center;
  padding: 20px;
}
.admin-media-box .media-path {
  margin-top: 8px;
  font-size: .78rem;
  color: var(--muted);
  word-break: break-all;
}

/* Admin provider header banner */
.admin-provider-hero {
  background: linear-gradient(135deg, var(--primary-blue), var(--dark-navy));
  color: #fff;
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 18px;
  align-items: center;
  box-shadow: var(--shadow-md);
}
.admin-provider-hero .aph-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background-size: cover; background-position: center;
  background-color: #fff;
  border: 3px solid #fff;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 800; color: var(--primary-blue);
}
.admin-provider-hero .aph-info h2 {
  color: #fff;
  margin: 0 0 6px;
  font-size: 1.4rem;
}
.admin-provider-hero .aph-info .aph-meta {
  color: rgba(255,255,255,.85);
  font-size: .9rem;
  margin-bottom: 6px;
}
.admin-provider-hero .aph-status .badge {
  margin-left: 0;
}
@media (max-width: 768px) {
  .admin-media-grid { grid-template-columns: 1fr; }
  .admin-provider-hero { grid-template-columns: 64px 1fr; }
  .admin-provider-hero .aph-avatar { width: 64px; height: 64px; font-size: 1.4rem; }
  .admin-provider-hero .aph-status { grid-column: 1 / -1; }
}

/* Admin gallery grid */
.admin-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.admin-gallery-grid .agt {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--light-blue);
}
.admin-gallery-grid .agt img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
@media (max-width: 768px) {
  .admin-gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Admin ad image preview (in campaign view) */
.admin-ad-image-preview {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--light-blue);
}
.admin-ad-image-preview img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.admin-ad-image-preview .empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: .85rem;
}

/* Admin providers list — small avatar */
.admin-provider-row-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background-size: cover; background-position: center;
  background-color: var(--light-blue);
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--primary-blue);
  flex-shrink: 0;
}

/* Admin filter bar */
.admin-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #fff;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.admin-filter-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-filter-input,
.admin-filter-select {
  padding: 9px 12px;
  border: 1px solid var(--soft-blue);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.admin-filter-input { min-width: 280px; flex: 1; }
.admin-filter-input:focus,
.admin-filter-select:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(33,102,142,.14);
}
.admin-filter-count {
  font-size: .85rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Admin providers table */
.admin-providers-table {
  table-layout: auto;
}
.admin-providers-table th,
.admin-providers-table td {
  vertical-align: middle;
  padding: 12px 14px;
}
.admin-providers-table th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.admin-providers-table .col-business { min-width: 220px; }
.admin-providers-table .col-service { min-width: 150px; }
.admin-providers-table .col-location { min-width: 150px; }
.admin-providers-table .col-phone { white-space: nowrap; }
.admin-providers-table .col-points { text-align: center; }
.admin-providers-table .col-actions { text-align: right; white-space: nowrap; }

.admin-providers-table .empty-row {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
}

.admin-row-business {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-row-business-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.admin-row-biz-name {
  font-weight: 600;
  color: var(--dark-navy);
  font-size: .92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.admin-row-owner {
  font-size: .78rem;
  color: var(--muted);
}
.admin-row-loc {
  font-size: .9rem;
  color: var(--dark-navy);
  font-weight: 500;
}
.admin-row-loc-sub {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 2px;
}

@media (max-width: 768px) {
  .admin-filter-input { min-width: 200px; }
  .admin-providers-table .col-service,
  .admin-providers-table .col-phone { display: none; }
}

/* Customer avatar in admin */
.admin-customer-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--soft-blue), var(--primary-blue));
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem;
  flex-shrink: 0;
}

/* =====================================================================
   UNSPLASH PLACEHOLDER IMAGES — used in home + frontend pages
   ===================================================================== */
.unsplash-hero-bg {
  background-image:
    linear-gradient(135deg, rgba(23,59,79,.55), rgba(33,102,142,.45)),
    url('https://cdn.pixabay.com/photo/2022/04/26/10/28/patient-7158024_1280.jpg');
  background-size: cover;
  background-position: center;
}
.unsplash-cta-bg {
  background-image:
    linear-gradient(135deg, rgba(23,59,79,.85), rgba(33,102,142,.80)),
    url('https://cdn.pixabay.com/photo/2018/07/04/16/21/chiropractic-3516426_1280.jpg');
  background-size: cover;
  background-position: center;
}
.unsplash-section-bg {
  background-image:
    linear-gradient(135deg, rgba(241,250,253,.92), rgba(231,247,251,.92)),
    url('https://cdn.pixabay.com/photo/2014/12/10/20/48/laboratory-563423_1280.jpg');
  background-size: cover;
  background-position: center;
}

/* Service/Category default cover images (Unsplash) */
.unsplash-cover-1 { background-image: linear-gradient(135deg, rgba(28,100,242,.1), rgba(15,23,42,.2)), url('https://images.unsplash.com/photo-1576091160550-2173dba999ef?w=800&q=80&auto=format&fit=crop'); background-size: cover; background-position: center; }
.unsplash-cover-2 { background-image: linear-gradient(135deg, rgba(28,100,242,.1), rgba(15,23,42,.2)), url('https://images.unsplash.com/photo-1582750433449-648ed127bb54?w=800&q=80&auto=format&fit=crop'); background-size: cover; background-position: center; }
.unsplash-cover-3 { background-image: linear-gradient(135deg, rgba(28,100,242,.1), rgba(15,23,42,.2)), url('https://images.unsplash.com/photo-1559239115-eea44a4cf86e?w=800&q=80&auto=format&fit=crop'); background-size: cover; background-position: center; }
.unsplash-cover-4 { background-image: linear-gradient(135deg, rgba(28,100,242,.1), rgba(15,23,42,.2)), url('https://images.unsplash.com/photo-1516574187841-69301976e499?w=800&q=80&auto=format&fit=crop'); background-size: cover; background-position: center; }
.unsplash-cover-5 { background-image: linear-gradient(135deg, rgba(28,100,242,.1), rgba(15,23,42,.2)), url('https://images.unsplash.com/photo-1571772996211-2f02c9727629?w=800&q=80&auto=format&fit=crop'); background-size: cover; background-position: center; }

/* Default cover banner for providers who don't have one */
.unsplash-provider-cover {
  background-image:
    linear-gradient(135deg, rgba(28,100,242,.6), rgba(15,23,42,.7)),
    url('https://images.unsplash.com/photo-1631217868264-e5b90bb7e133?w=1600&q=80&auto=format&fit=crop');
  background-size: cover;
  background-position: center;
}

/* =====================================================================
   ADMIN ACTION BUTTONS — compact Approve / Reject / Suspend / Delete
   ===================================================================== */
.admin-action-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  font-size: .82rem;
  font-weight: 600;
  font-family: inherit;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: #fff;
  transition: background .15s, transform .1s;
  text-decoration: none;
  line-height: 1.2;
}
.btn-action:active { transform: translateY(1px); }
.btn-action svg { flex-shrink: 0; }
.btn-action-approve { background: var(--success); }
.btn-action-approve:hover { background: #047857; }
.btn-action-reject { background: var(--error); }
.btn-action-reject:hover { background: #8a2a23; }
.btn-action-suspend { background: var(--warning); }
.btn-action-suspend:hover { background: #9d5a05; }
.btn-action-delete { background: var(--error); }
.btn-action-delete:hover { background: #8a2a23; }

/* =====================================================================
   ADMIN DOCUMENTS TABLE — file-type icon + View/Download actions
   ===================================================================== */
.admin-docs-table .doc-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-docs-table .doc-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 6px;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .03em;
  color: #fff;
  flex-shrink: 0;
}
.admin-docs-table .doc-icon-image { background: #059669; }
.admin-docs-table .doc-icon-pdf { background: #DC2626; }
.admin-docs-table .doc-icon-doc { background: #2563EB; }
.admin-docs-table .doc-name {
  font-weight: 500;
  color: var(--dark-navy);
  word-break: break-all;
  overflow-wrap: break-word;
}
.admin-docs-table .doc-actions {
  white-space: nowrap;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* =====================================================================
   DOCUMENT VIEWER MODAL (iframe popup)
   ===================================================================== */
.doc-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.doc-modal.open { display: flex; }
.doc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .65);
  backdrop-filter: blur(3px);
}
.doc-modal-dialog {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(15, 23, 42, .35);
  overflow: hidden;
}
.doc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--light-blue);
  flex-shrink: 0;
}
.doc-modal-title {
  font-weight: 700;
  color: var(--dark-navy);
  font-size: .95rem;
  overflow-wrap: break-word;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}
.doc-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.doc-modal-close {
  width: 32px; height: 32px;
  border: 0;
  background: #fff;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--dark-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.doc-modal-close:hover { background: var(--error); color: #fff; }
.doc-modal-body {
  padding: 16px;
  overflow: auto;
  flex: 1;
  min-height: 0;
  background: #f5f8fc;
}
.doc-modal-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: .9rem;
}
.doc-modal-note {
  margin-top: 12px;
  padding: 10px 12px;
  background: #fff3cd;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  color: var(--warning);
}
.doc-modal-note a { color: var(--warning); font-weight: 700; text-decoration: underline; }

@media (max-width: 768px) {
  .doc-modal { padding: 8px; }
  .doc-modal-dialog { max-height: 95vh; }
  .doc-modal-header { padding: 10px 12px; }
  .doc-modal-title { font-size: .85rem; }
  .doc-modal-body { padding: 10px; }
}

/* =====================================================================
   BLOG SYSTEM — listing, detail, admin editor
   ===================================================================== */

/* Blog listing grid — 3 columns on PC, 2 on tablet, 1 on phone */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 18px;
}
@media (max-width: 992px) { .blog-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (max-width: 600px) { .blog-grid { grid-template-columns: 1fr; gap: 14px; } }

.blog-card {
  display: block;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--body-text);
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-blue);
  text-decoration: none;
}
.blog-card .bc-image {
  width: 100%;
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-soft);
}
.blog-card .bc-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-light), var(--bg-soft));
  color: var(--brand-blue);
  font-size: 2rem;
  font-weight: 800;
}
.blog-card .bc-body { padding: 16px 18px; }
.blog-card .bc-title {
  font-weight: 700;
  color: var(--heading-dark);
  font-size: 1.1rem;
  margin: 0 0 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card .bc-meta {
  font-size: .8rem;
  color: var(--muted-text);
  margin-bottom: 8px;
}
.blog-card .bc-excerpt {
  font-size: .9rem;
  color: var(--body-text);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card .bc-cta {
  color: var(--brand-blue);
  font-weight: 600;
  font-size: .85rem;
}
.blog-card:hover .bc-cta { color: var(--brand-red); }

/* Blog detail page */
.blog-detail { padding-bottom: 30px; }
.blog-detail-hero {
  width: 100%;
  min-height: 320px;
  background-size: cover;
  background-position: center;
  position: relative;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
.blog-detail-hero-overlay {
  background: linear-gradient(180deg, rgba(23,59,79,.45) 0%, rgba(23,59,79,.85) 100%);
  width: 100%;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  padding: 36px 0 28px;
}
.blog-detail-hero-overlay .container { position: relative; z-index: 1; }
.blog-detail-hero-overlay h1 {
  color: #fff;
  font-size: 2.2rem;
  margin: 0 0 8px;
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
  line-height: 1.2;
}
.blog-detail-meta {
  color: rgba(255,255,255,.9);
  font-size: .92rem;
  margin-bottom: 12px;
}
.blog-content {
  max-width: 760px;
  margin: 30px auto 0;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--body-text);
}
.blog-content h2 { color: var(--heading-dark); margin-top: 1.8em; font-size: 1.5rem; }
.blog-content h3 { color: var(--heading-dark); margin-top: 1.5em; font-size: 1.2rem; }
.blog-content p { margin: 0 0 1em; }
.blog-content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 1em 0; }
.blog-content a { color: var(--brand-blue); text-decoration: underline; }
.blog-content a:hover { color: var(--brand-red); }
.blog-content ul, .blog-content ol { padding-left: 1.5em; margin: 0 0 1em; }
.blog-content blockquote {
  border-left: 4px solid var(--brand-blue);
  margin: 1em 0;
  padding: 8px 18px;
  background: var(--bg-light);
  color: var(--heading-dark);
  font-style: italic;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.blog-content code {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .9em;
}
.blog-content pre {
  background: var(--heading-dark);
  color: #fff;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 1em 0;
}
.blog-content pre code { background: transparent; padding: 0; color: inherit; }

.blog-tag {
  display: inline-block;
  background: var(--bg-soft);
  color: var(--brand-blue);
  border: 1px solid var(--border-soft);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  margin-left: 6px;
}
.blog-tags-row { font-size: .9rem; color: var(--body-text); }

@media (max-width: 540px) {
  .blog-detail-hero, .blog-detail-hero-overlay { min-height: 220px; }
  .blog-detail-hero-overlay { padding: 24px 0 18px; }
  .blog-detail-hero-overlay h1 { font-size: 1.6rem; }
  .blog-content { font-size: 1rem; }
}

/* =====================================================================
   BLOG ADMIN EDITOR — mode toggle, toolbar, interlinking
   ===================================================================== */
.blog-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
}
.blog-mode-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 2px solid var(--border-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: #fff;
  transition: border-color .15s, background .15s;
}
.blog-mode-option:hover { border-color: var(--brand-blue); background: var(--bg-light); }
.blog-mode-option input[type="radio"] {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.blog-mode-option input[type="radio"]:checked + span { color: var(--brand-blue); }
.blog-mode-option:has(input:checked) {
  border-color: var(--brand-blue);
  background: var(--bg-light);
}
.blog-mode-option span { font-size: .9rem; color: var(--body-text); line-height: 1.4; }
.blog-mode-option small { color: var(--muted-text); font-size: .8rem; }

@media (max-width: 600px) {
  .blog-mode-toggle { grid-template-columns: 1fr; }
}

/* Visual editor toolbar */
.blog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 10px;
  background: var(--bg-light);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: 0;
}
.blog-toolbar button {
  background: #fff;
  border: 1px solid var(--border-soft);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .85rem;
  font-family: inherit;
  color: var(--heading-dark);
  transition: background .12s, border-color .12s;
  min-width: 36px;
}
.blog-toolbar button:hover {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue);
}
.blog-toolbar .sep {
  width: 1px;
  background: var(--border-soft);
  margin: 2px 4px;
}
.blog-visual-area {
  background: #fff;
  border: 2px solid var(--border-soft);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 18px;
  outline: none;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--body-text);
  overflow-y: auto;
}
.blog-visual-area:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(33,102,142,.12);
}
.blog-visual-area h2 { color: var(--heading-dark); font-size: 1.4rem; margin: 1em 0 .5em; }
.blog-visual-area h3 { color: var(--heading-dark); font-size: 1.15rem; margin: 1em 0 .5em; }
.blog-visual-area a { color: var(--brand-blue); text-decoration: underline; }
.blog-visual-area img { max-width: 100%; height: auto; border-radius: 6px; }
.blog-visual-area blockquote {
  border-left: 4px solid var(--brand-blue);
  padding: 6px 14px;
  margin: 1em 0;
  background: var(--bg-light);
  color: var(--heading-dark);
  font-style: italic;
}

/* Interlinking helper */
.blog-interlink-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}
.blog-interlink-item {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: .82rem;
  transition: border-color .12s, background .12s, transform .12s;
}
.blog-interlink-item:hover {
  border-color: var(--brand-blue);
  background: var(--bg-light);
  transform: translateY(-1px);
}
.blog-interlink-item.copied {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.blog-interlink-type {
  grid-row: 1 / 3;
  align-self: center;
  background: var(--brand-blue);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.blog-interlink-item.copied .blog-interlink-type { background: #fff; color: var(--success); }
.blog-interlink-title {
  font-weight: 600;
  color: var(--heading-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.blog-interlink-url {
  font-size: .72rem;
  color: var(--muted-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.blog-interlink-item.copied .blog-interlink-title,
.blog-interlink-item.copied .blog-interlink-url { color: #fff; }

@media (max-width: 600px) {
  .blog-interlink-list { grid-template-columns: 1fr; }
}

/* =====================================================================
   PAGE BUILDER — 3-mode editor toggle (Section / HTML / Plain Text)
   ===================================================================== */
.page-mode-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}
.page-mode-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 2px solid var(--border-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: #fff;
  transition: border-color .15s, background .15s;
}
.page-mode-option:hover { border-color: var(--brand-blue); background: var(--bg-light); }
.page-mode-option input[type="radio"] {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.page-mode-option input[type="radio"]:checked + span { color: var(--brand-blue); }
.page-mode-option:has(input:checked) {
  border-color: var(--brand-blue);
  background: var(--bg-light);
}
.page-mode-option span { font-size: .88rem; color: var(--body-text); line-height: 1.4; }
.page-mode-option small { color: var(--muted-text); font-size: .78rem; }

@media (max-width: 768px) {
  .page-mode-toggle { grid-template-columns: 1fr; }
}

/* Plain text page rendering — readable paragraphs */
.cms-page-text {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 0;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--body-text);
}
.cms-page-text p { margin: 0 0 1.2em; }
.cms-page-text a { color: var(--brand-blue); text-decoration: underline; }
.cms-page-text a:hover { color: var(--brand-red); }

/* HTML page rendering — just render the HTML as-is */
.cms-page-html { padding: 20px 0; }

/* ----------------------- Service Blog Blocks + Gallery + Reviews ----------------------- */

/* Service title under the business name on the provider cover banner */
.provider-cover-service-title {
  color: #E7F1FB;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 6px 0 0;
  text-shadow: 0 1px 3px rgba(0,0,0,.25);
}

/* Service blog block — Primary & Secondary Services each get their own
   visually distinct card-style block (like a mini blog post). */
.service-blog-block {
  padding: 22px 26px !important;
  border-radius: var(--radius);
  border: 1px solid #eaf1f7;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  position: relative;
  overflow: hidden;
}
.service-blog-block::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.service-blog-primary::before  { background: var(--primary-blue, #2F78C8); }
.service-blog-secondary::before { background: var(--soft-blue, #9EC9F3); }

.service-blog-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.service-blog-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--dark-navy, #173A5E);
}
.service-blog-meta {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted, #888);
  font-weight: 600;
}
.service-blog-intro {
  color: var(--dark-navy, #173A5E);
  font-size: .95rem;
  line-height: 1.6;
  margin: 0 0 14px;
}

/* Tag variations — primary services get the brand blue tag */
.tag.tag-primary {
  background: var(--primary-blue, #2F78C8);
  color: #fff;
  border-color: var(--primary-blue, #2F78C8);
}
.tag.sm {
  font-size: .72rem;
  padding: 2px 8px;
  margin: 2px 2px 0 0;
}

/* Gallery (public profile) — FIXED-HEIGHT image with keyword chips below.
   We use a fixed height (220px) + cover background so every image in the
   grid is the same size, no matter the original aspect ratio. */
.gallery-public-grid {
  gap: 16px;
}
.gallery-public-item {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.gallery-public-image {
  width: 100%;
  height: 220px;            /* FIXED HEIGHT — every image is the same size */
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-color: #eef2f6; /* placeholder color while loading */
}
.gallery-public-kw {
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  border-top: 1px solid #eef2f6;
}

/* Gallery thumbnail (edit screen) — image with keyword chip below */
.gallery-thumb-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gallery-thumb-kw {
  font-size: .78rem;
  color: var(--dark-navy, #173A5E);
  padding: 4px 6px;
  background: #f5f8fc;
  border-radius: 4px;
  text-align: center;
}

/* Reviews — summary bar */
.reviews-summary-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #FFF8E7, #FFFBF0);
  border-radius: var(--radius);
  border-left: 4px solid #FFB400;
  margin-bottom: 16px;
  font-size: 1rem;
}
.reviews-summary-bar .rating-stars {
  display: inline-flex;
  gap: 2px;
}
.reviews-summary-bar .rating-stars .star,
.review-stars .star,
.review-item .star {
  color: #ccc;
  font-size: 1.1rem;
  line-height: 1;
}
.reviews-summary-bar .rating-stars .star.filled,
.review-stars .star.filled,
.review-item .star.filled {
  color: #FFB400;
}

/* Reviews — overview (avg + distribution) — used on provider's own reviews page */
.reviews-summary-overview {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 30px;
  align-items: center;
  padding: 18px 22px;
}
.reviews-avg-block {
  text-align: center;
  border-right: 1px solid #eef2f6;
  padding-right: 20px;
}
.reviews-avg-num {
  font-size: 3rem;
  font-weight: 800;
  color: var(--dark-navy, #173A5E);
  line-height: 1;
}
.reviews-avg-stars {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin: 6px 0 4px;
}
.reviews-avg-stars .star {
  font-size: 1.4rem;
  color: #ccc;
}
.reviews-avg-stars .star.filled { color: #FFB400; }

.reviews-dist-block { display: flex; flex-direction: column; gap: 6px; }
.dist-row {
  display: grid;
  grid-template-columns: 36px 1fr 32px;
  gap: 10px;
  align-items: center;
  font-size: .85rem;
}
.dist-lbl { color: var(--dark-navy, #173A5E); font-weight: 600; }
.dist-bar {
  height: 8px;
  background: #eef2f6;
  border-radius: 999px;
  overflow: hidden;
}
.dist-fill {
  height: 100%;
  background: linear-gradient(90deg, #FFB400, #FF8800);
  border-radius: 999px;
  transition: width .3s ease;
}
.dist-count {
  text-align: right;
  color: var(--muted, #888);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  .reviews-summary-overview { grid-template-columns: 1fr; gap: 16px; }
  .reviews-avg-block { border-right: none; border-bottom: 1px solid #eef2f6; padding-bottom: 16px; padding-right: 0; }
}

/* Reviews — list */
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.review-item {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #eef2f6;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.review-item .review-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.review-item .review-author {
  font-weight: 700;
  color: var(--dark-navy, #173A5E);
}
.review-item .review-stars {
  display: inline-flex;
  gap: 1px;
}
.review-item .review-date {
  margin-left: auto;
  font-size: .8rem;
  color: var(--muted, #888);
}
.review-item p {
  margin: 6px 0 0;
  color: var(--dark-navy, #173A5E);
  line-height: 1.5;
}

/* Char counter for char-limited form fields */
.char-counter {
  display: inline-block;
  margin-left: 8px;
  font-size: .78rem;
  color: var(--muted, #888);
  font-weight: 600;
}

/* =====================================================================
   RESPONSIVE TABLE — Customer Directory
   On mobile, the 11-column table transforms into a card-based layout
   where each row becomes a stacked card with label:value pairs.
   ===================================================================== */
@media (max-width: 900px) {
  .directory-table thead { display: none; }
  .directory-table,
  .directory-table tbody,
  .directory-table tr,
  .directory-table td { display: block; width: 100%; }
  .directory-table tr {
    margin-bottom: 14px;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    background: #fff;
    padding: 8px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
  }
  .directory-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border: 0;
    border-bottom: 1px solid #f0f3f7;
    text-align: right;
  }
  .directory-table td:last-child { border-bottom: 0; }
  .directory-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--dark-navy, #173A5E);
    font-size: .82rem;
    text-align: left;
    flex-shrink: 0;
  }
  /* Keep the "Name" row prominent */
  .directory-table td[data-label="Name"] {
    flex-direction: column;
    align-items: flex-start;
    border-bottom: 2px solid #e3e8ef;
    padding-bottom: 10px;
    margin-bottom: 4px;
  }
  .directory-table td[data-label="Name"]::before {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted, #888);
  }
  /* Make the actions row full-width and left-aligned */
  .directory-table td[data-label="Actions"] {
    justify-content: flex-start;
  }
  .directory-table td[data-label="Actions"]::before { display: none; }
}

/* =====================================================================
   RESPONSIVE HEADER FIX — make the header work on all screen sizes
   The original header had issues:
     1. Logo image + wordmark text took too much horizontal space on phones,
        pushing the search toggle and hamburger menu off-screen.
     2. The header row used flex-wrap: nowrap, so elements couldn't wrap.
     3. On very small screens (<=480px), the wordmark text overflowed.
   Fix:
     - Allow the header row to wrap gracefully on small screens.
     - Hide the wordmark text on phones <=480px (show only the logo image).
     - Keep the search toggle + hamburger always visible and accessible.
     - Ensure the nav dropdown is full-width and scrolls if too long.
   ===================================================================== */
@media (max-width: 768px) {
  /* Allow header to wrap so toggles are always reachable */
  .site-header .container.header-row {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px;
    min-height: auto;
  }
  /* Logo: shrink + allow the text to be hidden on tiny screens */
  .site-logo {
    flex-shrink: 1;
    min-width: 0;
    gap: 8px;
  }
  .site-logo-img {
    height: 38px;
    flex-shrink: 0;
  }
  /* Push search toggle + nav toggle to the right as a group */
  .header-search-toggle {
    margin-left: auto;
    order: 10;
  }
  .nav-toggle {
    order: 11;
    margin-left: 0 !important;
  }
  /* Nav dropdown: full width below the header */
  .site-nav {
    order: 20;
    flex-basis: 100%;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,.1));
  }
  .site-nav a {
    width: 100%;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f3f7;
  }
  .site-nav a:last-child { border-bottom: 0; }
}

/* On very small phones, hide the wordmark text — logo image only */
@media (max-width: 480px) {
  .site-logo-text { display: none; }
  .site-logo-img { height: 34px; }
  .site-header .container.header-row {
    padding: 6px 12px;
  }
  .header-search-toggle svg,
  .nav-toggle { font-size: 1.3rem; }
}

/* Search overlay: full-width on mobile */
@media (max-width: 768px) {
  .header-search-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 0;
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,.1));
  }
}

/* =====================================================================
   AD PLACEMENT OPTIONS — radio cards in campaign create/edit
   ===================================================================== */
.placement-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}
.placement-option { cursor: pointer; }
.placement-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.placement-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 14px;
  border: 2px solid #e3e8ef;
  border-radius: 10px;
  background: #fff;
  transition: border-color .15s, background .15s, box-shadow .15s;
  height: 100%;
}
.placement-option:hover .placement-card { border-color: var(--soft-blue, #9EC9F3); }
.placement-option input[type="radio"]:checked + .placement-card {
  border-color: var(--primary-blue, #2F78C8);
  background: linear-gradient(135deg, #F0F6FC, #E7F1FB);
  box-shadow: 0 2px 8px rgba(33,102,142,.12);
}
.placement-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--light-blue, #E7F1FB);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-blue, #2F78C8);
}
.placement-option input[type="radio"]:checked + .placement-card .placement-icon {
  background: var(--primary-blue, #2F78C8);
  color: #fff;
}
.placement-text { display: flex; flex-direction: column; gap: 4px; }
.placement-text strong {
  font-size: .95rem;
  color: var(--dark-navy, #173A5E);
  font-weight: 700;
}
.placement-text small {
  font-size: .78rem;
  color: var(--muted, #888);
  line-height: 1.4;
}

@media (max-width: 768px) {
  .placement-options { grid-template-columns: 1fr; gap: 8px; }
  .placement-card { flex-direction: row; align-items: center; gap: 12px; padding: 12px; }
  .placement-text { flex: 1; }
}

/* =====================================================================
   RELATED NURSES SECTION — bottom of provider profile page
   ===================================================================== */
.profile-related-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid #eef2f7;
}
.related-section-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--dark-navy, #173A5E);
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef2f7;
}
.related-block { margin-bottom: 24px; }
.related-block-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark-navy, #173A5E);
  margin: 0 0 12px;
}
.related-block .search-results { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 992px) { .related-block .search-results { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .related-block .search-results { grid-template-columns: 1fr; } }

/* =====================================================================
   BOTTOM-SPONSORED SEARCH ADS — Amazon-style sponsored block at the
   bottom of the search results page
   ===================================================================== */
.search-sponsored-bottom { margin-top: 32px; padding-top: 20px; border-top: 2px solid #eef2f7; }
.sponsored-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark-navy, #173A5E);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef2f7;
}
.search-sponsored-bottom .search-results { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 992px) { .search-sponsored-bottom .search-results { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .search-sponsored-bottom .search-results { grid-template-columns: 1fr; } }

/* =====================================================================
   FEATURED CARE PROVIDERS — home page section
   3-column grid (2 on tablet, 1 on phone), top 12 by SEO points.
   ===================================================================== */
.featured-providers-grid {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 992px) {
  .featured-providers-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
@media (max-width: 540px) {
  .featured-providers-grid { grid-template-columns: 1fr; gap: 12px; }
}

/* Service title shown prominently under the business name on provider cards.
   Used on the home page Featured Care Providers section. */
.pc-service-title {
  font-weight: 600;
  font-size: .92rem;
  color: var(--dark-navy, #173A5E);
  margin: 2px 0 4px;
  line-height: 1.3;
}

/* =====================================================================
   UI RECONSTRUCTION — v8 fixes
   - Fixes the Ad Content form-card "toggle bar" look (step header is
     now a clear colored bar with step number + title).
   - Fixes the hero search box overflow on small screens.
   - Makes the header search bar fit on tablet widths (was overflowing).
   - Adds comprehensive responsive rules for admin/provider/customer panels.
   ===================================================================== */

/* ---- Ad Content form-card: step header as a proper colored bar ----
   The card has NO outer padding (so the header bar can stretch edge-to-edge).
   Instead, an INNER content wrapper gets the padding. But since the markup
   doesn't always have an inner wrapper, we use a two-pronged approach:
   1. The header (h3) stretches edge-to-edge with its OWN internal padding.
   2. All other children get consistent left/right/top/bottom margins via
      a content-area pseudo-padding technique.
*/
.form-card {
  padding: 0 !important;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border-soft, #DCECF2);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(33,102,142,.05);
  box-sizing: border-box;
  margin-bottom: 18px;
}
/* Header bar — stretches edge-to-edge, has its OWN internal padding */
.form-card > h3 {
  margin: 0 !important;
  padding: 16px 24px !important;
  background: linear-gradient(135deg, var(--primary-blue, #2F78C8), var(--dark-navy, #173A5E));
  color: #fff !important;
  font-size: 1.05rem !important;
  font-weight: 700;
  border-bottom: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  border-radius: 0;
  box-sizing: border-box;
}
.form-card > h3 .fc-num {
  width: 32px !important;
  height: 32px !important;
  background: rgba(255,255,255,.22) !important;
  color: #fff !important;
  border: 2px solid rgba(255,255,255,.5);
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: .95rem !important;
  font-weight: 800 !important;
  flex-shrink: 0;
}
/* ---- Card body padding ----
   Instead of relying on per-child margins (which is fragile), we wrap all
   non-h3 children in a virtual content area using a pseudo-element trick.
   But the simplest robust approach: give EVERY direct child (except h3)
   consistent horizontal margins + a top/bottom margin, AND override the
   full-width children (placement-options, location-combo, grid) to ALSO
   have horizontal padding so their content doesn't touch the card edges.
*/
.form-card > *:not(h3) {
  margin-left: 24px;
  margin-right: 24px;
  box-sizing: border-box;
}
.form-card > *:not(h3):first-of-type {
  margin-top: 20px;
}
.form-card > *:not(h3):last-child {
  margin-bottom: 22px;
}
/* Full-width children — they still get horizontal MARGINS (not padding)
   so their own content sits inside the card's safe area. */
.form-card .placement-options,
.form-card .ad-image-upload,
.form-card .location-combo,
.form-card .grid,
.form-card .budget-presets,
.form-card .form-actions {
  margin-left: 24px !important;
  margin-right: 24px !important;
  box-sizing: border-box;
}
/* The auto-link note — same margins as everything else */
.form-card .auto-link-note {
  margin-left: 24px !important;
  margin-right: 24px !important;
  margin-top: 20px;
  margin-bottom: 20px;
  box-sizing: border-box;
}
/* Ensure form-rows inside form-card don't add their own side margins
   (they already inherit the 24px from the parent) */
.form-card .form-row {
  margin-left: 0;
  margin-right: 0;
}

/* ---- Hero search box: ensure it doesn't overflow ---- */
.hero-search {
  max-width: 100%;
  box-sizing: border-box;
}
.hero-search input { min-width: 0; box-sizing: border-box; }
@media (max-width: 768px) {
  .hero-search { padding: 10px; gap: 8px; }
  .hero-search input { padding: 11px 12px; font-size: .95rem; }
  .hero-search button { padding: 12px; font-size: .95rem; }
}
@media (max-width: 480px) {
  .hero-search input::placeholder { font-size: .85rem; }
}

/* ---- Header search bar: fit on tablet without overflowing ---- */
.header-search-bar {
  flex: 0 1 320px;
  min-width: 120px;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.header-search-bar input { min-width: 0; }
/* On medium screens (993-1200px), shrink the search bar so it doesn't
   push the nav links + credit pill off the right edge. */
@media (max-width: 1200px) and (min-width: 993px) {
  .header-search-bar { flex: 0 0 200px; min-width: 140px; }
  .header-search-bar button { padding: 7px 10px; font-size: .8rem; }
  .header-search-bar input { font-size: .85rem; padding: 6px 0; }
}
/* Below 993px the search bar is hidden and replaced by the toggle icon */
@media (max-width: 992px) {
  .header-search-bar { display: none !important; }
}

/* Ensure the header row never causes horizontal scroll on ANY page */
.site-header .container.header-row {
  overflow: hidden;
  max-width: 100%;
}
.site-logo { min-width: 0; }
.site-nav { min-width: 0; }

/* =====================================================================
   RESPONSIVE: ADMIN PANEL — sidebar, topbar, tables, forms, cards
   ===================================================================== */
@media (max-width: 992px) {
  .admin-layout {
    grid-template-columns: 1fr !important;
  }
  .admin-sidebar {
    position: fixed !important;
    top: 0; left: 0;
    height: 100vh;
    width: 280px;
    z-index: 10000;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,.15);
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main {
    width: 100%;
    padding: 16px !important;
  }
  .admin-topbar {
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px;
  }
  .admin-topbar h1 { font-size: 1.1rem; }
  /* Mobile menu toggle button (added via JS in admin/index.php) */
  .admin-menu-toggle {
    display: inline-flex !important;
  }
}
@media (max-width: 768px) {
  .admin-main { padding: 12px !important; }
  .dash-cards {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .dash-card { padding: 12px !important; }
  .dash-card .value { font-size: 1.3rem !important; }
  .dash-card .label { font-size: .72rem !important; }
  .card { padding: 14px !important; }
  .card h3 { font-size: 1rem !important; }
  /* Admin data tables become horizontally scrollable */
  .data {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .data thead, .data tbody, .data tr, .data th, .data td {
    min-width: 100px;
  }
  /* Form grids collapse to 1 column */
  .grid.cols-2, .grid.cols-3, .grid.cols-4 {
    grid-template-columns: 1fr !important;
  }
  .placement-options { grid-template-columns: 1fr !important; }
}
@media (max-width: 540px) {
  .dash-cards { grid-template-columns: 1fr !important; }
  .admin-topbar { padding: 10px 12px !important; }
  .admin-topbar h1 { font-size: 1rem; }
  .maint-toggle-btn { font-size: .75rem !important; padding: 5px 10px !important; }
}

/* Admin sidebar mobile toggle button — hidden on desktop, shown on tablet/mobile */
.admin-menu-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10001;
  background: var(--primary-blue, #2F78C8);
  color: #fff;
  border: 0;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  align-items: center;
  justify-content: center;
}
.admin-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 9999;
  display: none;
  opacity: 0;
  transition: opacity .25s ease;
}
.admin-sidebar-backdrop.show {
  display: block;
  opacity: 1;
}
@media (max-width: 992px) {
  .admin-menu-toggle { display: inline-flex; }
  .admin-main { padding-top: 60px !important; }
}

/* =====================================================================
   RESPONSIVE: PROVIDER PANEL
   ===================================================================== */
@media (max-width: 992px) {
  .dash-layout {
    grid-template-columns: 1fr !important;
  }
  .dash-sidebar {
    position: fixed !important;
    top: 0; left: 0;
    height: 100vh;
    width: 260px;
    z-index: 10000;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,.15);
    overflow-y: auto;
  }
  .dash-sidebar.open { transform: translateX(0); }
  .dash-main {
    width: 100%;
    padding: 16px !important;
    padding-top: 60px !important;
  }
  /* Show the mobile menu toggle for provider panel too */
  .dash-menu-toggle {
    display: inline-flex !important;
  }
}
@media (max-width: 768px) {
  .dash-main { padding: 12px !important; padding-top: 60px !important; }
  .run-ad-wrap { max-width: 100% !important; }
  .run-ad-header { padding: 18px 16px !important; }
  .run-ad-header h1 { font-size: 1.3rem !important; }
  .run-ad-header p { font-size: .85rem !important; }
  .form-card > *:not(h3) {
    margin-left: 16px !important;
    margin-right: 16px !important;
  }
  .form-card .placement-options,
  .form-card .ad-image-upload,
  .form-card .location-combo,
  .form-card .grid,
  .form-card .budget-presets,
  .form-card .form-actions,
  .form-card .auto-link-note {
    margin-left: 16px !important;
    margin-right: 16px !important;
  }
  .form-card > h3 { padding: 12px 16px !important; font-size: .95rem !important; }
  .form-card h3 .fc-num { width: 26px !important; height: 26px !important; font-size: .8rem !important; }
  .ad-image-upload { grid-template-columns: 1fr !important; }
  .ad-image-preview { width: 100% !important; height: 180px !important; }
  /* Location combo: stack vertically on phone, WITH a gap between fields */
  .location-combo { grid-template-columns: 1fr !important; gap: 12px !important; }
  .budget-presets { flex-wrap: wrap; gap: 6px; }
  .budget-pill { padding: 5px 12px !important; font-size: .8rem !important; }
  .campaign-card {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .campaign-card .cc-actions {
    flex-direction: row;
    justify-content: stretch;
    gap: 8px;
  }
  .campaign-card .cc-actions .btn { flex: 1; }
}

/* Provider panel mobile menu toggle (shared with admin) */
.dash-menu-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10001;
  background: var(--primary-blue, #2F78C8);
  color: #fff;
  border: 0;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  align-items: center;
  justify-content: center;
}
.dash-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 9999;
  display: none;
  opacity: 0;
  transition: opacity .25s ease;
}
.dash-sidebar-backdrop.show {
  display: block;
  opacity: 1;
}

/* =====================================================================
   RESPONSIVE: CUSTOMER PANEL — uses the same .dash-layout as provider
   so the rules above apply. Add customer-specific tweaks below.
   ===================================================================== */
@media (max-width: 768px) {
  /* Customer unlocked-providers + dashboard cards: make grid 1-col */
  .search-results { grid-template-columns: 1fr !important; }
  .provider-card { flex-direction: column !important; align-items: stretch; }
  .provider-card .pc-cover { min-height: 140px; }
  .auth-wrap { max-width: 100% !important; padding: 0 8px; }
  .star-rating-input { gap: 2px !important; }
  .star-rating-input label svg { width: 28px !important; height: 28px !important; }
}

/* =====================================================================
   RESPONSIVE: PROVIDER PROFILE PAGE (public)
   ===================================================================== */
@media (max-width: 768px) {
  .profile-body { grid-template-columns: 1fr !important; }
  .provider-stats-row { grid-template-columns: 1fr 1fr !important; gap: 8px; }
  .provider-stat-card { padding: 10px !important; }
  .provider-cover-grid { grid-template-columns: 80px 1fr !important; gap: 12px; }
  .provider-cover-name { font-size: 1.3rem !important; }
  .provider-cover-meta { flex-wrap: wrap; gap: 6px; }
  .provider-cover-meta .meta-pill { font-size: .75rem !important; padding: 4px 8px; }
  .provider-cover-actions { flex-wrap: wrap; gap: 6px; }
  .provider-cover-actions .btn { font-size: .8rem !important; padding: 6px 12px; }
  .gallery-public-grid { grid-template-columns: 1fr 1fr !important; }
  .gallery-public-image { height: 160px !important; }
  .service-blog-block { padding: 16px !important; }
  .service-blog-header h3 { font-size: 1rem !important; }
  .reviews-summary-overview { grid-template-columns: 1fr !important; gap: 16px; }
  .reviews-avg-block { border-right: 0 !important; border-bottom: 1px solid #eef2f6; padding-bottom: 16px; }
  .mobile-contact-bar .btn { width: 100%; }
}
@media (max-width: 480px) {
  .gallery-public-grid { grid-template-columns: 1fr !important; }
  .gallery-public-image { height: 200px !important; }
  /* Stats stay a 2x2 grid on phones (4 cards: Campaigns / Impressions / Clicks / Reviews) */
  .provider-stats-row { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .provider-stat-card { padding: 12px 8px !important; }
  .provider-stat-card .num { font-size: 1.15rem !important; }
  .provider-stat-card .lbl { font-size: .68rem !important; letter-spacing: .02em; }
  .provider-cover-grid { grid-template-columns: 1fr !important; text-align: center; }
  .provider-cover-grid .provider-avatar-wrap { justify-content: center; }
  .provider-cover-info { text-align: center; }
  .provider-cover-meta { justify-content: center; }
  .provider-cover-actions { justify-content: center; }
}

/* =====================================================================
   RESPONSIVE: FORM ELEMENTS — inputs, selects, textareas
   ===================================================================== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.form-row { max-width: 100%; }
.form-row input:not([type="checkbox"]):not([type="radio"]),
.form-row select,
.form-row textarea {
  width: 100%;
  box-sizing: border-box;
}

/* =====================================================================
   RESPONSIVE: FOOTER + MISC
   ===================================================================== */
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr !important; gap: 20px; }
  .footer-bottom { font-size: .8rem; }
  .section { padding: 20px 0 !important; }
  .section-title { font-size: 1.3rem !important; }
  .container { padding-left: 14px; padding-right: 14px; }
  .btn { padding: 9px 16px; font-size: .9rem; }
  .btn.sm { padding: 6px 10px; font-size: .82rem; }
  .btn.lg { padding: 12px 22px; font-size: 1rem; }
  .btn.block { width: 100%; }
}

/* =====================================================================
   MODERN UI OVERHAUL — applied on top of the existing stylesheet.
   This block:
     • Fixes the customer search-header layout (logo + search + credit pill + nav)
     • Modernizes the credits page (hero balance + plan cards)
     • Adds a customer profile card style
     • Tightens responsive behaviour across admin / provider / customer panels
     • Modernizes buttons, cards, tables, and form elements
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Header layout fix — robust flex layout that NEVER overflows
   --------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 1px 0 rgba(33,102,142,.04), 0 6px 18px rgba(33,102,142,.05);
}
.site-header .container.header-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  min-height: var(--header-h);
  padding-top: 8px;
  padding-bottom: 8px;
  overflow: visible;
}
/* Logo column — shrink to content but never overflow */
.site-logo {
  flex: 0 0 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.site-logo-img { height: 42px; width: auto; max-width: 180px; }
.site-logo-text { font-weight: 800; font-size: 1rem; color: var(--heading-dark); }

/* Search bar column — flex-grow to fill, but with sane min/max */
.header-search-bar {
  flex: 1 1 320px;
  min-width: 0;
  max-width: 460px;
  margin-left: auto;
}
/* Right-side action cluster — never wrap, never overflow */
.site-nav {
  flex: 0 0 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 0;
}
.header-credit-pill {
  order: -1; /* sit just before "Dashboard" */
  flex-shrink: 0;
}
.header-login-btn,
.header-register-btn,
.header-logout-btn { flex-shrink: 0; }
.nav-toggle { flex-shrink: 0; margin-left: 0 !important; }

/* On medium screens (993–1200px) shrink the search bar */
@media (max-width: 1200px) and (min-width: 993px) {
  .header-search-bar { flex: 0 0 220px; max-width: 260px; }
  .header-search-bar button { padding: 7px 12px; font-size: .82rem; }
  .header-search-bar input { font-size: .88rem; }
  .site-nav { gap: 8px; }
  .site-nav a { padding: 8px 10px !important; font-size: .85rem !important; }
}

/* ≤992px: hide inline search, show search-toggle */
@media (max-width: 992px) {
  .header-search-bar { display: none !important; }
  .header-search-toggle {
    display: inline-flex !important;
    margin-left: auto;
    order: 5;
  }
  .site-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    padding: 8px 0;
    box-shadow: 0 12px 30px rgba(33,102,142,.12);
    z-index: 40;
    max-height: 75vh;
    overflow-y: auto;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a {
    width: 100%;
    padding: 12px 18px !important;
    border-bottom: 1px solid #f0f3f7;
  }
  .site-nav a:last-child { border-bottom: 0; }
  .header-credit-pill { order: 0; }
}

/* ≤768px: hide wordmark on tiny phones */
@media (max-width: 768px) {
  .site-header .container.header-row { padding: 6px 14px; gap: 8px; }
  .site-logo-img { height: 36px; }
  .header-search-toggle { order: 5; }
  .nav-toggle { order: 6; }
}
@media (max-width: 480px) {
  .site-logo-text { display: none; }
  .site-logo-img { height: 32px; }
}

/* ---------------------------------------------------------------------
   2. Header credit pill — modern gradient + animation
   --------------------------------------------------------------------- */
.header-credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #FFF, var(--bg-light));
  color: var(--heading-dark);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  border: 1px solid var(--border-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  box-shadow: 0 1px 2px rgba(33,102,142,.05);
}
.header-credit-pill:hover {
  text-decoration: none;
  background: #fff;
  border-color: var(--brand-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(33,102,142,.12);
}
.header-credit-pill .pill-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-blue), #2A87B8);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(33,102,142,.3);
}
.header-credit-pill .pill-value { color: var(--brand-blue); }

/* ---------------------------------------------------------------------
   3. Customer credits page — modern hero + plan cards
   --------------------------------------------------------------------- */
.credits-balance-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--brand-blue) 0%, #2A87B8 50%, #1E5A7E 100%);
  color: #fff;
  padding: 28px 30px;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(33,102,142,.25);
  margin: 16px 0 24px;
  position: relative;
  overflow: hidden;
}
.credits-balance-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255,255,255,.15) 0%, transparent 60%);
  pointer-events: none;
}
.credits-balance-hero::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -8%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(123,204,228,.2) 0%, transparent 60%);
  pointer-events: none;
}
.cbh-left { position: relative; z-index: 1; }
.cbh-label {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .85;
  margin-bottom: 4px;
}
.cbh-value {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}
.cbh-sub { font-size: .9rem; opacity: .85; margin-top: 4px; }
.cbh-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.credits-balance-hero .cbh-btn,
.credits-balance-hero .cbh-btn-secondary {
  min-width: 180px;
  padding: 11px 20px;
  font-weight: 600;
  border-radius: 999px;
  text-align: center;
}
.credits-balance-hero .cbh-btn {
  background: #fff;
  color: var(--brand-blue);
  border: 0;
}
.credits-balance-hero .cbh-btn:hover {
  background: var(--bg-light);
  color: var(--brand-blue-hover);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,.15);
}
.credits-balance-hero .cbh-btn-secondary {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.4);
}
.credits-balance-hero .cbh-btn-secondary:hover {
  background: rgba(255,255,255,.25);
  color: #fff;
  text-decoration: none;
}

.credits-section-title {
  font-size: 1.4rem;
  margin: 28px 0 4px;
}
.credits-section-sub {
  margin-bottom: 20px;
  font-size: .92rem;
}

.credit-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.credit-plan-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 26px 22px 22px;
  text-align: center;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.credit-plan-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(33,102,142,.14);
  border-color: var(--brand-blue);
}
.credit-plan-card.is-popular {
  border: 2px solid var(--brand-blue);
  box-shadow: 0 10px 24px rgba(33,102,142,.16);
}
.cpc-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--brand-blue), #2A87B8);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 5px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(33,102,142,.3);
}
.cpc-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--heading-dark);
  margin-bottom: 8px;
}
.cpc-price-row { margin: 4px 0 10px; }
.cpc-price {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--brand-blue);
  line-height: 1;
  letter-spacing: -0.02em;
}
.cpc-credits-line {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin: 4px 0 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.cpc-credits-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--heading-dark);
}
.cpc-credits-lbl { color: var(--muted); font-size: .9rem; }
.cpc-bonus {
  background: var(--bg-soft);
  color: var(--brand-blue);
  font-size: .75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
}
.cpc-total {
  color: var(--body-text);
  font-size: .88rem;
  margin-bottom: 4px;
}
.cpc-per {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 14px;
}
.cpc-btn {
  width: 100%;
  padding: 11px 16px;
  font-weight: 600;
  border-radius: 10px;
}
.credit-plan-card .cpc-btn:not(.secondary) {
  background: linear-gradient(135deg, var(--brand-blue), #2A87B8);
  color: #fff;
  border: 0;
}
.credit-plan-card .cpc-btn:not(.secondary):hover {
  background: linear-gradient(135deg, var(--brand-blue-hover), #1E5A7E);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(33,102,142,.25);
}

@media (max-width: 540px) {
  .credits-balance-hero {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 22px 18px;
  }
  .cbh-right { flex-direction: column; }
  .credits-balance-hero .cbh-btn,
  .credits-balance-hero .cbh-btn-secondary { width: 100%; }
  .cbh-value { font-size: 2.4rem; }
  .credit-plans-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------
   4. Customer profile card
   --------------------------------------------------------------------- */
.customer-profile-card {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #fff 0%, var(--bg-light) 100%);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 4px 14px rgba(33,102,142,.08);
}
.cp-avatar-wrap { flex-shrink: 0; }
.cp-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(33,102,142,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  /* background-image (NOT the background: shorthand — the shorthand would
     reset background-size/position and un-center uploaded photos) */
  background-image: linear-gradient(135deg, var(--brand-blue), #2A87B8);
  background-color: #EAF2FB;
}
.cp-avatar.is-initial { background: linear-gradient(135deg, var(--brand-blue), #2A87B8); }
.cp-info { flex: 1 1 240px; min-width: 0; }
.cp-info h2 { margin: 0 0 8px; font-size: 1.5rem; }
.cp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cp-meta-pill {
  background: #fff;
  border: 1px solid var(--border-soft);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: .82rem;
  color: var(--body-text);
}
.cp-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
@media (max-width: 540px) {
  .customer-profile-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  .cp-meta { justify-content: center; }
  .cp-actions { width: 100%; }
  .cp-actions .btn { flex: 1; min-width: 120px; }
}

/* ---------------------------------------------------------------------
   5. Modern buttons
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: .92rem;
  font-weight: 600;
  font-family: inherit;
  background: linear-gradient(135deg, var(--brand-blue), #2A87B8);
  color: #fff;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s, box-shadow .15s, background .15s;
  box-shadow: 0 2px 6px rgba(33,102,142,.15);
  white-space: nowrap;
}
.btn:hover {
  background: linear-gradient(135deg, var(--brand-blue-hover), #1E5A7E);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(33,102,142,.25);
}
.btn:active { transform: translateY(0); }
.btn.secondary {
  background: #fff;
  color: var(--brand-blue);
  border: 1px solid var(--border-soft);
  box-shadow: 0 1px 3px rgba(33,102,142,.06);
}
.btn.secondary:hover {
  background: var(--bg-light);
  color: var(--brand-blue-hover);
  border-color: var(--brand-blue);
  box-shadow: 0 3px 8px rgba(33,102,142,.1);
}
.btn.danger {
  background: linear-gradient(135deg, var(--brand-red), #B92A2D);
  color: #fff;
  box-shadow: 0 2px 6px rgba(218,55,58,.2);
}
.btn.danger:hover {
  background: linear-gradient(135deg, var(--brand-red-hover), #8E1F22);
  color: #fff;
  box-shadow: 0 6px 14px rgba(218,55,58,.3);
}
.btn.success {
  background: linear-gradient(135deg, var(--success), #247448);
  color: #fff;
}
.btn.warning {
  background: linear-gradient(135deg, var(--warning), #B57D2A);
  color: #fff;
}

/* ---------------------------------------------------------------------
   6. Modern cards
   --------------------------------------------------------------------- */
.card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 2px 8px rgba(33,102,142,.05);
  transition: box-shadow .18s, transform .18s;
}
.card:hover { box-shadow: 0 6px 20px rgba(33,102,142,.1); }
.card h3 { margin: 0 0 14px; font-size: 1.1rem; }

/* ---------------------------------------------------------------------
   7. Modern tables
   --------------------------------------------------------------------- */
table.data {
  width: 100%;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(33,102,142,.06);
}
table.data thead {
  background: linear-gradient(135deg, var(--bg-light), var(--bg-soft));
}
table.data th {
  text-align: left;
  padding: 12px 14px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--heading-dark);
  border-bottom: 2px solid var(--border-soft);
}
table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f3f7;
  color: var(--body-text);
  vertical-align: top;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--bg-light); }

/* ---------------------------------------------------------------------
   8. Modern form elements
   --------------------------------------------------------------------- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: .95rem;
  color: var(--body-text);
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 10px 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none;
  appearance: none;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(33,102,142,.14);
  background: #fff;
}
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234B6470' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 38px;
}
.form-row label {
  display: block;
  font-weight: 600;
  color: var(--heading-dark);
  margin-bottom: 6px;
  font-size: .9rem;
}
.form-row .hint {
  font-size: .82rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ---------------------------------------------------------------------
   9. Dashboard cards (admin/provider/customer)
   --------------------------------------------------------------------- */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.dash-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--brand-blue);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(33,102,142,.05);
  transition: transform .15s, box-shadow .15s;
}
.dash-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(33,102,142,.12);
}
.dash-card.success { border-left-color: var(--success); }
.dash-card.warning { border-left-color: var(--warning); }
.dash-card.danger  { border-left-color: var(--error); }
.dash-card .label {
  font-size: .78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
  margin-bottom: 6px;
}
.dash-card .value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--heading-dark);
  line-height: 1.1;
}

/* ---------------------------------------------------------------------
   10. Sidebar styles (admin / provider / customer)
   --------------------------------------------------------------------- */
.admin-sidebar,
.dash-sidebar {
  background: linear-gradient(180deg, #173B4F 0%, #0F2A38 100%);
  color: #fff;
  padding: 18px 0;
  box-shadow: 2px 0 14px rgba(0,0,0,.1);
}
.admin-sidebar h3,
.dash-sidebar h3 {
  color: #fff;
  padding: 6px 22px 12px;
  font-size: 1rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0 0 4px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.admin-sidebar .group,
.dash-sidebar .group {
  padding: 14px 22px 4px;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.45);
  font-weight: 700;
}
.admin-sidebar a,
.dash-sidebar a {
  display: block;
  color: rgba(255,255,255,.78);
  padding: 9px 22px;
  text-decoration: none;
  font-size: .9rem;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.admin-sidebar a:hover,
.dash-sidebar a:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
  text-decoration: none;
  border-left-color: rgba(123,204,228,.4);
}
.admin-sidebar a.active,
.dash-sidebar a.active {
  background: rgba(33,102,142,.25);
  color: #fff;
  border-left-color: var(--sky-blue);
  font-weight: 600;
}

/* ---------------------------------------------------------------------
   11. Topbar (admin)
   --------------------------------------------------------------------- */
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 22px;
  background: #fff;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.admin-topbar h1 { margin: 0; font-size: 1.25rem; }

/* ---------------------------------------------------------------------
   12. Mobile menu toggle — modern look
   --------------------------------------------------------------------- */
.admin-menu-toggle,
.dash-menu-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10001;
  background: linear-gradient(135deg, var(--brand-blue), #2A87B8);
  color: #fff;
  border: 0;
  border-radius: 10px;
  width: 42px;
  height: 42px;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(33,102,142,.3);
  align-items: center;
  justify-content: center;
  transition: transform .15s, box-shadow .15s;
}
.admin-menu-toggle:hover,
.dash-menu-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(33,102,142,.4);
}

/* ---------------------------------------------------------------------
   13. Profile pages (provider)
   --------------------------------------------------------------------- */
.profile-cover-wrap {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15,23,42,.18);
  margin-bottom: 16px;
}
.profile-info-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}
@media (max-width: 992px) {
  .profile-info-grid { grid-template-columns: 1fr; }
}
.profile-side-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(33,102,142,.05);
  margin-bottom: 14px;
}
.profile-side-card h3 { margin: 0 0 12px; font-size: 1rem; }
.stat-line {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #f0f3f7;
  font-size: .9rem;
}
.stat-line:last-child { border-bottom: 0; }
.stat-line .lbl { color: var(--muted); }
.stat-line .val { color: var(--heading-dark); font-weight: 600; text-align: right; }

/* ---------------------------------------------------------------------
   14. Form sections (provider profile edit)
   --------------------------------------------------------------------- */
.form-section {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(33,102,142,.04);
}
.form-section h3 {
  margin: 0 0 16px;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.fs-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--brand-blue), #2A87B8);
  color: #fff;
  border-radius: 50%;
  font-size: .82rem;
  font-weight: 800;
  flex-shrink: 0;
}
.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 0;
}

/* ---------------------------------------------------------------------
   15. Gallery grid (edit + public)
   --------------------------------------------------------------------- */
.gallery-grid-edit {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.gallery-thumb-wrap {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 6px rgba(33,102,142,.05);
}
.gallery-thumb {
  position: relative;
  width: 100%;
  height: 140px;
  background-size: cover;
  background-position: center;
}
.gallery-thumb .remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(218,55,58,.92);
  color: #fff;
  border: 0;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: background .15s, transform .15s;
}
.gallery-thumb .remove-btn:hover {
  background: var(--brand-red-hover);
  transform: scale(1.08);
}
.gallery-thumb-kw {
  padding: 8px 10px;
  font-size: .78rem;
  color: var(--body-text);
  background: var(--bg-light);
}

.gallery-public-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.gallery-public-item {
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border-soft);
  box-shadow: 0 2px 8px rgba(33,102,142,.05);
  transition: transform .15s, box-shadow .15s;
}
.gallery-public-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(33,102,142,.14);
}
.gallery-public-image {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-light);
}
.gallery-public-kw {
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ---------------------------------------------------------------------
   16. Image preview tiles (cover/avatar upload)
   --------------------------------------------------------------------- */
.image-preview-tile {
  width: 100%;
  height: 140px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-light);
  border: 2px dashed var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: .88rem;
  margin-bottom: 8px;
}
.image-preview-tile.cover { height: 100px; }
.image-preview-tile.empty { background-color: var(--bg-light); }

/* ---------------------------------------------------------------------
   17. Flash messages — modern look
   --------------------------------------------------------------------- */
.flash-msg,
.alert-info,
.alert-warning,
.alert-danger {
  border-radius: 12px !important;
  padding: 12px 16px !important;
  margin-bottom: 12px;
  border-left: 4px solid var(--brand-blue) !important;
  background: var(--bg-light) !important;
  box-shadow: 0 2px 8px rgba(33,102,142,.06);
}
.alert-warning { border-left-color: var(--warning) !important; background: #FFF8E8 !important; }
.alert-danger  { border-left-color: var(--error) !important;   background: #FDECEC !important; }

/* ---------------------------------------------------------------------
   18. Provider card (search results / lists)
   --------------------------------------------------------------------- */
.provider-card,
.search-results .card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(33,102,142,.05);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.provider-card:hover,
.search-results .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(33,102,142,.14);
  border-color: var(--brand-blue);
}

/* ---------------------------------------------------------------------
   19. Responsive grid tweaks
   --------------------------------------------------------------------- */
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 992px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------
   20. Print cleanup
   --------------------------------------------------------------------- */
@media print {
  .admin-menu-toggle,
  .dash-menu-toggle,
  .admin-sidebar-backdrop,
  .dash-sidebar-backdrop,
  .header-search-toggle,
  .nav-toggle { display: none !important; }
}

/* ---------------------------------------------------------------------
   21. Empty state polish
   --------------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--border-soft);
  border-radius: 14px;
}
.empty-state .icon { font-size: 2.6rem; margin-bottom: 12px; }
.empty-state h3 { color: var(--heading-dark); margin: 0 0 8px; }

/* ---------------------------------------------------------------------
   22. Tag cloud
   --------------------------------------------------------------------- */
.profile-keyword-cloud,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  background: var(--bg-light);
  color: var(--brand-blue);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 500;
  border: 1px solid var(--border-soft);
  transition: background .15s, color .15s;
}
.tag:hover { background: var(--brand-blue); color: #fff; }
.tag.sm { font-size: .72rem; padding: 3px 8px; }

/* ---------------------------------------------------------------------
   23. Provider cover (own profile view)
   --------------------------------------------------------------------- */
.profile-cover-wrap { position: relative; min-height: 220px; display: flex; align-items: flex-end; }
.profile-cover-inner {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  padding: 22px;
  width: 100%;
  flex-wrap: wrap;
  background: linear-gradient(180deg, transparent 0%, rgba(15,23,42,.6) 100%);
}
.pc-avatar-large {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: var(--brand-blue);
  border: 4px solid #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.2rem;
  font-weight: 800;
  flex-shrink: 0;
}
.pc-avatar-large.is-initial {
  background: linear-gradient(135deg, var(--brand-blue), #2A87B8);
}
.pc-info-block { flex: 1 1 240px; min-width: 0; color: #fff; }
.pc-info-block h2 { color: #fff; margin: 0 0 6px; font-size: 1.6rem; }
.pc-meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.pc-meta-pill {
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .82rem;
  border: 1px solid rgba(255,255,255,.25);
}
.pc-status { font-size: .85rem; color: rgba(255,255,255,.85); }
.pc-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: #fff;
}
.pc-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,.12);
  padding: 8px 16px;
  border-radius: 10px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  min-width: 70px;
}
.pc-stat .num { font-size: 1.4rem; font-weight: 800; line-height: 1; }
.pc-stat .lbl { font-size: .72rem; opacity: .85; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }

.profile-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .profile-cover-wrap { min-height: 260px; }
  .profile-cover-inner { flex-direction: column; align-items: flex-start; padding: 18px; }
  .pc-avatar-large { width: 72px; height: 72px; font-size: 1.6rem; }
  .pc-info-block h2 { font-size: 1.3rem; }
  .pc-stats { width: 100%; justify-content: space-between; }
}

/* ---------------------------------------------------------------------
   24. Maintenance toggle button
   --------------------------------------------------------------------- */
.maint-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: #fff;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, border-color .15s;
}
.maint-toggle-btn:hover { background: var(--bg-light); }
.maint-toggle-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.maint-toggle-btn.maintenance-on .maint-toggle-dot {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(230,162,60,.18);
  animation: pulse-dot 1.6s ease-in-out infinite;
}
.maint-toggle-btn.maintenance-off .maint-toggle-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(46,139,87,.18);
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.18); opacity: .75; }
}

/* ---------------------------------------------------------------------
   25. Mobile sidebar polish — when open, lock body scroll
   --------------------------------------------------------------------- */
body.sidebar-open { overflow: hidden; }
@media (max-width: 992px) {
  .admin-sidebar,
  .dash-sidebar {
    width: 280px;
    max-width: 85vw;
  }
}

/* ---------------------------------------------------------------------
   26. Misc small touches
   --------------------------------------------------------------------- */
h1 { font-size: 1.8rem; margin: 0 0 12px; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
@media (max-width: 540px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.2rem; }
  h3 { font-size: 1rem; }
}

/* Containers never cause horizontal scroll */
.container { max-width: var(--container-max); width: 100%; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }
@media (max-width: 540px) {
  .container { padding: 0 14px; }
  .dash-main, .admin-main { padding: 14px !important; padding-top: 60px !important; }
  .form-section { padding: 16px; }
  .card { padding: 16px; }
}

/* Search results page hero */
@media (max-width: 768px) {
  .search-results { gap: 10px; }
}

/* Hero search (homepage) — kept as grid (defined earlier); only add shadow here */
.hero-search {
  box-shadow: 0 8px 24px rgba(33,102,142,.14);
}

/* Auth forms */
.auth-wrap {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 8px 30px rgba(33,102,142,.1);
  max-width: 460px;
  margin: 20px auto;
}
@media (max-width: 540px) {
  .auth-wrap { padding: 20px 16px; margin: 10px auto; }
}

/* Footer polish */
.site-footer {
  background: linear-gradient(180deg, #0F2A38 0%, #0A1F29 100%);
  color: rgba(255,255,255,.78);
  padding: 36px 0 18px;
  margin-top: 40px;
}
.site-footer h4 { color: #fff; margin: 0 0 10px; font-size: .95rem; }
.site-footer a { color: rgba(255,255,255,.72); }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 24px;
}
.footer-brand-col p { color: rgba(255,255,255,.65); font-size: .9rem; margin: 4px 0; }
.footer-logo-img { height: 48px; width: auto; max-width: 200px; margin-bottom: 10px; }
.footer-bottom {
  /* ROUND 33 — full-width white separator above the ©/wordmark line replaces
     the r32 border-top:0 — the line runs edge-to-edge because .footer-bottom
     sits outside the .container (an inner .container keeps the text aligned). */
  border-top: 1px solid #FFFFFF;
  padding-top: 14px;
  font-size: .82rem;
  color: rgba(255,255,255,.55);
  text-align: center;
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 18px; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 14px;
  padding: 6px 0;
}
.breadcrumbs a { color: var(--brand-blue); }
.breadcrumbs span { color: var(--body-text); }

/* Section dividers */
.section { padding: 36px 0; }
.section-title { font-size: 1.6rem; margin-bottom: 6px; }

/* Ensure all <a> inside buttons stay inline */
.btn a, .btn a:hover { color: inherit; text-decoration: none; }

/* Star ratings */
.rating-stars { color: #F5A623; font-size: 1.1rem; letter-spacing: 1px; }
.rating-stars .star.filled { color: #F5A623; }
.rating-stars .star { color: #D5DCE3; }

/* Reviews summary */
.reviews-summary-overview {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}
.reviews-avg-block {
  text-align: center;
  border-right: 1px solid var(--border-soft);
  padding-right: 18px;
}
.reviews-avg-block .avg {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--heading-dark);
  line-height: 1;
}
@media (max-width: 768px) {
  .reviews-summary-overview { grid-template-columns: 1fr; }
  .reviews-avg-block { border-right: 0; border-bottom: 1px solid var(--border-soft); padding-bottom: 14px; padding-right: 0; }
}

/* Mobile contact bar */
.mobile-contact-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: none;
  background: #fff;
  border-top: 1px solid var(--border-soft);
  padding: 8px 12px;
  box-shadow: 0 -4px 14px rgba(0,0,0,.08);
  z-index: 30;
  gap: 8px;
}
@media (max-width: 768px) {
  .mobile-contact-bar { display: flex; }
  /* ROUND 32 — only pad the body when the fixed contact bar actually exists
     (provider profile). On every other page the old unconditional 60px body
     padding left a blank strip UNDER the footer — the footer must touch the
     bottom edge of the phone screen. */
  body:has(.mobile-contact-bar) { padding-bottom: 60px; }
}
.mobile-contact-bar .btn { flex: 1; }

/* End of modern UI overhaul */


/* ---------------------------------------------------------------------
   27. Customer quick-action cards
   --------------------------------------------------------------------- */
.customer-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.cqa-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  box-shadow: 0 2px 8px rgba(33,102,142,.05);
}
.cqa-card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(33,102,142,.14);
  border-color: var(--brand-blue);
  color: inherit;
}
.cqa-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,.1);
}
.cqa-text { display: flex; flex-direction: column; min-width: 0; }
.cqa-text strong { color: var(--heading-dark); font-size: .98rem; margin-bottom: 2px; }
.cqa-text span { color: var(--muted); font-size: .82rem; }

/* ---------------------------------------------------------------------
   28. Provider panel — campaign cards
   --------------------------------------------------------------------- */
.campaign-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(33,102,142,.05);
  transition: box-shadow .15s, transform .15s;
  flex-wrap: wrap;
}
.campaign-card:hover { box-shadow: 0 6px 18px rgba(33,102,142,.12); transform: translateY(-1px); }
.campaign-card .cc-info { flex: 1 1 240px; min-width: 0; }
.campaign-card .cc-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* ---------------------------------------------------------------------
   29. Provider advertising wrap
   --------------------------------------------------------------------- */
.run-ad-wrap {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  overflow: hidden;
  margin: 14px 0;
  box-shadow: 0 4px 14px rgba(33,102,142,.06);
  max-width: 900px;
}
.run-ad-header {
  background: linear-gradient(135deg, var(--brand-blue), #2A87B8);
  color: #fff;
  padding: 22px 26px;
}
.run-ad-header h1 { color: #fff; margin: 0 0 4px; }
.run-ad-header p { margin: 0; opacity: .9; font-size: .9rem; }

/* ---------------------------------------------------------------------
   30. Admin dashboard polish
   --------------------------------------------------------------------- */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.admin-main {
  padding: 22px 26px;
  background: var(--bg-light);
  min-width: 0;
  overflow-x: hidden;
}
@media (max-width: 992px) {
  .admin-layout { grid-template-columns: 1fr; }
}

.dash-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.dash-main {
  padding: 22px 26px;
  background: var(--bg-light);
  min-width: 0;
  overflow-x: hidden;
}
@media (max-width: 992px) {
  .dash-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .admin-main, .dash-main { padding: 14px 14px 14px 14px !important; padding-top: 64px !important; }
}

/* ---------------------------------------------------------------------
   31. Hero search polish (homepage)
   --------------------------------------------------------------------- */
.hero-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--body-text);
  min-width: 0;
}
.hero-search input::placeholder { color: var(--muted); }
.hero-search button {
  background: linear-gradient(135deg, var(--brand-blue), #2A87B8);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
  white-space: nowrap;
}
.hero-search button:hover { background: linear-gradient(135deg, var(--brand-blue-hover), #1E5A7E); }

/* ---------------------------------------------------------------------
   32. Section / hero spacing on mobile
   --------------------------------------------------------------------- */
@media (max-width: 540px) {
  .section { padding: 24px 0 !important; }
  .section-title { font-size: 1.3rem !important; }
  .hero-healthcare { padding: 28px 0 !important; }
  .services-hero { padding: 32px 0 36px !important; }
}

/* End of modern UI overhaul part 2 */

/* =====================================================================
   MODERN UI OVERHAUL — Part 3 (search/phone fixes)
   ===================================================================== */

/* ---------------------------------------------------------------------
   33. Sidebar close (×) button — phone only, sits top-right of sidebar
   --------------------------------------------------------------------- */
.sidebar-close-btn {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
  transition: background .15s, transform .15s;
}
.sidebar-close-btn:hover {
  background: rgba(255,255,255,.25);
  transform: rotate(90deg);
}
@media (max-width: 992px) {
  .sidebar-close-btn { display: inline-flex; }
  /* Pad the top of the sidebar content so the close button doesn't overlap the title */
  .admin-sidebar, .dash-sidebar { padding-top: 56px; }
  .admin-sidebar > h3, .dash-sidebar > h3 { margin-top: 8px; }
}

/* ---------------------------------------------------------------------
   34. Search page — 3 cards per row like home page
   --------------------------------------------------------------------- */
.search-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 18px;
}
@media (max-width: 992px) {
  .search-results { grid-template-columns: repeat(2, 1fr) !important; gap: 14px; }
}
@media (max-width: 540px) {
  .search-results { grid-template-columns: 1fr !important; gap: 12px; }
}

/* Ensure each card is the same height — title + meta lines clamp cleanly */
.search-results .provider-card {
  display: flex;
  flex-direction: column;
}
.search-results .provider-card .pc-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.search-results .provider-card .card-cta {
  margin-top: auto;
  padding-top: 8px;
}

/* ---------------------------------------------------------------------
   35. Header — show site wordmark on phone (un-hide)
   --------------------------------------------------------------------- */
@media (max-width: 480px) {
  .site-logo-text {
    display: inline-flex !important;
    flex-direction: column;
    line-height: 1;
  }
  .site-logo-text .brand-wm.header {
    font-size: .82rem !important;
  }
  .site-logo-img { height: 32px; }
  .site-header .container.header-row {
    padding: 6px 12px;
    gap: 8px;
  }
  /* Shrink wordmark a bit on very tiny phones (<360px) but keep visible */
  @media (max-width: 360px) {
    .site-logo-text .brand-wm.header { font-size: .72rem !important; }
  }
}

/* ---------------------------------------------------------------------
   36. Header search bar — centered alignment
   --------------------------------------------------------------------- */
.site-header .container.header-row {
  justify-content: flex-start;
}
.header-search-bar {
  margin-left: auto;
  margin-right: auto;
  flex: 1 1 320px;
}
/* When no nav-toggle / search-toggle is needed (desktop), keep search
   centered between logo and nav */
@media (min-width: 993px) {
  .header-search-bar {
    margin-left: auto;
    margin-right: 0;
  }
  .site-nav { margin-left: auto; }
}

/* ---------------------------------------------------------------------
   37. Admin tables — never wrap rows; horizontal scroll if too wide
   --------------------------------------------------------------------- */
table.data {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}
table.data thead, table.data tbody {
  display: table;
  width: 100%;
  table-layout: auto;
}
table.data thead { width: max-content; min-width: 100%; }
table.data tbody { width: max-content; min-width: 100%; }
table.data tr { display: table-row; }
table.data th, table.data td {
  display: table-cell;
  white-space: nowrap;
  padding: 12px 16px;
}
/* Allow description / long-text cells to wrap if they have a .wrap class */
table.data td.wrap, table.data th.wrap {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* A prettier horizontal scrollbar for tables */
table.data::-webkit-scrollbar { height: 8px; }
table.data::-webkit-scrollbar-track { background: var(--bg-light); border-radius: 4px; }
table.data::-webkit-scrollbar-thumb { background: var(--border-soft); border-radius: 4px; }
table.data::-webkit-scrollbar-thumb:hover { background: var(--muted-text); }

/* ---------------------------------------------------------------------
   38. Admin topbar — keep on one row, allow wrap on tiny phones
   --------------------------------------------------------------------- */
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
@media (max-width: 768px) {
  .admin-topbar {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 10px 14px;
  }
  .admin-topbar h1 { font-size: 1.05rem; }
}

/* ---------------------------------------------------------------------
   39. Admin form-grid — never let a single input wrap to 2nd row
   --------------------------------------------------------------------- */
.grid.cols-2, .grid.cols-3, .grid.cols-4 {
  display: grid;
  gap: 14px;
}
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 992px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------
   40. Admin cards layout — never wrap individual cards awkwardly
   --------------------------------------------------------------------- */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
@media (max-width: 540px) {
  .dash-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (max-width: 380px) {
  .dash-cards { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------
   41. Admin action-bar — keep buttons on one row, scroll if needed
   --------------------------------------------------------------------- */
.form-actions, .action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ---------------------------------------------------------------------
   42. Phone — topbar sits below the mobile menu toggle
   --------------------------------------------------------------------- */
@media (max-width: 992px) {
  .admin-main, .dash-main {
    padding-top: 64px !important;
  }
}

/* ---------------------------------------------------------------------
   43. Phone — make all panel sidebars full-height with close button
   --------------------------------------------------------------------- */
@media (max-width: 992px) {
  .admin-sidebar, .dash-sidebar {
    height: 100vh !important;
    max-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ---------------------------------------------------------------------
   44. Phone — keep header text + search toggle + nav toggle all visible
   --------------------------------------------------------------------- */
@media (max-width: 768px) {
  .site-header .container.header-row {
    flex-wrap: nowrap;
    overflow: visible;
  }
  .site-logo {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 60%;
    overflow: hidden;
  }
  .site-logo-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ---------------------------------------------------------------------
   45. Reduce mobile sidebar width on very narrow phones
   --------------------------------------------------------------------- */
@media (max-width: 480px) {
  .admin-sidebar, .dash-sidebar {
    width: 85vw !important;
    max-width: 320px;
  }
}

/* End of modern UI overhaul part 3 */

/* =====================================================================
   MODERN UI OVERHAUL — Part 4 (secondary header, footer, hero border)
   ===================================================================== */

/* ---------------------------------------------------------------------
   46. Hide the OLD floating 3-dot toggle button everywhere
   --------------------------------------------------------------------- */
.admin-menu-toggle,
.dash-menu-toggle {
  display: none !important;
}

/* ---------------------------------------------------------------------
   47. Secondary panel header — replaces the floating 3-dot button.
       Sits at the top of admin-main / dash-main, contains:
         [More Options button]  [Page Title]  [Actions]
   The More Options button opens the sidebar (same JS handler).
   --------------------------------------------------------------------- */
/* PC: hide the secondary header + More Options button entirely.
   The sidebar is always visible on PC (grid layout), so they're redundant. */
.panel-secondary-header { display: none; }
.panel-more-btn { display: none; }

/* Phone/tablet (<=992px): show the secondary header + More Options button. */
@media (max-width: 992px) {
  .panel-secondary-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    background: #fff;
    border-bottom: 1px solid var(--border-soft);
    box-shadow: 0 2px 6px rgba(33,102,142,.04);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: wrap;
  }
  .panel-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--brand-blue), #2A87B8);
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-size: .88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform .12s, box-shadow .15s, background .15s;
    box-shadow: 0 2px 6px rgba(33,102,142,.2);
    white-space: nowrap;
    flex-shrink: 0;
  }
  .panel-more-btn:hover {
    background: linear-gradient(135deg, var(--brand-blue-hover), #1E5A7E);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33,102,142,.3);
  }
  .panel-more-btn .pmb-icon {
    font-size: 1.1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
  }
  .panel-more-btn .pmb-label {
    font-size: .88rem;
  }
  .psh-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--heading-dark);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .psh-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
  }
  .psh-user {
    font-size: .82rem;
    color: var(--muted);
    white-space: nowrap;
  }
}

/* The actual page content sits below the secondary header */
.admin-content,
.dash-content {
  padding: 22px 26px;
}
@media (max-width: 768px) {
  .admin-content, .dash-content { padding: 14px; }
}

/* On phone, the More Options button is compact (icon only) */
@media (max-width: 540px) {
  .panel-secondary-header {
    padding: 10px 12px;
    gap: 10px;
  }
  .panel-more-btn {
    padding: 7px 11px;
    font-size: .82rem;
  }
  .panel-more-btn .pmb-label { display: none; }
  .panel-more-btn .pmb-icon { font-size: 1.2rem; }
  .psh-title { font-size: 1rem; }
  .psh-user { display: none; }
}

/* Keep the panel-main scrollable area below the sticky secondary header */
.admin-main, .dash-main {
  padding: 0 !important;
  background: var(--bg-light);
}

/* The OLD .admin-topbar is hidden on phone (secondary header takes over),
   but shown on PC as a simple page-title + actions bar. */
@media (max-width: 992px) {
  .admin-topbar { display: none !important; }
}
@media (min-width: 993px) {
  .admin-topbar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 26px;
    background: #fff;
    border-bottom: 1px solid var(--border-soft);
    flex-wrap: wrap;
  }
  .admin-topbar h1 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--heading-dark);
  }
}

/* ---------------------------------------------------------------------
   48. Sticky footer — page always fills viewport, footer sits at bottom
   ---------------------------------------------------------------------
   NOTE: do NOT set height:100% on <html>. Combined with the
   viewport-level overflow-x clip at the top of this file it turns
   <html> into a fixed-height scroll container, which silently breaks
   position:sticky for the site header (the header scrolled away with
   the page instead of staying pinned). The sticky footer only needs
   the body min-height below. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.site-header { flex-shrink: 0; }
main {
  flex: 1 0 auto;
  width: 100%;
}
.site-footer {
  flex-shrink: 0;
  margin-top: 0;
}

/* For panel pages (admin/provider/customer) the layout uses .admin-layout
   and .dash-layout which set their own min-height: 100vh. We need to ensure
   the footer still sits BELOW them, not inside. */
.admin-layout, .dash-layout {
  min-height: auto;
}
.admin-main, .dash-main {
  min-height: auto;
}

/* ---------------------------------------------------------------------
   49. Hero search — gray border on /search page and home hero
   --------------------------------------------------------------------- */
.hero-search {
  display: grid !important;
  grid-template-columns: 2fr 2fr 1fr !important;
  gap: 10px !important;
  border: 2px solid #B8C4CC !important;
  background: #fff !important;
  padding: 10px !important;
  border-radius: 14px !important;
  box-shadow: 0 2px 8px rgba(33,102,142,.06) !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.hero-search:focus-within {
  border-color: var(--brand-blue) !important;
  box-shadow: 0 0 0 3px rgba(33,102,142,.14), 0 2px 8px rgba(33,102,142,.08) !important;
}
.hero-search input,
.hero-search button {
  box-sizing: border-box !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

/* On the /search page (inside .section .container) wrap the form
   nicely with a label so it's clear what the 2 inputs do */
.section .hero-search {
  margin-top: 12px;
  margin-bottom: 14px;
  max-width: 100%;
}

/* On phone / tablet, the grid collapses to a single column so the 2
   inputs + button stack vertically — no horizontal overflow. */
@media (max-width: 768px) {
  .hero-search {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 10px !important;
    border-radius: 14px !important;
  }
  .hero-search input {
    width: 100% !important;
    padding: 12px 14px !important;
    font-size: 16px !important; /* prevents iOS auto-zoom */
    border: 1px solid #E1E8EE !important;
    border-radius: 10px !important;
    background: #fff !important;
  }
  .hero-search input:focus {
    border-color: var(--brand-blue) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(33,102,142,.14) !important;
  }
  .hero-search button {
    width: 100% !important;
    padding: 13px 18px !important;
    font-size: 1rem !important;
    border-radius: 10px !important;
  }
}

/* Home hero — keep the existing unsplash background but ensure the
   search box has the gray border regardless of context */
.hero-healthcare .hero-search {
  background: #fff !important;
}

/* ---------------------------------------------------------------------
   50. Search page — clean section heading
   --------------------------------------------------------------------- */
.section > .container > h1 {
  margin-bottom: 6px;
  font-size: 1.8rem;
}

/* ---------------------------------------------------------------------
   51. Panel pages — ensure the page can scroll naturally with sticky
       secondary header at top
   --------------------------------------------------------------------- */
.admin-main, .dash-main {
  overflow: visible;
}

/* The sidebar z-index must stay above the sticky secondary header */
@media (max-width: 992px) {
  .admin-sidebar, .dash-sidebar { z-index: 10002 !important; }
  .admin-sidebar-backdrop, .dash-sidebar-backdrop { z-index: 10001 !important; }
  .panel-secondary-header { z-index: 50; }
}

/* ---------------------------------------------------------------------
   52. Footer — slightly tighter on phone
   --------------------------------------------------------------------- */
@media (max-width: 540px) {
  .site-footer { padding: 28px 0 14px; }
  .footer-grid { gap: 18px; }
  .footer-brand-col p { font-size: .85rem; }
  .footer-bottom { font-size: .75rem; padding-top: 12px; }
}

/* End of modern UI overhaul part 4 */

/* =====================================================================
   MODERN UI OVERHAUL — Part 5 (phone avatar center, overlay, admin dash)
   ===================================================================== */

/* ---------------------------------------------------------------------
   53. Phone — center provider PROFILE PAGE cover avatar + fix verify tick
       (this is the public provider profile page, NOT search result cards)
   --------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Stack the cover grid vertically: avatar on top (centered), info below */
  .provider-cover-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    justify-items: center !important;       /* center the avatar column */
    text-align: center !important;
  }
  /* Center the avatar wrap (contains avatar + verify tick) */
  .provider-avatar-wrap {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: relative !important;
    width: auto !important;
  }
  /* Slightly smaller avatar on phone so it fits nicely centered */
  .provider-avatar {
    width: 96px !important;
    height: 96px !important;
    font-size: 2rem !important;
  }
  /* Verify tick — sit at the bottom-right of the avatar, properly anchored */
  .verify-tick {
    position: absolute !important;
    bottom: 4px !important;
    right: 4px !important;
    width: 28px !important;
    height: 28px !important;
    font-size: .82rem !important;
    border-width: 2px !important;
  }
  /* Center the info block (name, service title, meta, actions) */
  .provider-cover-info {
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
  }
  .provider-cover-name {
    justify-content: center !important;
    font-size: 1.4rem !important;
  }
  .provider-cover-meta {
    justify-content: center !important;
  }
  .provider-cover-actions {
    justify-content: center !important;
  }
  /* The overlay itself — center its flex contents */
  .provider-cover-overlay {
    align-items: flex-end !important;   /* keep content at bottom of cover */
  }
  .provider-cover-inner {
    text-align: center !important;
  }
  .cover-crumbs {
    justify-content: center !important;
    text-align: center !important;
  }
}

/* On very small phones, make the avatar a bit smaller still */
@media (max-width: 480px) {
  .provider-avatar {
    width: 84px !important;
    height: 84px !important;
    font-size: 1.8rem !important;
  }
  .verify-tick {
    width: 24px !important;
    height: 24px !important;
    font-size: .72rem !important;
    bottom: 2px !important;
    right: 2px !important;
  }
  .provider-cover-name { font-size: 1.2rem !important; }
}

/* ---------------------------------------------------------------------
   54. Phone — fix header-search-overlay going out of screen
   --------------------------------------------------------------------- */
@media (max-width: 768px) {
  .header-search-overlay {
    position: fixed !important;        /* fixed to viewport, not header */
    top: var(--header-h, 64px) !important;  /* just below the header */
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: none !important;
    transform: none !important;        /* kill the translateX(-50%) */
    border-radius: 14px !important;
    padding: 8px 10px !important;
    box-sizing: border-box !important;
  }
  .header-search-overlay input {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 16px !important;        /* prevents iOS auto-zoom */
    padding: 10px 8px !important;
  }
  .header-search-overlay button {
    flex-shrink: 0 !important;
    padding: 9px 14px !important;
    font-size: .85rem !important;
  }
}
@media (max-width: 480px) {
  .header-search-overlay {
    left: 6px !important;
    right: 6px !important;
    padding: 6px 8px !important;
  }
}

/* ---------------------------------------------------------------------
   55. Admin sidebar — add Dashboard link at the very top
   --------------------------------------------------------------------- */
/* (markup change in admin/index.php — no CSS needed, the existing
   .admin-sidebar a styles cover it) */

/* ---------------------------------------------------------------------
   56. PC — make hero-search input borders clearly visible (ash color)
   --------------------------------------------------------------------- */
.hero-search input {
  border: 1px solid #B8C4CC !important;   /* ash gray, visible on white */
  background: #fff !important;
}
.hero-search input:focus {
  border-color: var(--brand-blue) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(33,102,142,.14) !important;
}
.hero-search button {
  border: 0 !important;
}

/* End of modern UI overhaul part 5 */

/* =====================================================================
   MODERN UI OVERHAUL — Part 6 (reviews carousel)
   ===================================================================== */

/* ---------------------------------------------------------------------
   Reviews carousel — horizontal sliding, one review per view.
   Works on PC, tablet, and phone. Swipe + prev/next buttons + dots.
   --------------------------------------------------------------------- */
.reviews-carousel {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 8px;
}

/* Navigation buttons (prev / next) */
.reviews-nav-btn {
  flex: 0 0 44px;
  background: #fff;
  border: 1px solid var(--border-soft, #DCECF2);
  border-radius: 50%;
  color: var(--brand-blue, #21668E);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, border-color .15s, transform .12s;
  box-shadow: 0 2px 6px rgba(33,102,142,.08);
  align-self: center;
  padding: 0;
  height: 44px;
  width: 44px;
}
.reviews-nav-btn:hover:not(:disabled) {
  background: var(--brand-blue, #21668E);
  color: #fff;
  border-color: var(--brand-blue, #21668E);
  transform: scale(1.06);
}
.reviews-nav-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

/* Viewport — clips the sliding track to one review at a time */
.reviews-viewport {
  flex: 1 1 auto;
  overflow: hidden;
  border-radius: 14px;
  min-width: 0;
}

/* Track — holds all review slides horizontally, slides via transform */
.reviews-track {
  display: flex;
  transition: transform .35s ease;
  height: 100%;
}

/* Each slide — one review, takes full viewport width */
.review-slide {
  flex: 0 0 100%;
  min-width: 0;
  padding: 0 4px;
  box-sizing: border-box;
}

/* The review card itself */
.review-item {
  height: 100%;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #eef2f6;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(33,102,142,.06);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.review-item .review-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.review-item .review-author {
  font-weight: 700;
  color: var(--heading-dark, #173B4F);
  font-size: 1rem;
}
.review-item .review-stars {
  display: inline-flex;
  gap: 1px;
}
.review-item .review-date {
  margin-left: auto;
  font-size: .8rem;
  color: var(--muted, #888);
  white-space: nowrap;
}
.review-item .review-title {
  display: block;
  margin: 4px 0 8px;
  font-size: 1.02rem;
  color: var(--heading-dark, #173B4F);
}
.review-item .review-body {
  margin: 6px 0 0;
  color: var(--body-text, #4B6470);
  line-height: 1.6;
  font-size: .92rem;
  flex: 1;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Carousel meta — dots + counter, below the carousel */
.reviews-carousel-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.reviews-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.review-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  background: #D5DCE3;
  cursor: pointer;
  padding: 0;
  transition: background .15s, transform .15s, width .15s;
}
.review-dot:hover { background: var(--brand-blue, #21668E); transform: scale(1.2); }
.review-dot.active {
  background: var(--brand-blue, #21668E);
  width: 24px;
  border-radius: 999px;
}
.reviews-counter {
  font-size: .82rem;
  color: var(--muted, #888);
  font-weight: 600;
  white-space: nowrap;
}
.reviews-counter #reviewCurrent {
  color: var(--brand-blue, #21668E);
  font-weight: 700;
}

/* Old .reviews-list (vertical) — neutralize in case it's still referenced */
.reviews-list { display: none; }

/* Provider panel — vertical reviews list (provider/reviews page).
   Uses its own class because legacy .reviews-list is hidden above. */
.provider-reviews-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Review body clamp — long review bodies (legacy 2000-char reviews) are
   clamped to a fixed height with a fade-out gradient and a "Read more"
   button, so every review card fits the profile page layout. */
.review-body.review-body-clamp {
  position: relative;
  max-height: 132px;
  overflow: hidden;
}
.review-body.review-body-clamp.clamped::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44px;
  background: linear-gradient(rgba(255,255,255,0), #ffffff 82%);
  pointer-events: none;
}
.review-body.review-body-clamp.expanded {
  max-height: none;
  overflow: visible;
}
.review-body.review-body-clamp.expanded::after { display: none; }

/* "Read more / Show less" toggle button under a clamped review */
.review-read-more {
  align-self: flex-start;
  margin-top: 6px;
  background: none;
  border: none;
  padding: 2px 0;
  color: var(--brand-blue, #21668E);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 4px;
  text-decoration: none;
}
.review-read-more:hover { text-decoration: underline; }

/* Summary bar — responsive tweaks */
.reviews-summary-bar {
  flex-wrap: wrap;
  gap: 10px;
}
.reviews-summary-count {
  margin-left: auto;
  font-size: .85rem;
}

/* ---------------------------------------------------------------------
   Phone responsive — carousel tweaks
   --------------------------------------------------------------------- */
@media (max-width: 768px) {
  .reviews-carousel {
    gap: 6px;
  }
  .reviews-nav-btn {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    font-size: 1.5rem;
  }
  .review-item {
    padding: 14px 16px;
  }
  .review-item .review-header {
    gap: 8px;
  }
  .review-item .review-author {
    font-size: .92rem;
  }
  .review-item .review-date {
    font-size: .72rem;
  }
  .review-item .review-body {
    font-size: .88rem;
  }
  .reviews-summary-bar {
    padding: 10px 12px;
    font-size: .9rem;
  }
  .reviews-summary-count {
    width: 100%;
    text-align: center;
    margin-left: 0;
  }
}

@media (max-width: 540px) {
  .reviews-carousel {
    /* On very small phones, the nav buttons sit outside the viewport */
    gap: 4px;
  }
  .reviews-nav-btn {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    font-size: 1.3rem;
  }
  .review-item {
    padding: 12px 14px;
    border-radius: 12px;
  }
  .review-item .review-header {
    /* Stack: author+stars on top, date below */
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .review-item .review-date {
    margin-left: 0;
  }
  .reviews-carousel-meta {
    gap: 10px;
    margin-top: 10px;
  }
  .review-dot {
    width: 7px;
    height: 7px;
  }
  .review-dot.active { width: 20px; }
}

/* On very tiny phones (<=360px), keep buttons but shrink slightly */
@media (max-width: 360px) {
  .reviews-nav-btn {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
  }
  .review-item {
    padding: 10px 12px;
  }
}

/* End of modern UI overhaul part 6 */

/* =====================================================================
   MODERN UI OVERHAUL — Part 7 (admin provider view + campaign create fix)
   ===================================================================== */

/* ---------------------------------------------------------------------
   57. Admin provider view — gallery keyword display + responsive hero
   --------------------------------------------------------------------- */
.admin-gallery-grid .agt {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm, 10px);
  overflow: hidden;
  border: 1px solid var(--border, #DCECF2);
  background: var(--light-blue, #F1FAFD);
}
.admin-gallery-grid .agt img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.admin-gallery-grid .agt-kw {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  background: linear-gradient(180deg, transparent, rgba(15,23,42,.75));
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  max-height: 50%;
  overflow: hidden;
}
.admin-gallery-grid .agt-kw .tag.sm {
  font-size: .68rem;
  padding: 2px 6px;
  background: rgba(255,255,255,.9);
  color: var(--brand-blue, #21668E);
  border: 0;
}

/* Admin provider hero — responsive on phone */
@media (max-width: 768px) {
  .admin-provider-hero {
    grid-template-columns: 64px 1fr !important;
    padding: 16px 18px !important;
    gap: 12px !important;
  }
  .admin-provider-hero .aph-avatar {
    width: 64px !important;
    height: 64px !important;
    font-size: 1.4rem !important;
  }
  .admin-provider-hero .aph-info h2 {
    font-size: 1.1rem !important;
  }
  .admin-provider-hero .aph-info .aph-meta {
    font-size: .82rem !important;
  }
  .admin-provider-hero .aph-status {
    grid-column: 1 / -1 !important;
    text-align: left !important;
  }
}
@media (max-width: 540px) {
  .admin-provider-hero {
    grid-template-columns: 56px 1fr !important;
    padding: 14px 14px !important;
  }
  .admin-provider-hero .aph-avatar {
    width: 56px !important;
    height: 56px !important;
    font-size: 1.2rem !important;
  }
  .admin-provider-hero .aph-info h2 {
    font-size: 1rem !important;
  }
  .admin-gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Admin media grid — responsive */
@media (max-width: 540px) {
  .admin-media-grid { grid-template-columns: 1fr !important; }
}

/* Admin docs table — horizontal scroll on phone (inherits from global
   table.data rule, but ensure the action buttons don't wrap weirdly) */
.admin-docs-table .doc-actions {
  white-space: nowrap;
}
.admin-docs-table .doc-name-cell {
  white-space: normal;
}

/* ---------------------------------------------------------------------
   58. Campaign create — use full panel width like other pages
   --------------------------------------------------------------------- */
.run-ad-wrap {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 0 18px 0 !important;
}

/* On phone, tighten the run-ad-header padding */
@media (max-width: 768px) {
  .run-ad-header {
    padding: 18px 16px !important;
  }
  .run-ad-header h1 {
    font-size: 1.3rem !important;
  }
  .run-ad-header p {
    font-size: .85rem !important;
  }
}
@media (max-width: 540px) {
  .run-ad-header {
    padding: 16px 14px !important;
  }
  .run-ad-header h1 {
    font-size: 1.15rem !important;
  }
  .form-card {
    padding: 0 !important;
    margin-bottom: 14px !important;
  }
  .form-card > *:not(h3) {
    margin-left: 14px !important;
    margin-right: 14px !important;
  }
  .form-card > h3 {
    padding: 12px 14px !important;
    font-size: .95rem !important;
  }
  .form-card h3 .fc-num {
    width: 26px !important;
    height: 26px !important;
    font-size: .8rem !important;
  }
  .placement-options {
    grid-template-columns: 1fr !important;
  }
  .ad-image-upload {
    grid-template-columns: 1fr !important;
  }
  .ad-image-preview {
    width: 100% !important;
    height: 180px !important;
  }
  .location-combo {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  .budget-presets {
    flex-wrap: wrap;
    gap: 6px;
  }
  .budget-pill {
    padding: 5px 12px !important;
    font-size: .8rem !important;
  }
}

/* End of modern UI overhaul part 7 */

/* =====================================================================
   MODERN UI OVERHAUL — Part 8 (campaign create form-card fixes)
   Ensures all form-card content has proper padding, grid gaps, and
   responsive stacking. Inputs/selects/date pickers get internal padding
   so typed text doesn't touch input borders.
   ===================================================================== */

/* ---------------------------------------------------------------------
   59. Form-card — ensure global box-sizing + consistent spacing
   --------------------------------------------------------------------- */
.form-card,
.form-card *,
.form-card *::before,
.form-card *::after {
  box-sizing: border-box;
}

/* The form-card itself has NO padding (header stretches edge-to-edge).
   All body content gets 24px horizontal margins (set above).
   Here we ensure the vertical rhythm is consistent. */
.form-card > *:not(h3) {
  margin-top: 16px;
}
.form-card > *:not(h3):first-of-type {
  margin-top: 22px;   /* a bit more breathing room after the header */
}
.form-card > *:not(h3):last-child {
  margin-bottom: 24px;
}

/* ---------------------------------------------------------------------
   60. Placement options — proper gap + responsive
   --------------------------------------------------------------------- */
.form-card .placement-options {
  gap: 14px;
}
.placement-card {
  padding: 16px 16px !important;
}

/* ---------------------------------------------------------------------
   61. Location combo — proper gap on desktop, stacks on phone
   --------------------------------------------------------------------- */
.form-card .location-combo {
  gap: 14px;
}
.location-combo .form-row {
  margin: 0 !important;
}

/* ---------------------------------------------------------------------
   62. Budget presets — comfortable gaps
   --------------------------------------------------------------------- */
.form-card .budget-presets {
  gap: 8px;
  margin-top: 10px;
}

/* ---------------------------------------------------------------------
   63. Grid inside form-card — proper column gaps, stack on phone
   --------------------------------------------------------------------- */
.form-card .grid.cols-2,
.form-card .grid.cols-3,
.form-card .grid.cols-4 {
  gap: 16px;
  margin-top: 4px;
}
.form-card .grid .form-row {
  margin: 0 !important;
}

/* ---------------------------------------------------------------------
   64. Inputs / selects / date pickers — internal padding so typed
       text doesn't touch the input borders
   --------------------------------------------------------------------- */
.form-card input[type="text"],
.form-card input[type="email"],
.form-card input[type="password"],
.form-card input[type="number"],
.form-card input[type="url"],
.form-card input[type="tel"],
.form-card input[type="date"],
.form-card input[type="file"],
.form-card select,
.form-card textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  font-size: .95rem;
  border: 1px solid var(--border-soft, #DCECF2);
  border-radius: 10px;
  background: #fff;
  color: var(--body-text, #4B6470);
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.form-card input[type="date"] {
  padding: 10px 14px;
  min-height: 44px;
}
.form-card select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234B6470' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
  outline: none;
  border-color: var(--brand-blue, #21668E);
  box-shadow: 0 0 0 3px rgba(33,102,142,.14);
}
.form-card input::placeholder,
.form-card textarea::placeholder {
  color: var(--muted-text, #71848D);
}

/* Labels inside form-card */
.form-card label {
  display: block;
  font-weight: 600;
  color: var(--heading-dark, #173B4F);
  margin-bottom: 6px;
  font-size: .9rem;
}
.form-card .hint {
  font-size: .82rem;
  color: var(--muted-text, #71848D);
  margin-top: 5px;
  line-height: 1.4;
}

/* ---------------------------------------------------------------------
   65. Form actions row — proper spacing for Cancel / Save buttons
   --------------------------------------------------------------------- */
.form-card .form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 20px !important;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft, #DCECF2);
}

/* ---------------------------------------------------------------------
   66. Phone — stack all grids to 1 column, comfortable gaps
   --------------------------------------------------------------------- */
@media (max-width: 768px) {
  .form-card .placement-options {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .form-card .placement-card {
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 14px !important;
  }
  .form-card .grid.cols-2,
  .form-card .grid.cols-3,
  .form-card .grid.cols-4 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .form-card .location-combo {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .form-card .ad-image-upload {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .form-card input[type="text"],
  .form-card input[type="email"],
  .form-card input[type="password"],
  .form-card input[type="number"],
  .form-card input[type="url"],
  .form-card input[type="tel"],
  .form-card input[type="date"],
  .form-card input[type="file"],
  .form-card select,
  .form-card textarea {
    font-size: 16px !important; /* prevents iOS auto-zoom */
    padding: 12px 14px !important;
  }
}

@media (max-width: 540px) {
  .form-card > *:not(h3) {
    margin-left: 14px !important;
    margin-right: 14px !important;
  }
  .form-card .placement-options,
  .form-card .ad-image-upload,
  .form-card .location-combo,
  .form-card .grid,
  .form-card .budget-presets,
  .form-card .form-actions,
  .form-card .auto-link-note {
    margin-left: 14px !important;
    margin-right: 14px !important;
  }
  .form-card > h3 {
    padding: 12px 14px !important;
    font-size: .92rem !important;
  }
  .form-card h3 .fc-num {
    width: 24px !important;
    height: 24px !important;
    font-size: .78rem !important;
  }
  .form-card .form-actions {
    flex-direction: column;
  }
  .form-card .form-actions .btn {
    width: 100%;
  }
}

/* End of modern UI overhaul part 8 */

/* =====================================================================
   MODERN UI OVERHAUL — Part 9 (campaign create edge-case fixes)
   Fixes the remaining border-touching issues:
   1. .placement-options inside .form-row (double margin)
   2. .hint after .location-combo touching border
   3. .form-actions (Cancel/Save/Run Ad) outside form-card, touching
      .run-ad-wrap edges
   ===================================================================== */

/* ---------------------------------------------------------------------
   67. Placement-options inside a form-row — REMOVE the extra 24px
       margin so it doesn't double up with the form-row's margin.
       The form-row already provides the 24px side margin; the
       placement-options just needs to fill the form-row's content area.
   --------------------------------------------------------------------- */
.form-card .form-row .placement-options,
.form-card .form-row .location-combo,
.form-card .form-row .grid,
.form-card .form-row .budget-presets,
.form-card .form-row .ad-image-upload {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* ---------------------------------------------------------------------
   68. Hint text inside form-card — ensure it has proper margins
       (it's a direct child of form-card in some sections)
   --------------------------------------------------------------------- */
.form-card > .hint,
.form-card .form-row + .hint,
.form-card .location-combo + .hint,
.form-card .grid + .hint {
  margin-left: 24px !important;
  margin-right: 24px !important;
  margin-top: 10px;
  margin-bottom: 0;
  box-sizing: border-box;
}

/* ---------------------------------------------------------------------
   69. Form-actions OUTSIDE form-card (the Cancel/Save/Run Ad row)
       It sits directly inside .run-ad-wrap, which has overflow:hidden
       and no padding. Give the form-actions proper horizontal padding
       so the buttons don't touch the container edges.
   --------------------------------------------------------------------- */
.run-ad-wrap > form > .form-actions,
.run-ad-wrap .form-actions {
  padding: 18px 24px;
  margin: 0;
  border-top: 1px solid var(--border-soft, #DCECF2);
  background: #fff;
  box-sizing: border-box;
}

/* On phone, tighten the form-actions padding */
@media (max-width: 768px) {
  .run-ad-wrap > form > .form-actions,
  .run-ad-wrap .form-actions {
    padding: 14px 16px;
  }
}
@media (max-width: 540px) {
  .run-ad-wrap > form > .form-actions,
  .run-ad-wrap .form-actions {
    padding: 12px 14px;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .run-ad-wrap .form-actions > * {
    width: 100%;
  }
  .run-ad-wrap .form-actions > div {
    display: flex !important;
    gap: 8px !important;
  }
  .run-ad-wrap .form-actions > div > * {
    flex: 1;
  }
}

/* ---------------------------------------------------------------------
   70. Ensure the run-ad-wrap form has no extra margins that push
       the form-actions out of alignment
   --------------------------------------------------------------------- */
.run-ad-wrap > form {
  margin: 0;
  padding: 0;
}

/* End of modern UI overhaul part 9 */

/* =====================================================================
   MODERN UI OVERHAUL — Part 10 (inner container for complex sections)
   Adds a visible inner box around the Ad Placement + Ad Content fields
   and the Location & Pin Code section, giving them visual separation
   from the simpler form fields. Works on all screens but especially
   useful on phone where the sections are taller.
   ===================================================================== */

/* ---------------------------------------------------------------------
   71. .form-card-inner — inner container inside a form-card
       Sits below the header bar, has its own background, border,
       border-radius, and padding. Contains related form-rows grouped
       together (e.g., all the Ad Content fields, or the Location fields).
       Visible on ALL screens (PC + tablet + phone).
   --------------------------------------------------------------------- */
.form-card .form-card-inner {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 12px;
  padding: 20px 20px;
  margin: 16px 24px 22px 24px !important;
  box-sizing: border-box;
  display: block;
  box-shadow: inset 0 1px 3px rgba(15,23,42,.04);
}

/* On phone, tighten the inner container padding */
@media (max-width: 768px) {
  .form-card .form-card-inner {
    padding: 14px 14px;
    margin: 14px 16px 18px 16px !important;
    border-radius: 10px;
  }
}
@media (max-width: 540px) {
  .form-card .form-card-inner {
    padding: 12px 12px;
    margin: 12px 14px 16px 14px !important;
    border-radius: 10px;
  }
}

/* The first form-row inside the inner container doesn't need a top margin
   (the container's padding provides the spacing) */
.form-card .form-card-inner > .form-row:first-child,
.form-card .form-card-inner > p:first-child {
  margin-top: 0;
}

/* The last form-row inside the inner container doesn't need a bottom margin */
.form-card .form-card-inner > .form-row:last-child,
.form-card .form-card-inner > .hint:last-child {
  margin-bottom: 0;
}

/* Ensure form-rows inside the inner container have proper vertical spacing */
.form-card .form-card-inner > .form-row {
  margin-top: 14px;
  margin-bottom: 14px;
}
.form-card .form-card-inner > .form-row:first-child {
  margin-top: 0;
}
.form-card .form-card-inner > .form-row:last-child {
  margin-bottom: 0;
}

/* The location-combo inside the inner container — remove its own margins
   since the inner container provides the padding */
.form-card .form-card-inner > .location-combo {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* The hint inside the inner container — remove its own side margins */
.form-card .form-card-inner > .hint {
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-top: 10px;
}

/* The description paragraph inside the inner container */
.form-card .form-card-inner > p.text-muted {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* End of modern UI overhaul part 10 */

/* =====================================================================
   57. Provider profile — UI corrections
   (a) Cover action buttons: correct hover states. The modern .btn:hover
       (gradient bg + #fff text) tied/overrode the cover-specific rules and
       made "Unlock to see WhatsApp, Email & Website" white-on-white.
   (b) Breadcrumb pinned to the LOWER side of the cover banner (inside
       the banner, below the avatar/info grid — phone + desktop).
   (c) Reviews carousel: slides sized to the viewport (track has no inline
       N*100% width any more; JS steps -100% per slide).
   ===================================================================== */

/* (a) Cover action buttons — full normal + hover states */
.provider-cover-actions .btn {
  background: rgba(255,255,255,.96);
  color: var(--brand-blue);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 2px 8px rgba(15,23,42,.18);
}
.provider-cover-actions .btn:hover {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15,23,42,.30);
}
.provider-cover-actions .btn:active { transform: translateY(0); }
.provider-cover-actions .btn.secondary {
  background: rgba(255,255,255,.92);
  color: var(--brand-blue);
  border: 1px solid rgba(255,255,255,.75);
}
.provider-cover-actions .btn.secondary:hover {
  background: #fff;
  color: var(--brand-blue-hover);
  border-color: var(--brand-blue);
  box-shadow: 0 4px 12px rgba(15,23,42,.22);
}
.provider-cover-actions .btn-whatsapp,
.provider-cover-actions .btn.btn-whatsapp {
  background: #25D366;
  color: #fff;
  border: 1px solid #25D366;
}
.provider-cover-actions .btn-whatsapp:hover,
.provider-cover-actions .btn.btn-whatsapp:hover {
  background: #1da851;
  color: #fff;
  border-color: #1da851;
  box-shadow: 0 6px 16px rgba(37,211,102,.35);
}

/* (b) Breadcrumb — LOWER side of the cover banner (phone + desktop).
       Sits inside the dark cover overlay, under the avatar/info grid,
       as a translucent white pill so it reads over any cover photo. */
.provider-page-crumbs {
  margin: 22px 0 0;
  padding: 10px 16px 12px;
  background: rgba(15, 23, 42, .40);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
  color: rgba(255, 255, 255, .85);
  font-size: .85rem;
  overflow-wrap: break-word;
  word-break: break-word;
}
.provider-page-crumbs a { color: #fff; font-weight: 600; }
.provider-page-crumbs a:hover { color: #CFE8F7; text-decoration: underline; }
.provider-page-crumbs span { color: #fff; font-weight: 600; }
@media (max-width: 768px) {
  .provider-page-crumbs { text-align: center; margin-top: 16px; }
}

/* (c) Reviews carousel — slides take exactly one viewport each.
       The track no longer carries an inline N*100% width: it stays
       viewport-wide and slides overflow to the right (clipped by the
       overflow:hidden viewport). translateX(-100%) then steps one slide. */
.reviews-track { width: 100%; }
.review-slide { flex: 0 0 100%; }

/* =====================================================================
   58. Review "Read more" POPUP — full review with X (close) button
   Tapping "Read more" on a clamped review opens this modal: the
   complete review (author, stars, date, title, full text), scrollable
   when long. Close via the round X button, backdrop click or Esc.
   Above every other UI layer (sidebars sit at 10002).
   ===================================================================== */
.review-modal {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 10004;
  display: none;
}
.review-modal.open { display: block; }
.review-modal-backdrop {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(15, 23, 42, .58);
}
.review-modal-dialog {
  position: relative;
  margin: 6vh auto 0;
  width: min(600px, calc(100vw - 40px));
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .45);
  overflow: hidden;
  animation: reviewModalIn .18s ease-out;
}
@keyframes reviewModalIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
/* Round X (cross) close button — top-right, always visible while open */
.review-modal-close {
  flex: 0 0 auto;
  align-self: flex-end;
  margin: 12px 12px 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-soft, #DCECF2);
  background: #F2F8FC;
  color: var(--brand-blue, #21668E);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.review-modal-close:hover {
  background: var(--brand-blue, #21668E);
  color: #fff;
  border-color: var(--brand-blue, #21668E);
  transform: rotate(90deg);
}
.review-modal-close:focus-visible {
  outline: 3px solid rgba(33, 102, 142, .35);
  outline-offset: 2px;
}
.review-modal-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 24px 24px;
}
/* Lock page scroll while the popup is open */
body.review-modal-open { overflow: hidden; }
/* The review card rendered inside the popup — flat, no shadow, full width */
.review-modal-content .review-item {
  border: none;
  box-shadow: none;
  padding: 4px 0 0;
  height: auto;
}
.review-modal-content .review-item .review-body {
  max-height: none;
  overflow: visible;
}

/* Phone — popup nearly full-width, bigger X touch target */
@media (max-width: 540px) {
  .review-modal-dialog {
    margin: 3vh auto 0;
    width: calc(100vw - 24px);
    max-height: 88vh;
    border-radius: 14px;
  }
  .review-modal-close { width: 44px; height: 44px; margin: 10px 10px 0; }
  .review-modal-scroll { padding: 4px 18px 18px; }
  .review-modal-content .review-item { padding: 2px 0 0; }
}

/* End of modern UI overhaul part 11 */

/* =====================================================================
   59. ADMIN TABLES — text / column overflow fixes
   ---------------------------------------------------------------------
   Problem: section 37 forced `white-space: nowrap` on every table.data
   cell and `width: max-content` on thead/tbody, so one long email,
   URL or business name stretched a table to 30,000+ px. The text went
   far outside the screen and outside its column, and every following
   column was pushed out of view.

   Fix:
   - table.data renders as ONE real table again (thead + tbody share the
     same column grid, so headers always line up with their data)
   - cells wrap text instead of nowrap; long unbreakable tokens
     (emails, URLs, hashes) may break anywhere
   - detail tables (label/value rows, no thead): labels stay on one line
     and the label column shrinks; values wrap
   - short code columns (status / points / actions / phone) stay on
     one line where there is room
   - on phones the table element becomes a horizontal scroll container
     (rows stay aligned — the browser wraps the row groups in one
     anonymous table inside it), so wide lists scroll instead of
     pushing text off the screen
   ===================================================================== */
table.data {
  display: table;
  width: 100%;
  table-layout: auto;
  white-space: normal;
  overflow-x: visible;
  border-collapse: collapse;
}
table.data thead,
table.data tbody {
  display: table-row-group;
  width: auto;
  min-width: 0;
  table-layout: auto;
}
table.data tr { display: table-row; }
table.data th,
table.data td {
  display: table-cell;
  white-space: normal;
  vertical-align: top;
  min-width: 0;                   /* neutralizes old `.data th/td {min-width:100px}` phone rule */
  overflow-wrap: anywhere;        /* emails / URLs / hashes break when needed */
  word-break: break-word;         /* legacy fallback */
}
/* Detail tables: <tr><th>Label</th><td>value</td></tr> (no thead) */
table.data tbody th {
  white-space: nowrap;
  width: 1%;                      /* shrink-to-fit label column */
  padding-right: 16px;
}
/* Short single-token columns in list tables keep one line */
table.data th.col-phone,  table.data td.col-phone,
table.data th.col-points, table.data td.col-points,
table.data th.col-status, table.data td.col-status,
table.data th.col-actions, table.data td.col-actions,
table.data th.doc-actions,  table.data td.doc-actions {
  white-space: nowrap;
}
/* Providers list min-widths only apply where there is room */
@media (max-width: 900px) {
  .admin-providers-table .col-business,
  .admin-providers-table .col-service,
  .admin-providers-table .col-location { min-width: 0; }
}
/* Phone — wide tables scroll inside their own frame. display:block +
   overflow-x:auto makes the table element a scroll container; the row
   groups keep their default table display, so the browser wraps them
   in ONE anonymous table → headers always align with data. Every cell
   gets a minimum width floor so columns stay readable (scroll, never
   crush). Verified: sandbox replica + live page. */
@media (max-width: 640px) {
  table.data {
    display: block;
    overflow-x: auto;
    white-space: normal;
    -webkit-overflow-scrolling: touch;
  }
  table.data thead,
  table.data tbody { display: table-row-group; width: auto; min-width: 0; }
  table.data tr { display: table-row; }
  table.data th,
  table.data td {
    display: table-cell;
    padding: 8px 9px;
    font-size: .84rem;
    min-width: 92px;              /* readable column floor → scroll, not crush */
  }
  /* the providers-table col rules above carry higher specificity —
     re-assert the floor with matching specificity */
  table.data.admin-providers-table th,
  table.data.admin-providers-table td { min-width: 92px; }
  table.data tbody th { min-width: 0; } /* detail labels: 1% shrink rule above */
  table.data th.col-status, table.data td.col-status,
  table.data th.col-points, table.data td.col-points { white-space: normal; }
  .admin-row-biz-name { max-width: 150px; }
}

/* Tag pills with very long keywords never blow out their container */
.tag,
.profile-keyword-cloud .tag,
.tag-list .tag {
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* =====================================================================
   60. AVATAR CIRCLES — uploaded images always centered
   ---------------------------------------------------------------------
   A `background:` shorthand declared AFTER background-size/position
   (see the original .cp-avatar rule) resets them to auto / 0% 0%, so
   an uploaded photo was drawn at natural size anchored to the TOP-LEFT
   corner of the circle — it looked off-center / "not centralized".
   These late declarations win the cascade for every circle in the app
   and pin the image to cover + center.
   ===================================================================== */
.provider-avatar,
.provider-card .pc-avatar,
.provider-card.v2 .pc-cover-block .pc-avatar-mini,
.profile-cover-inner .pc-avatar-large,
.pc-avatar-large,
.cp-avatar,
.admin-provider-hero .aph-avatar,
.admin-provider-row-avatar,
.admin-media-box .media-frame,
.image-preview-tile,
.gallery-thumb {
  background-size: cover;
  background-position: center;
}

/* Provider profile-edit: the avatar preview is a circle so the provider
   sees exactly how the uploaded image is centered in the round frame. */
.image-preview-tile.avatar-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  margin: 0 auto 8px;              /* centered in its form column */
  background-color: var(--bg-light);
}
.image-preview-tile.avatar-circle.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  text-align: center;
}

/* End of sections 59 + 60 */

/* =====================================================================
   61. Meta pills / info headers — long tokens never push out of screen
   (a 100-char email in a pill made the customer profile 30px wider
   than the phone screen)
   ===================================================================== */
.cp-meta-pill,
.pc-meta-pill,
.profile-cover-inner .pc-meta-pill {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.cp-info h2,
.pc-info-block h2 {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* End of section 61 */

/* =====================================================================
   62. ADMIN TABLES — long text fits every viewport & font size
   ---------------------------------------------------------------------
   Problem remaining after §59: on desktop (≥640px) the providers list
   still exceeded the content area. Cause chain:
     - fixed px min-widths on .col-business/.col-service/.col-location
       plus nowrap code columns (phone/status/points/actions) whose
       widths grow with the font size (browser text-size setting)
     - .admin-main is overflow:visible (§51 — required by the sticky
       secondary header), so the over-wide table dragged the WHOLE PAGE
       off-screen: the Points/Actions columns became unreachable and
       the row text ran past the right screen edge.

   Fix v2 (container scroll frame — cross-browser safe):
     - table.data stays a REAL table (display: table). The browser
       computes ONE column grid for thead + tbody natively, so the
       header cells ALWAYS line up with the data cells in every
       browser (Chrome, Firefox, Safari, Edge). A display:block table
       relies on anonymous-table fixup which not all engines share,
       and headers can drift out of alignment with the body.
     - The horizontal scroll frame is the table's CONTAINER: every
       admin table is a direct child of .admin-content, .dash-content
       or .card (verified across all pages). When a table's minimum
       width exceeds the available space (big fonts, many columns),
       the CONTAINER scrolls — the page itself never grows wider and
       text never leaves the screen.
     - providers column px floors neutralized at every size (cells wrap)
     - .admin-row-biz-name cap is font-relative (ch) so the business
       column scales with the text size instead of a fixed 220px
   ===================================================================== */
table.data {
  display: table;
  table-layout: auto;
  width: 100%;
  border-collapse: collapse;
}
table.data thead,
table.data tbody {
  display: table-row-group;
  width: auto;
  min-width: 0;
}
table.data tr { display: table-row; }
table.data th,
table.data td {
  display: table-cell;
  min-width: 0;
}

/* Scroll frames = the tables' parent containers (admin + portals) */
.admin-content,
.dash-content,
.admin-content .card,
.dash-content .card {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
/* Slim styled scrollbar for the scroll frames */
.admin-content::-webkit-scrollbar,
.dash-content::-webkit-scrollbar,
.admin-content .card::-webkit-scrollbar,
.dash-content .card::-webkit-scrollbar { height: 8px; }
.admin-content::-webkit-scrollbar-track,
.dash-content::-webkit-scrollbar-track,
.admin-content .card::-webkit-scrollbar-track,
.dash-content .card::-webkit-scrollbar-track {
  background: var(--bg-light);
  border-radius: 4px;
}
.admin-content::-webkit-scrollbar-thumb,
.dash-content::-webkit-scrollbar-thumb,
.admin-content .card::-webkit-scrollbar-thumb,
.dash-content .card::-webkit-scrollbar-thumb {
  background: var(--border-soft);
  border-radius: 4px;
}
.admin-content::-webkit-scrollbar-thumb:hover,
.dash-content::-webkit-scrollbar-thumb:hover,
.admin-content .card::-webkit-scrollbar-thumb:hover,
.dash-content .card::-webkit-scrollbar-thumb:hover { background: var(--muted-text); }

/* Providers list: no fixed px floors at any viewport — the business
   column shrinks via the 16ch name cap; cells wrap (§59); only
   genuinely-too-wide tables scroll. */
.admin-providers-table .col-business { min-width: 0; }

/* Table headers are short single-line labels (Name / Type / City /
   Actions...). Never wrap them mid-word ("TY / PE") — a column can
   never be squeezed below its own header's word width; if the sum of
   the column minimums exceeds the container, the container scrolls
   instead of crushing the columns. */
table.data thead th {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}

/* Font-scaled floors keep the text columns from crushing to one-word
   slivers at big font sizes (ch grows with the text size). */
.admin-providers-table .col-service,
.admin-providers-table .col-location { min-width: 10ch; }

/* Business-name truncation cap scales with the font, not fixed px */
.admin-row-biz-name { max-width: 16ch; }

/* Detail tables (label/value): the nowrap label may not exceed the
   row's width when the font is very large — wrap it as a fallback */
table.data tbody th {
  max-width: 220px;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .admin-row-biz-name { max-width: 16ch; }
  /* Re-assert the §59 phone cell floors AFTER the §62 base rules above
     (same specificity — later wins): readable columns on phones, and
     the container (.admin-content / .card) scrolls horizontally. */
  table.data th,
  table.data td { min-width: 92px; }
  table.data.admin-providers-table th,
  table.data.admin-providers-table td { min-width: 92px; }
  table.data tbody th { min-width: 0; } /* detail labels: 1% shrink rule */
}

/* Customer directory — RESTORE the phone card layout (≤900px) that the
   generic table rules (§59/§62, higher specificity) had silently
   overridden: thead hidden, every row a stacked label:value card.
   Re-asserted here with table.data.directory-table specificity so the
   generic scroll-frame rules never beat it. */
@media (max-width: 900px) {
  table.data.directory-table { display: block; overflow-x: visible; width: 100%; }
  table.data.directory-table thead { display: none; }
  table.data.directory-table tbody { display: block; width: 100%; min-width: 0; }
  table.data.directory-table tr {
    display: block;
    width: 100%;
    margin-bottom: 14px;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    background: #fff;
    padding: 8px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
  }
  table.data.directory-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border: 0;
    border-bottom: 1px solid #f0f3f7;
    text-align: right;
    min-width: 0;
    white-space: normal;
  }
  table.data.directory-table td:last-child { border-bottom: 0; }
  table.data.directory-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--dark-navy, #173A5E);
    font-size: .82rem;
    text-align: left;
    flex-shrink: 0;
  }
  table.data.directory-table td[data-label="Name"] {
    flex-direction: column;
    align-items: flex-start;
    border-bottom: 2px solid #e3e8ef;
    padding-bottom: 10px;
    margin-bottom: 4px;
  }
  table.data.directory-table td[data-label="Name"]::before {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted, #888);
  }
  table.data.directory-table td[data-label="Actions"] {
    justify-content: flex-start;
  }
  table.data.directory-table td[data-label="Actions"]::before { display: none; }
}

/* End of section 62 */

/* =====================================================================
   63. Site header nav — never leaves the screen at big text sizes
   ---------------------------------------------------------------------
   .site-nav was flex-wrap: nowrap. At large browser text sizes
   (150%+) the logged-in nav (Home/Services/Locations/About/Contact/
   Credits/Dashboard/Logout) grew ~11px wider than the viewport and
   pushed the whole page off-screen. Items now wrap to a second line
   (right-aligned) only when there genuinely isn't room — at normal
   sizes nothing changes.
   ===================================================================== */
.site-nav {
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 0 1 auto;                 /* may shrink below content width → items wrap */
  min-width: 0;                   /* not just min-content */
}
/* 1201-1300px: the logged-in nav (8 items + credit pill) is ~50px over
   capacity at full size — apply the same compaction the 993-1200 range
   already uses, so the header stays on ONE line with a visible search. */
@media (max-width: 1300px) and (min-width: 993px) {
  .site-nav { gap: 8px; }
  .site-nav a { padding: 8px 10px; font-size: .85rem; }
  .header-search-bar { flex: 0 0 220px; max-width: 260px; }
}

/* End of section 63 */

/* =====================================================================
   64. ADMIN TABLES — single-line identity columns (Type / Name /
   Business / Phone / PIN Code)
   ---------------------------------------------------------------------
   These columns carry the identity values an admin scans row-by-row
   (Customer Directory, IP Tracker, Providers, Customers, Locations).
   Their text now ALWAYS renders on ONE line at FULL font size — never
   wrapped, never shrunk, never truncated. Only cells tagged
   td.cell-oneline are affected ("only for those columns"); every
   other column keeps the §59/§62 wrapping behaviour. When one-line
   content makes a table wider than its container, the container
   scroll frame (§62) takes over — the page itself never overflows.
   ===================================================================== */
table.data th.cell-oneline,
table.data td.cell-oneline {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  max-width: none;
}
/* NOTE (§66): the business-name "max-width: none" exception that used
   to live here was removed — name columns are now CAPPED with an
   ellipsis (td.cell-cap, §66) and the wide table is explored by
   dragging (§67) instead of growing without limit. Type / Phone /
   PIN Code identity columns keep the full one-line behaviour. */
/* Customer-directory phone card layout (≤900px): inside a card the
   label:value row must stay wrappable so a long value never pushes
   the card past the phone screen */
@media (max-width: 900px) {
  table.data.directory-table td.cell-oneline {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
  }
  table.data.directory-table td.cell-oneline .admin-row-biz-name {
    white-space: normal;
    max-width: 100%;
  }
}

/* End of section 64 */

/* =====================================================================
   65. ADMIN SIDEBAR — the CURRENT section is always clearly visible
   ---------------------------------------------------------------------
   Two problems fixed:
   (a) Many lower sidebar links (Advertising group, Settings group,
       Credit History, Unlocked Providers, Transactions, Database,
       Menus, Pending…) had NO active-state detection — clicking them
       highlighted nothing, so the current section was invisible.
       (Fixed in admin/index.php: every link now gets its active
       class from the URL segments.)
   (b) The active highlight itself was a 25%-opacity tint — easy to
       miss on the dark gradient. It is now an unmistakable marker:
       bright accent bar + tinted row + bold text.
   The sidebar is taller than the viewport (60+ links scrolling inside
   its 100vh frame). A small inline script in admin/index.php centers
   the active link in the sidebar on every page load, so sections
   from the lower half of the menu are always brought into view.
   ===================================================================== */
.admin-sidebar a.active,
.dash-sidebar a.active {
  background: linear-gradient(90deg,
              rgba(123,204,228,.30) 0%,
              rgba(33,102,142,.55) 55%,
              rgba(33,102,142,.18) 100%);
  color: #ffffff;
  border-left-color: #7BCCE4;
  border-left-width: 4px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(123,204,228,.22);
}
/* Smooth glide when the auto-center script scrolls to the active item */
.admin-sidebar { scroll-behavior: smooth; }

/* End of section 65 */

/* =====================================================================
   66. ADMIN TABLES — customer / provider names & descriptions capped
   ---------------------------------------------------------------------
   User request: keep the customer/provider NAME and DESCRIPTION text
   within a fixed limit instead of stretching the table. Cells tagged
   td.cell-cap render their value on ONE line, full font size, capped
   at a font-relative width (ch — grows with the browser text size);
   text beyond the cap ends in an ellipsis (…). The FULL text is
   always available in the native title tooltip (hover the mouse /
   long-press on touch) and on the entity's detail page. Each column
   picks its cap via a modifier class:
       .cap-name  24ch            customer / provider names
       .cap-biz   56px + 24ch     avatar + name stack (44px avatar)
       .cap-md    30ch            emails, reasons, transaction notes
       .cap-desc  44ch            review text / long descriptions
   Together with §67 (drag-to-scroll) the tables stay compact and
   whatever columns fall outside the viewport are reached by holding
   the mouse / touch and dragging the table sideways.
   ===================================================================== */
table.data td.cell-cap {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: var(--cell-cap, 34ch);
}
td.cell-cap.cap-name { --cell-cap: 24ch; }
td.cell-cap.cap-biz  { --cell-cap: calc(56px + 24ch); }
td.cell-cap.cap-md   { --cell-cap: 30ch; }
td.cell-cap.cap-desc { --cell-cap: 44ch; }

/* Single-line ellipsis utility for NESTED text (avatar stacks, name +
   sub-line cells): the inner element carries the ellipsis dots, the
   td cap above keeps the column itself narrow. */
.clamp-1 {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Multi-line clamps (detail-page description blocks) */
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Nested stacks inside capped cells must be allowed to shrink so the
   inner ellipsis engages (flex children default to min-width:auto) */
table.data td.cell-cap .admin-row-business,
table.data td.cell-cap .admin-row-business-info { min-width: 0; max-width: 100%; }
table.data td.cell-cap .admin-row-biz-name,
table.data td.cell-cap .admin-row-owner { max-width: 100%; }

/* Customer-directory phone cards (≤900px): a capped value stays on
   one line inside the card — the card itself can never overflow. */
@media (max-width: 900px) {
  table.data.directory-table td.cell-cap {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
}

/* End of section 66 */

/* =====================================================================
   67. TABLE DRAG-TO-SCROLL — hold & drag any wide table sideways
   ---------------------------------------------------------------------
   app.js marks every horizontally scrollable table container with
   .table-scroll-frame (admin tables, provider/customer dash tables,
   any scrollable public table). The mouse (or pen) then GRABS the
   table and drags it left / right — the cursor shows grab / grabbing.
   Touch devices already scroll the very same containers natively by
   holding and dragging, so they are left untouched. A drag that moved
   the table never fires a click afterwards — links and buttons stay
   safe; a plain click (no movement) behaves exactly as before.
   Mouse text-selection inside scrollable tables is owned by the drag
   gesture (the full text is available in the title tooltips of the
   §66 capped cells).
   ===================================================================== */
.admin-content,
.dash-content,
.admin-content .card,
.dash-content .card { overscroll-behavior-x: contain; }

.table-scroll-frame table { cursor: grab; }
.table-scroll-frame table a,
.table-scroll-frame table .btn,
.table-scroll-frame table button { cursor: pointer; }

/* While the pointer is held down: block accidental text selection */
.table-scroll-frame.drag-hold {
  user-select: none;
  -webkit-user-select: none;
}
/* Active drag: grabbing cursor everywhere + no selection */
.table-scroll-frame.dragging,
.table-scroll-frame.dragging * {
  cursor: grabbing !important;
  user-select: none;
  -webkit-user-select: none;
}

/* End of section 67 */

/* =====================================================================
   68. DASHBOARD STAT CARDS — ALWAYS ONE ROW + LOCATIONS PAGINATION
   ---------------------------------------------------------------------
   The stat cards (Customers / Providers / Pending / Approved …) used to
   live in a grid with auto-fit tracks, so on narrower screens or bigger
   text sizes the Approved / Pending cards wrapped onto separate rows —
   the dashboard looked bad. They are now a FLEX row with nowrap: every
   card shrinks equally and the whole group ALWAYS stays on one row at
   any viewport or text size. Placed last in the cascade (with !important
   where earlier sections also used !important) so it wins over the
   grid rules in sections 8 / 40 and every old media query.
   ===================================================================== */
.dash-cards {
  display: flex !important;
  flex-wrap: nowrap !important;
}
.dash-cards .dash-card {
  flex: 1 1 0;
  min-width: 0;
}
.dash-cards .dash-card .label {
  overflow-wrap: anywhere;
}

/* Phone: keep the one-row promise but compact the cards so they fit */
@media (max-width: 540px) {
  .dash-cards { gap: 8px !important; }
  .dash-cards .dash-card { padding: 10px 8px !important; }
  .dash-cards .dash-card .label {
    font-size: .62rem !important;
    letter-spacing: .02em !important;
  }
  .dash-cards .dash-card .value { font-size: 1.05rem !important; }
}

/* ---------------------------------------------------------------------
   Public Locations page — Previous / Next pagination (12 per page)
   --------------------------------------------------------------------- */
.loc-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 32px 0 10px;
}
.loc-pagination .loc-page-info {
  color: var(--muted);
  font-size: .95rem;
  font-weight: 600;
}

/* End of section 68 */

/* =====================================================================
   69. TABLE-ONLY SIDE SCROLL + ONE-LINE BADGES + USERNAMES + TOUCH DRAG
   ---------------------------------------------------------------------
   Round 9 user requests:
   (a) ONLY the table portion may scroll sideways — the admin panel
       page itself must never move. §62-v2 had turned .admin-content /
       .dash-content / .card into the scroll frames, which dragged the
       ENTIRE content area (page title, filter forms, cards, pagination)
       sideways together with the table. Now the table element itself is
       the scroll frame again (the proven §59/§62-v1 pattern):
       display:block + overflow-x:auto with thead/tbody kept as
       table-row-group — the browser wraps all row groups in ONE
       anonymous table, so headers always share the body's column grid.
   (b) Status badges (Approved / Pending / Captured / Failed …) must
       NEVER wrap their text onto a second line — white-space: nowrap.
   (c) @username sub-lines: every admin table shows the account's
       globally-unique username (the tracking ID) under the identity
       value (§66 clamp utilities keep them one line + tooltip).
   (d) Tap-and-drag: touch pointers join the §67 drag-to-scroll module.
       touch-action: pan-y hands horizontal gestures to JS; vertical
       swipes keep panning the page natively.
   ===================================================================== */
table.data {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table.data thead,
table.data tbody { display: table-row-group; width: auto; min-width: 0; }
table.data tr { display: table-row; }
table.data th,
table.data td { display: table-cell; }

/* The v2 container frames retire: only table elements scroll now. */
.admin-content,
.dash-content,
.admin-content .card,
.dash-content .card { overflow-x: visible; }

/* Slim styled scrollbar under every horizontally scrollable table */
table.data { scrollbar-width: thin; }
table.data::-webkit-scrollbar { height: 8px; }
table.data::-webkit-scrollbar-track { background: var(--bg-light); border-radius: 4px; }
table.data::-webkit-scrollbar-thumb { background: var(--border-soft); border-radius: 4px; }
table.data::-webkit-scrollbar-thumb:hover { background: var(--muted-text); }

/* Status badges: ALWAYS one line, never wrapped, never squashed */
.badge { white-space: nowrap; flex-shrink: 0; }

/* @username sub-line (unique account ID) used across all admin tables */
.cell-username {
  color: var(--primary-blue);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.25;
  margin-top: 1px;
}
table.data td.cell-cap .cell-username { max-width: 100%; }

/* The drag frame is the TABLE itself now → grab cursor on the table
   (§67's descendant selectors only covered wrapper frames) */
table.data.table-scroll-frame { cursor: grab; }
table.data.table-scroll-frame a,
table.data.table-scroll-frame .btn,
table.data.table-scroll-frame button { cursor: pointer; }

/* Touch drag: horizontal gestures on scrollable tables belong to the
   §67 drag module (JS); vertical swipes keep panning the page. */
.table-scroll-frame { touch-action: pan-y; }

/* End of section 69 */

/* =====================================================================
   70. FORM CHECKBOX / RADIO SIZE + PHONE HEADER STACKING FIXES
   ---------------------------------------------------------------------
   Round 10 user reports:
   (a) /admin/roles and /admin/credit-plans/create/ — the tick-mark
       boxes (permissions checkboxes, "Active?" checkbox) rendered as
       GIANT full-row rectangles. Root cause: the generic
       ".form-row input { width:100%; padding:11px 13px }" rules also
       matched checkboxes — equal specificity + later source order beat
       the global 20px square rule, stretching each box to the full
       form-row width. The source rules now exclude checkbox/radio via
       :not() (see sections 8 / 31 / 40); the rules below are a safety
       net that pins the square sizing no matter what later rules try.
   (b) Phone: with the mobile menu open (.site-nav.open) the sticky
       .panel-secondary-header painted ON TOP of the dropdown and
       covered its links. Both the site-header and the secondary header
       carried z-index 50 — equal z leaves the decision to DOM order,
       and the secondary header comes later, so it won. The header now
       stacks at z-index 200 on phone/tablet (still below the sidebar
       drawer at 10002, its backdrop at 10001, and modals at 9999+),
       and the secondary header sticks BELOW the site header instead
       of fighting with it for the same top: 0 line.
   ===================================================================== */

/* (a) Safety net — checkboxes & radios inside form rows are always
   compact squares: never full-width, never padded. */
.form-row input[type="checkbox"],
.form-row input[type="radio"] {
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  height: 20px;
  min-height: 20px;
  max-height: 20px;
  padding: 0;
  box-sizing: border-box;
  flex-shrink: 0;
  flex-grow: 0;
}
/* The intentionally larger terms checkbox on the registration forms
   keeps its 28px square (and is re-capped so the safety net above
   can never shrink it). */
.form-row .terms-check input[type="checkbox"],
.terms-check input[type="checkbox"] {
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  padding: 0;
}
/* Special radio contexts that live INSIDE .form-row keep their own
   intended sizing (their original rules have equal specificity but
   sit earlier in the file, so they are restated here to win):
   - blog/page "Editing Mode" toggles — compact 18px visible radios
   - ad "Placement" cards — 0×0 natively-hidden radios (label is the UI) */
.blog-mode-option input[type="radio"],
.page-mode-option input[type="radio"] {
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 18px;
  min-height: 18px;
  max-height: 18px;
}
.placement-option input[type="radio"] {
  width: 0;
  min-width: 0;
  max-width: 0;
  height: 0;
  min-height: 0;
  max-height: 0;
}

/* (b) Phone / tablet stacking: the site header (with the open
   .site-nav dropdown) always paints ABOVE the sticky panel header. */
@media (max-width: 992px) {
  .site-header { z-index: 200; }
  /* Secondary header sticks directly below the site header, so both
     bars stay visible and usable while scrolling panel pages. */
  .panel-secondary-header { top: var(--header-h, 64px); }
}

/* End of section 70 */

/* =====================================================================
   71. ROUND 11 — panel account chips, campaign pages, admin avatars
   ---------------------------------------------------------------------
   User requests this round:
   (a) Customer/provider dashboards get the SAME panel-secondary-header
       treatment as the admin panel — each now shows the logged-in
       account (avatar photo when available, initials otherwise) in
       the header bar's .psh-actions slot.
   (b) /provider/advertising/campaigns + /create/ UI polish: stats are
       pill chips that WRAP on phone (the old single flex row squeezed
       six stats into an unreadable strip), the "no image" placeholder
       is a proper gradient tile with a camera glyph, and the native
       file input is styled into a modern "Upload Image" button.
   (c) Admin customers table shows the customer's real profile photo
       in the avatar circle (initials only as fallback).
   NOTE: the asset version query (?v=…) was bumped to r6 in this round
   so browsers re-fetch the stylesheet — round 10's phone header fix
   was invisible to clients still serving the cached r5 file.
   ===================================================================== */

/* (a) Account chip in the panel secondary header (customer + provider
   dashboards). Avatar: 32px circle, photo or initials. The name hides
   on very small phones but the avatar always stays visible. */
.psh-account {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 4px 5px;
  background: #F1F6FA;
  border: 1px solid var(--border-soft, #E1E8EE);
  border-radius: 999px;
  min-width: 0;
  flex-shrink: 0;
}
.psh-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: var(--primary-blue, #21668E);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(33,102,142,.18);
}
.psh-avatar.is-initial {
  background: linear-gradient(135deg, var(--soft-blue, #7BCCE4), var(--primary-blue, #21668E));
}
.psh-account-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--heading-dark, #16324A);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
@media (max-width: 540px) {
  .psh-account { padding: 3px; border-color: transparent; background: transparent; }
  .psh-account-name { display: none; }
}

/* (b) Campaign cards — stats become wrapped pill chips so six values
   stay readable on a 390px phone instead of one squeezed strip. */
.campaign-card .cc-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  font-size: .8rem;
}
.campaign-card .cc-stats .cc-stat {
  background: #F1F6FA;
  border: 1px solid #E1E8EE;
  border-radius: 999px;
  padding: 3px 11px;
  color: var(--muted);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.campaign-card .cc-stats .cc-stat strong { color: var(--dark-navy, #16324A); }

/* Campaign title row: name + status badge wrap cleanly on narrow screens */
.campaign-card .cc-info h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Nicer "no image" tile for campaign cards */
.cc-noimg {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  background: linear-gradient(135deg, #EAF2F8, #D4E4F0);
  border: 1px solid #CBD9E4;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8FA9BD;
}

/* Campaign create/edit — modern file upload control */
.ad-image-actions { min-width: 0; }
.ad-image-upload input[type="file"] {
  font-size: .85rem;
  color: var(--muted);
  max-width: 100%;
}
.ad-image-upload input[type="file"]::file-selector-button {
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-blue, #21668E), #2A87B8);
  border: 0;
  border-radius: 10px;
  padding: 9px 16px;
  margin: 0 12px 4px 0;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(33,102,142,.22);
  transition: transform .12s, box-shadow .15s;
}
.ad-image-upload input[type="file"]::file-selector-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(33,102,142,.3);
}
.ad-image-preview {
  border-radius: 12px;
  background-color: #F1F6FA;
}
.ad-image-preview .placeholder-text { opacity: .8; }

/* Form bottom actions — stack neatly on phone (Cancel / Save Draft /
   Run Ad all remain reachable with a thumb, full-width) */
@media (max-width: 540px) {
  .form-card .form-actions,
  .run-ad-wrap .form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .run-ad-wrap .form-actions > div { display: flex; gap: 10px; }
  .run-ad-wrap .form-actions > div > * { flex: 1 1 auto; }
}

/* (c) Admin customers — the avatar circle supports a real photo */
.admin-customer-avatar {
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(33,102,142,.15);
}
.admin-customer-avatar.is-photo { background: none; color: transparent; }

/* Admin customer detail — photo header above the info table */
.admin-cust-view-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 4px 0 18px;
  flex-wrap: wrap;
}
.admin-cust-view-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--soft-blue, #7BCCE4), var(--primary-blue, #21668E));
  background-size: cover;
  background-position: center;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(33,102,142,.18);
}
.admin-cust-view-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark-navy, #16324A);
}

/* End of section 71 */

/* =====================================================================
   72. ROUND 12 — unified ads (corner "Ad" label), provider gallery
   lightbox, provider-profile text containment, provider dashboard
   phone layout, sticky-header hardening.
   ---------------------------------------------------------------------
   User requests this round:
   (a) Sticky header works on every phone — the <html> overflow-x
       clip at the top of this file removed the body scroll-container
       that used to break position:sticky on iOS Safari. The rules below
       keep the header painted above page content while scrolling.
   (b) Ads render INSIDE the normal provider lists — no separate
       "Sponsored" section anywhere. Every ad card carries a small,
       subtle gray "Ad" label in its cover corner instead.
   (c) Provider gallery images open in a zoomable lightbox popup with
       arrows, swipe, keyboard nav and easy closing.
   (d) Provider profile: all primary/secondary text stays inside its
       container — wrapping, clamping and min-width guards.
   (e) /provider/dashboard/ responsive on phones — stat cards wrap
       into a 2-column grid instead of one squeezed row.
   ===================================================================== */

/* (a) Sticky header hardening ------------------------------------------
   The header is position:sticky (top of file + §1). It stays in the
   normal flow, so page content can NEVER slide under it — no extra
   body padding is needed. NOTE: no "contain" here — the mobile nav
   dropdown + search overlay hang BELOW the header box and must not be
   clipped. */
.site-header { position: sticky; top: 0; }
/* Any ancestor chain that could trap the sticky header is neutralized:
   main must never clip or offset. */
main { transform: none !important; filter: none !important; }

/* (b) Unified ads — small gray "Ad" label --------------------------------
   Round 13: the label sits on the LOWER side of the card — pinned to the
   card's bottom-right corner, away from the profile info and never
   intercepting clicks. (The span lives inside .pc-cover but anchors to
   .provider-card, the nearest positioned ancestor.) */
.provider-card { position: relative; }
.ad-flag {
  position: absolute;
  bottom: 10px;
  right: 10px;
  top: auto;
  z-index: 3;
  font-size: .68rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .05em;
  color: #5f6b76;                       /* subtle gray text */
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(95,107,118,.28);
  border-radius: 5px;
  padding: 3px 7px;
  pointer-events: none;                 /* clicks always reach the card */
  box-shadow: 0 1px 3px rgba(22,50,74,.08);
}
/* Ads now look like every other card — the old blue highlight ring is
   retired; the corner Ad label is the only (subtle) marker. */
.provider-card.sponsored {
  border-color: var(--border-soft);
  box-shadow: var(--shadow-sm);
}
.provider-card.sponsored:hover {
  box-shadow: var(--shadow-md);
}
/* Keep the legacy .badge.sponsored usable in admin tables, but retire
   it from provider cards (search / profile / locations / services). */
.search-results .provider-card .badge.sponsored,
.related-merged .provider-card .badge.sponsored { display: none; }

/* (c) Gallery lightbox ------------------------------------------------- */
.gallery-public-item {
  cursor: zoom-in;
  -webkit-tap-highlight-color: rgba(33,102,142,.12);
}
.gallery-public-item:focus-visible {
  outline: 3px solid rgba(33,102,142,.45);
  outline-offset: 2px;
}
.provider-lightbox {
  position: fixed;
  inset: 0;
  z-index: 5000;                     /* above header (200) + contact bar */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s ease;
}
/* The [hidden] attribute MUST win over the display:flex above — without
   this rule the lightbox rendered invisibly (opacity 0) but still covered
   the whole page at z-index 5000 and swallowed every click. */
.provider-lightbox[hidden] { display: none !important; }
.provider-lightbox.open { opacity: 1; }
.provider-lightbox .pl-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12,24,36,.86);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  cursor: pointer;                   /* "tap outside to close" affordance */
}
.provider-lightbox .pl-stage {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 46px 56px 64px;           /* room for the controls */
  box-sizing: border-box;
}
.provider-lightbox .pl-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
  cursor: zoom-in;
  transition: transform .18s ease;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;                /* JS owns touch: swipe + pan */
  will-change: transform;
}
.provider-lightbox .pl-image.zoomed { transition: none; /* instant panning */ }
.provider-lightbox .pl-close,
.provider-lightbox .pl-nav {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.92);
  color: #16324A;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
  transition: transform .12s ease, background .15s ease;
  font-family: inherit;
  padding: 0;                    /* SVG glyph centers itself — no offsets */
}
.provider-lightbox .pl-close svg,
.provider-lightbox .pl-nav svg {
  display: block;
  margin: 0 auto;
}
.provider-lightbox .pl-close {
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  font-size: 1.5rem;
  line-height: 1;
}
.provider-lightbox .pl-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  font-size: 2rem;
  line-height: 1;
}
.provider-lightbox .pl-prev { left: 10px; }
.provider-lightbox .pl-next { right: 10px; }
.provider-lightbox .pl-close:hover,
.provider-lightbox .pl-nav:hover {
  background: #fff;
  transform: scale(1.07);
}
.provider-lightbox .pl-nav:hover { transform: translateY(-50%) scale(1.07); }
.provider-lightbox .pl-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 14px 14px;
  color: rgba(255,255,255,.92);
  font-size: .85rem;
  background: linear-gradient(transparent, rgba(10,20,30,.55));
}
.provider-lightbox .pl-counter {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,.14);
  padding: 2px 10px;
  border-radius: 999px;
}
.provider-lightbox .pl-hint {
  color: rgba(255,255,255,.55);
  font-size: .74rem;
}
@media (max-width: 540px) {
  /* Phones: smaller controls sit INSIDE the stage padding, full-height
     swipe area, and the hint text stays out of the way. */
  .provider-lightbox .pl-stage { padding: 40px 8px 56px; }
  .provider-lightbox .pl-close { width: 36px; height: 36px; font-size: 1.25rem; top: 10px; right: 10px; }
  .provider-lightbox .pl-nav { width: 38px; height: 38px; font-size: 1.6rem; top: auto; bottom: 96px; transform: none; }
  .provider-lightbox .pl-nav:hover { transform: scale(1.07); }
  .provider-lightbox .pl-hint { display: none; }
  .provider-lightbox .pl-caption { padding-bottom: 12px; }
}

/* (d) Provider profile — text containment ----------------------------- */
.provider-cover-name,
.provider-cover-service-title,
.provider-cover-meta,
.meta-pill,
.breadcrumbs {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.provider-cover-name .badge.verified { flex-shrink: 0; }
.meta-pill { max-width: 100%; min-width: 0; }
.profile-section h3 { overflow-wrap: anywhere; }
/* Contact card: long phone numbers, emails and website URLs must wrap
   inside the buttons instead of bursting out of the card. */
.phone-revealed,
.lock-phone { min-width: 0; }
.phone-number,
.lock-phone .masked {
  overflow-wrap: anywhere;
  word-break: break-all;
  letter-spacing: normal;
}
.phone-revealed .btn,
.lock-phone .btn,
.phone-revealed a {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
  text-align: center;
  justify-content: center;
}
/* Stat cards: long numbers never push the row wide. */
.provider-stats-row { min-width: 0; }
.provider-stat-card { min-width: 0; }
.provider-stat-card .num {
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
/* Service/keyword tags wrap inside tag lists (already flex-wrap). */
.tag-list { min-width: 0; }
/* Review carousel slide text stays inside its card. */
.review-slide,
.review-item { min-width: 0; max-width: 100%; }
.review-title,
.review-body { overflow-wrap: anywhere; }
/* Related cards on the profile page keep the 3/2/1-column grid. */
.related-merged { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 992px) { .related-merged { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .related-merged { grid-template-columns: 1fr; } }

/* (e) Provider dashboard — phone responsive --------------------------- */
/* §65 forces .dash-cards onto ONE row (the admin Approved/Pending
   request). The PROVIDER dashboard has up to 7 stat cards — on a phone
   that squeezed them into unreadable 40px strips. The -wrap modifier
   lets them flow into a comfortable 2-column grid on small screens
   while keeping the single-row look on desktop. */
.dash-cards-wrap { flex-wrap: wrap !important; }
.dash-cards-wrap .dash-card { flex: 1 1 150px; }
@media (max-width: 768px) {
  .dash-cards-wrap .dash-card { flex: 1 1 44%; }
}
@media (max-width: 540px) {
  .dash-cards-wrap .dash-card { flex: 1 1 44% !important; }
  .dash-cards-wrap .dash-card .label {
    font-size: .68rem !important;   /* readable, no mid-word breaks */
    letter-spacing: .02em !important;
    overflow-wrap: anywhere;
  }
  .dash-cards-wrap .dash-card .value { font-size: 1.15rem !important; }
}
/* Quick Actions: buttons become comfortable full-width thumb targets
   on phones (they were tiny squeezed pills). */
.quick-actions-card p { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-actions-card .btn { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 540px) {
  .quick-actions-card p { flex-direction: column; }
  .quick-actions-card .btn { width: 100%; text-align: center; }
}

/* End of section 72 */

/* =====================================================================
   73. ROUND 13 — ad visibility hints (My Ads), ad label on the lower
   side, lightbox control centering.
   ===================================================================== */

/* My Ads — live status hint line under the placement badge */
.campaign-card .cc-hint {
  margin-top: 6px;
  font-size: .78rem;
  line-height: 1.45;
  max-width: 560px;
  padding: 5px 10px;
  border-radius: 8px;
  display: inline-block;
  overflow-wrap: anywhere;
}
.campaign-card .cc-hint a { text-decoration: underline; font-weight: 600; }
.campaign-card .cc-hint-ok    { background: #E8F6EE; color: #1E7A46; }
.campaign-card .cc-hint-warn  { background: #FDF3E4; color: #9A6A15; }
.campaign-card .cc-hint-muted { background: #F1F5F9; color: #5F6B76; }
@media (max-width: 540px) {
  .campaign-card .cc-hint { max-width: 100%; }
}

/* End of section 73 */

/* =====================================================================
   74. TABLE SCROLL WRAPPER — headers always stretch full panel width
   ---------------------------------------------------------------------
   User report (wide monitor): on admin Customer / Provider / Keywords
   pages the table headers were squeezed into the left ~25% of the
   panel with the rest of the row blank.

   Cause: §69 turned the table element itself into the scroll frame
   (display:block + overflow-x:auto). Inside a display:block table the
   browser wraps thead+tbody in ONE anonymous table box that SHRINKS
   TO FIT its content — it never stretches to the panel width. Any
   table whose natural content is narrower than the panel (empty
   keyword groups, short tables, wide monitors) collapses to a few
   hundred pixels and the rest of the block stays blank.

   Fix (§74, with the JS wrapper in app.js): every table.data is
   wrapped in <div class="table-scroll-wrap"> and becomes a REAL table
   again —
     • display:table + width:100%  → headers always span the full
       panel width; ONE native column grid, so header cells can never
       drift out of alignment with body cells (works in every engine).
     • The wrapper is the horizontal scroll frame → when content is
       wider than the panel (mobile, big fonts, many columns) ONLY the
       table region scrolls; the page itself never grows sideways.
     • The §67/§69 tap-and-drag module finds the wrapper automatically
       (dragFindFrame walks up to the nearest scrollable ancestor that
       contains a table) — drag-to-scroll and the grab cursor keep
       working exactly as before.
   ===================================================================== */

/* (a) The wrapper: the ONLY sideways scroll frame for tables ------- */
.table-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;              /* horizontal gestures → §67 drag JS */
  overscroll-behavior-x: contain;
  margin: 12px 0;                   /* takes over the table's own margin */
  scrollbar-width: thin;
}
.table-scroll-wrap::-webkit-scrollbar { height: 8px; }
.table-scroll-wrap::-webkit-scrollbar-track {
  background: var(--bg-light);
  border-radius: 4px;
}
.table-scroll-wrap::-webkit-scrollbar-thumb {
  background: var(--border-soft);
  border-radius: 4px;
}
.table-scroll-wrap::-webkit-scrollbar-thumb:hover { background: var(--muted-text); }

/* (b) The table: a real table again, always full width --------------
   Same specificity as §69's rules but LATER in the file, so these
   win the cascade. Applies to wrapped tables AND (JS-off fallback)
   unwrapped ones — without JS a table simply renders as a normal
   full-width table, which is readable and safe. */
table.data {
  display: table;
  table-layout: auto;
  width: 100%;
  overflow-x: visible;
  border-collapse: collapse;
  white-space: normal;
}
table.data thead,
table.data tbody {
  display: table-row-group;         /* native row groups — one grid */
  width: auto;
  min-width: 0;
}
table.data tr { display: table-row; }
table.data th,
table.data td { display: table-cell; }

/* Wrapped tables: margin moves to the wrapper (no double spacing) */
.table-scroll-wrap > table.data { margin: 0; }

/* (c) Keep §62's mobile readability floors --------------------------
   On phones the cells keep their minimum width floor; the table's
   min-content then exceeds the narrow viewport, the table grows past
   100% and the WRAPPER scrolls (not the page). Neutralize §62's
   display:block mobile override — the wrapper does the scrolling now. */
@media (max-width: 640px) {
  table.data {
    display: table;
    overflow-x: visible;
  }
  table.data thead,
  table.data tbody { display: table-row-group; }
  table.data th,
  table.data td {
    min-width: 92px;                /* readable column floor → scroll, not crush */
  }
  /* detail tables: label column stays shrink-to-fit */
  table.data tbody th { min-width: 0; }
  .admin-row-biz-name { max-width: 150px; }
}

/* (d) Grab cursor for drag-to-scroll: the JS marks the wrapper with
   .table-scroll-frame; §69's rules targeted the table element, so
   extend them to wrapper frames (descendant tables get the cursor). */
.table-scroll-wrap.table-scroll-frame { cursor: grab; }
.table-scroll-wrap.table-scroll-frame a,
.table-scroll-wrap.table-scroll-frame .btn,
.table-scroll-wrap.table-scroll-frame button { cursor: pointer; }

/* End of section 74 */

/* =====================================================================
   ROUND 24/25 — HEADER SEARCH BAR (user-provided design — header only)
   White pill-less bar: 52px tall, 1.5px #bce3f7 border, 14px radius,
   icon-only brand-blue submit button. Scoped to .header-search-bar /
   .header-search-overlay so the hero search is NOT affected. Placed at
   the end of the stylesheet so it wins over all older header rules.

   ROUND 25 FIX — the mobile overlay previously got `display:flex;
   position:static` from this block, which overrode the base
   `.header-search-overlay { display:none }` rule (higher specificity,
   later in file) → the overlay form was rendered INLINE in the header
   row on EVERY screen size. That is the "two search bars at the top"
   bug. Now:
     - the shared block below carries ONLY the visual skin (no
       display/position), and
     - the desktop bar opts in with display:flex, while
     - the overlay keeps display:none until .header-search-toggle adds
       .open (existing JS), and drops down BELOW the header as before.
   ===================================================================== */
/* ---- Shared visual skin (no display / no position here) ---- */
.header-search-bar.search-bar-ui,
.header-search-overlay.search-bar-ui {
  align-items: stretch;
  height: 52px;
  background-color: #ffffff;
  border: 1.5px solid #bce3f7;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(33, 102, 142, 0.05);
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}
/* ---- Desktop inline bar: always flex on desktop ---- */
.header-search-bar.search-bar-ui {
  display: flex;
  flex: 0 1 440px;
  min-width: 220px;
  width: 100%;
  max-width: 440px;
  position: static;
  /* ROUND 26 — center the bar in the header row. The shared skin above
     sets `margin: 0` (needed by the absolutely-positioned overlay), which
     silently cancelled the old `.header-search-bar` auto-margin centering
     (section 36) — the bar ended up glued to the logo. Auto margins split
     the free space evenly on both sides → logo left, bar centered in the
     remaining space, nav flush right. */
  margin-left: auto;
  margin-right: auto;
}
/* ≤992px: inline bar hides, icon toggle takes over (existing rules) */
@media (max-width: 992px) {
  .header-search-bar.search-bar-ui { display: none !important; }
}
/* ---- Mobile/tablet overlay: hidden until toggled, drops below header ---- */
.header-search-overlay.search-bar-ui {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 520px;
  z-index: 60;
}
.header-search-overlay.search-bar-ui.open { display: flex; }
/* Phones (≤768px): older !important rules (section 54) reposition the
   overlay to a fixed full-width sheet — keep that placement but restore
   the exact user skin inside it (52px bar, 58px button, 18px input pad). */
@media (max-width: 768px) {
  .header-search-overlay.search-bar-ui {
    height: 52px !important;
    padding: 0 !important;
    background-color: #ffffff !important;
    border: 1.5px solid #bce3f7 !important;
    border-radius: 14px !important;
  }
  .header-search-overlay.search-bar-ui input {
    padding: 0 18px !important;
    font-size: 16px !important;
    color: #333333;
  }
  .header-search-overlay.search-bar-ui input::placeholder { color: #a3b2be; }
  .header-search-overlay.search-bar-ui button {
    width: 58px !important;
    flex: 0 0 58px !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background-color: rgb(33, 102, 142) !important;
  }
  .header-search-overlay.search-bar-ui button:hover { background-color: rgb(26, 82, 115) !important; }
}
/* ---- Shared control styling (input + button + svg) ---- */
.header-search-bar.search-bar-ui input,
.header-search-overlay.search-bar-ui input {
  flex: 1;
  border: none;
  outline: none;
  box-shadow: none;
  padding: 0 18px;
  font-size: 16px;
  color: #333333;
  background: transparent;
  box-sizing: border-box;
  min-width: 0;
  border-radius: 0;
  height: 100%;
}
.header-search-bar.search-bar-ui input::placeholder,
.header-search-overlay.search-bar-ui input::placeholder {
  color: #a3b2be;
  opacity: 1;
}
.header-search-bar.search-bar-ui button,
.header-search-overlay.search-bar-ui button {
  width: 58px;
  flex: 0 0 58px;
  border: none;
  outline: none;
  cursor: pointer;
  background-color: rgb(33, 102, 142);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border-radius: 0;
  color: #ffffff;
  font-size: 0;
  transition: background-color 0.2s ease;
}
.header-search-bar.search-bar-ui button:hover,
.header-search-overlay.search-bar-ui button:hover {
  background-color: rgb(26, 82, 115);
}
.header-search-bar.search-bar-ui button svg,
.header-search-overlay.search-bar-ui button svg {
  width: 20px;
  height: 20px;
  stroke: #ffffff;
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =====================================================================
   61. ROUND 26 — PHONE: breathing room for action buttons in tables
   ---------------------------------------------------------------------
   On phones the admin tables keep their compact 8px cell padding, so
   action buttons ("View" / "Edit" …) sat flush against the cell edges
   and against each other when a row carried more than one. Every
   button inside a data-table cell now gets a 2px gap above and below,
   across the platform's phone range (≤768px, matching the header
   breakpoint so landscape phones are covered too). Desktop is untouched.
   ===================================================================== */
@media (max-width: 768px) {
  table.data td .btn,
  table.data td a.btn,
  table.data td button.btn,
  table.data td .btn.sm,
  table.data th .btn {
    margin-top: 2px;
    margin-bottom: 2px;
  }
}

/* ROUND 26 — desktop (>992px): a legacy centering scheme ("site-nav {
   margin-left: auto }", see the old @media (min-width: 993px) block)
   competes with the search bar's own auto margins. Three auto margins
   split the free space three ways and pulled the bar LEFT of center
   (measured delta 112px at 1600px). Zero the nav's margin on desktop —
   the bar's right auto-margin then pushes the nav flush right, and the
   bar sits exactly halfway between logo and nav. */
@media (min-width: 993px) {
  .site-header .container.header-row .site-nav { margin-left: 0; }
}

/* ============================================================
   ROUND 29 — Settings → Custom Code page + Provider JSON import
   ============================================================ */

/* Monospace code editor (custom head/footer code + JSON import) */
textarea.code-area,
textarea.imp-json-area {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre;
  overflow-x: auto;
  tab-size: 2;
}
textarea.imp-json-area { min-height: 240px; }
textarea.code-area { min-height: 160px; }

/* Toolbar rows (example buttons / demo + preview buttons) */
.imp-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.imp-note { color: #64748b; font-size: 12.5px; line-height: 1.55; }

/* Preview + results tables */
.imp-preview { margin-top: 16px; overflow-x: auto; }
.imp-preview table.data th, .imp-preview table.data td { vertical-align: top; text-align: left; }
.imp-preview table.data td code.imp-pw {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; background: #f1f5f9; border-radius: 5px; padding: 2px 5px; display: inline-block;
}
.imp-summary {
  display: inline-block; margin: 0 0 10px; padding: 7px 12px; border-radius: 999px;
  background: #ecfdf5; color: #065f46; font-size: 12.5px; font-weight: 600; border: 1px solid #a7f3d0;
}

/* Image thumbnails + B64/LINK type badges */
.imp-thumb {
  width: 56px; height: 56px; object-fit: cover; border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, .15); background: #f1f5f9; display: block;
}
.imp-thumb.banner { width: 96px; height: 32px; }
.imp-type-badge {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .5px;
  padding: 2px 7px; border-radius: 999px; margin-top: 4px; text-transform: uppercase;
}
.imp-type-badge.b64  { background: #dcfce7; color: #166534; }
.imp-type-badge.link { background: #dbeafe; color: #1e40af; }
.imp-type-badge.none { background: #f1f5f9; color: #94a3b8; }

/* Per-row check / result colours */
.imp-row-err { color: #b91c1c; font-size: 12px; margin-top: 3px; }
.imp-ok   { color: #15803d; font-weight: 700; }
.imp-skip { color: #b45309; font-weight: 700; }
.imp-err  { color: #b91c1c; font-weight: 700; }

@media (max-width: 768px) {
  .imp-thumb { width: 44px; height: 44px; }
  .imp-thumb.banner { width: 72px; height: 26px; }
}

/* ---------------------------------------------------------------------------
   ROUND 30 — Custom Code snippet manager (admin/settings_code.php)
   ------------------------------------------------------------------------- */
.imp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.imp-table-wrap table.data { min-width: 640px; }

/* ---------------------------------------------------------------------------
   ROUND 31 — CANVAS SIZE FIX: every CMS page & blog post is limited to the
   same max width as every other page on the site (the 1200px .container).
   Previously .cms-page-html / .cms-section rendered FULL viewport width, so
   text typed in the Visual Editor stretched edge-to-edge on big screens.
   ------------------------------------------------------------------------- */
.cms-page-html,
.cms-section {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}
.cms-page-html { padding-top: 20px; padding-bottom: 20px; }
@media (max-width: 768px) {
  .cms-page-html, .cms-section { padding-left: 14px; padding-right: 14px; }
}

/* ROUND 31 — Visual Editor canvas: the contenteditable "page" you type into
   (page editor + post editor) is limited to the same max width, so what you
   type matches what visitors see. The raw-HTML textareas are capped too. */
.blog-visual-area {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
}
#blog-content-html,
#html-content-editor { max-width: var(--container-max); margin-left: auto; margin-right: auto; width: 100%; }

/* ROUND 31 — footer "subsidiary product of Digital PR World" line */
.footer-brand-line {
  margin-top: 6px;
  font-size: .86rem;
  color: var(--muted-text);
}
.footer-brand-line a { color: var(--brand-blue); text-decoration: underline; font-weight: 600; }
.footer-brand-line a:hover { color: var(--brand-red); }

/* ROUND 31 — tables inside blog posts (comparison tables in seeded articles) */
.blog-content .blog-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.4em 0; }
.blog-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.blog-content th, .blog-content td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
.blog-content thead th {
  background: var(--bg-light);
  color: var(--heading-dark);
  font-weight: 700;
  font-size: .9rem;
}
.blog-content tr:last-child td { border-bottom: 0; }
.blog-content tbody tr:hover { background: #FAFDFE; }

/* ROUND 31 — Body-Start badge (Custom Code snippet table) */
.imp-type-badge.body { background: #fef3c7; color: #92400e; }

/* =====================================================================
 * ROUND 39 — "Recent Blogs" moved INTO the footer Blog column, directly
 * below the "Blog" heading and its "Our Blogs" link (the r38 full-width
 * strip under the whole columns grid is gone). Still the 3 most recently
 * UPDATED posts recomputed on every request. Each entry is a single
 * one-row line of text: the title is trimmed to an even character
 * budget in PHP (blog_truncate_title) AND clipped to one row with a CSS
 * ellipsis so the line can never wrap — even inside the narrow column.
 * ===================================================================== */
.r39-footer-recent {
  margin-top: 14px;
  min-width: 0;
}
.r39-footer-recent h4 { margin-bottom: 8px; }
/* the Blog column must keep its natural 1fr width: the nowrap one-row
   titles would otherwise inflate the column's min-content (fr = minmax(auto,
   1fr)) and steal space from the sibling columns — min-width: 0 hands the
   overflow to the fr-link ellipsis clip instead */
.footer-blog-col { min-width: 0; }
.footer-recent .fr-list {
  list-style: none;
  margin: 0;
  padding: 0;
  /* stacked inside the Blog column — NOT a 3-column strip anymore */
  display: block;
}
.footer-recent .fr-list li { min-width: 0; margin-bottom: 7px; }
.footer-recent .fr-list li:last-child { margin-bottom: 0; }
.footer-recent .fr-link {
  display: block;
  max-width: 100%;
  font-size: .88rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, .72);
  text-decoration: none;
  /* ONE ROW ONLY — the line never wraps; any overflow closes with "..." */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.footer-recent .fr-link:hover { color: #fff; }

/* =====================================================================
 * ROUND 40 — REGISTER BUTTON: bigger (WIDER) + a second line inside the
 * SAME button. Still ONE red button — the main "Register" label sits on
 * top and, directly below it, a small sub-line reads "Join as a Nurse,
 * Service Provider or Customer". The bump is a WIDTH bump: wider
 * horizontal padding + a min-width; the label size itself is unchanged.
 * ===================================================================== */
.site-nav .header-register-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 6px 30px 7px;
  min-width: 236px;
  text-align: center;
  line-height: 1.3;
}
.site-nav .header-register-btn .r40-reg-main {
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .01em;
}
.site-nav .header-register-btn .r40-reg-sub {
  font-weight: 500;
  font-size: .6rem;
  letter-spacing: .01em;
  opacity: .95;
}
/* medium desktops (993–1200px): the legacy rule force-squashes nav link
   padding — keep the register button wide enough for its sub-line and let
   the search bar flex down instead of overflowing the header row */
@media (max-width: 1200px) and (min-width: 993px) {
  .site-nav a.header-register-btn { padding: 6px 18px 7px !important; min-width: 0; }
  .site-nav a.header-register-btn .r40-reg-sub { font-size: .55rem; }
  .header-search-bar { flex: 1 1 160px; max-width: 240px; }
}
/* ≤992px dropdown: the button already spans the row (.site-nav a width
   100% + !important padding) — the two-line stack stays centered */
@media (max-width: 992px) {
  .site-nav .header-register-btn { flex-direction: column; }
  .site-nav .header-register-btn .r40-reg-sub { font-size: .62rem; }
}
