/* v3 website tokens and chrome. Values copied from design-previews/web-v3/assets/site.css
   and the inner-page card/button pattern (qibla.html) on 2026-11-17. The finder is the
   first page to use this file. Other pages keep their own stylesheets. */
:root {
  --hero-top: #3a1670;
  --hero-mid: #1a0c58;
  --hero-bottom: #07034a;
  --card-top: #39166f;
  --card-mid: #2c1063;
  --card-bottom: #170c57;
  --panel: #0f043c;
  --ink: #0d0647;
  --gold: #f5cc34;
  --gold-brand: #fccb00;
  --page-light: #ebebeb;
  --page-lavender: #D7D7E5;
  --app-page: #efefef;
  --app-purple: #5a1a7f;
  --app-muted: #6b6b76;
  --app-line: #dcdce3;
  /* Qibla frame selection blue, sampled in design-previews/web-v3/qibla.html. */
  --sky-blue: #80C0D7;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --white: #ffffff;
  --muted-on-dark: #c9c3ea;
  --caption-bg: rgba(10, 4, 40, 0.92);
  --content: 1250px;
  --radius: 6px;
  /* Inner-page card (qibla.html): white, 16px radius, this shadow. */
  --card-radius: 16px;
  --card-shadow: 0 1px 2px rgba(13, 6, 71, 0.05);
}
body.finder-v3 {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--app-page);
  color: var(--ink);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.finder-v3 .wrap {
  width: min(var(--content), 100% - 32px);
  margin-inline: auto;
}

.grain { position: relative; isolation: isolate; }
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  opacity: 0.38;
  mix-blend-mode: overlay;
  pointer-events: none;
  border-radius: inherit;
  z-index: 0;
}
.grain > * { position: relative; z-index: 1; }

.page-band {
  color: var(--ink);
  padding: 0;
  background: linear-gradient(105deg, var(--page-light) 0%, var(--sky-blue) 100%);
}

/* The map fills the screen between the top and the footer. The thin header sits on top of it; the footer
   is a solid bar below it, in the page flow, so no rule needs to know how tall the footer is. */
body.finder-v3 {
  height: 100dvh;
  overflow: hidden;
}
body.finder-v3 .page-band {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
}
body.finder-v3 .site-footer { position: relative; z-index: 6; }
body.finder-v3 .finder,
body.finder-v3 .finder-with-map {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
body.finder-v3 .finder .map,
body.finder-v3 .finder-with-map .map {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
body.finder-v3 .finder-with-map .map > svg,
body.finder-v3 .finder-with-map #geographic-map,
body.finder-v3 .finder-with-map .map-load {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
body.finder-v3 .sidebar {
  z-index: 4;
  max-height: calc(100% - 120px);
  margin-top: 52px;
  margin-bottom: 12px;
}

body.finder-v3 .search-card,
body.finder-v3 .mosque-card {
  background: var(--white);
  border: 0;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}
body.finder-v3 .search-card {
  padding: 26px;
  margin-bottom: 24px;
  background: var(--page-light);
}
body.finder-v3 .search-card #finder-heading,
body.finder-v3 .mosque-card h2 {
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
}
body.finder-v3 .search-card #finder-heading { margin: 0 0 10px; }
body.finder-v3 .search-card .muted { color: var(--app-muted); }
body.finder-v3 .search-card form[role="search"] {
  background: var(--white);
  border-color: var(--app-line);
}
body.finder-v3 .search-card form[role="search"] input {
  background: var(--white);
  border: 1px solid var(--app-line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(13, 6, 71, 0.08);
}
/* Wider than phones the visible label is above the box, so the hint text inside it stays hidden. */
@media (min-width: 641px) {
  body.finder-v3 .search-card form[role="search"] input::placeholder { color: transparent; }
}
/* Phones: a compact search card like the v3 Dua Finder (Aziz, 2026-11-18): small title, one white pill
   search box with the hint inside and the gold Search button inside it on the right, then the privacy
   line. The label stays for screen readers; the form, ids and behaviour are unchanged. */
@media (max-width: 640px) {
  body.finder-v3 .search-card { padding: 16px; margin-bottom: 16px; }
  body.finder-v3 .search-card #finder-heading { font-size: 18px; margin: 0 0 12px; }
  body.finder-v3 .search-card form[role="search"] {
    position: relative; display: block; padding: 0; border: 0; background: transparent; border-radius: 0;
  }
  body.finder-v3 .search-card form[role="search"] label[for="city-query"] {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  body.finder-v3 .search-card form[role="search"] input {
    display: block; width: 100%; min-height: 54px; border: 0; border-radius: 999px; background: var(--white);
    font-size: 16px; color: var(--ink); padding: 12px 98px 12px 18px;
    box-shadow: 0 1px 2px rgba(13, 6, 71, 0.06);
  }
  /* Typed text stays 16px (iOS does not zoom); the hint is a touch smaller so it fits beside the button. */
  body.finder-v3 .search-card form[role="search"] input::placeholder { color: #8d8b99; font-size: 15px; }
  body.finder-v3 .search-card .city-search-actions { display: contents; }
  body.finder-v3 .search-card form[role="search"] .city-search-submit {
    position: absolute; top: 5px; right: 5px; min-height: 44px; height: 44px; padding: 0 16px; font-size: 15px;
    /* mosque-finder.css makes the button half the row wide; inside the pill it is only as wide as its word. */
    flex: none; width: auto; max-width: none;
  }
  /* After a search the server adds "Clear search": on phones it is a quiet ✕ inside the pill, left of
     Search, like app search bars. The link text stays for screen readers; website-map.js still hides it
     and clears the box when it is pressed. */
  body.finder-v3 .search-card form[role="search"] .clear-search {
    position: absolute; top: 5px; right: 92px; flex: none; width: 44px; height: 44px; min-width: 44px; min-height: 44px; max-width: none;
    padding: 0; border: 0; border-radius: 50%; background: transparent; color: #6b6b76;
    display: inline-flex; align-items: center; justify-content: center; font-size: 0; text-decoration: none;
  }
  body.finder-v3 .search-card form[role="search"] .clear-search[hidden] { display: none; }
  body.finder-v3 .search-card form[role="search"] .clear-search:hover { background: rgba(13, 6, 71, 0.06); }
  body.finder-v3 .search-card form[role="search"]:has(.clear-search:not([hidden])) input { padding-right: 140px; }
  body.finder-v3 .search-card #place-help { margin: 10px 4px 0; font-size: 12px; line-height: 1.5; }
}

/* v3 primary button, used for Search. */
body.finder-v3 .search-card .city-search-submit {
  border-radius: 999px;
  min-height: 48px;
  padding: 10px 20px;
  border: 2px solid var(--gold);
  background: var(--gold);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}
body.finder-v3 .search-card .city-search-submit:hover,
body.finder-v3 .search-card .city-search-submit:active {
  background: var(--gold);
  border-color: var(--gold);
  filter: brightness(0.97);
}
body.finder-v3 .search-card .city-search-submit:focus-visible {
  outline: 3px solid var(--app-purple);
  outline-offset: 2px;
}

body.finder-v3 .site-footer {
  display: block;
  flex: 0 0 auto;
  background: transparent;
  border-top: 0;
  padding: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.95);
}
/* No bar and no background (Aziz), but the same 16px side gutter as the rest of the page so the
   logo, text and icons do not sit on the screen edge. */
body.finder-v3 .site-footer .wrap { width: min(var(--content), 100% - 32px); margin-inline: auto; padding: 0; }
body.finder-v3 .site-footer { padding-bottom: env(safe-area-inset-bottom); }
body.finder-v3 .site-footer .footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0 8px;
  flex-wrap: wrap;
  margin: 0 auto;
  padding: 0;
}
body.finder-v3 .site-footer .footer-row + .footer-row {
  margin: 0 auto;
  padding: 0;
  border-top: 0;
}
body.finder-v3 .footer-logo { display: block; height: 22px; width: auto; }
body.finder-v3 .footer-logo, body.finder-v3 img.footer-logo {
  height: 22px;
  width: auto;
  filter: brightness(0) saturate(100%) invert(9%) sepia(60%) saturate(4000%) hue-rotate(245deg);
}
body.finder-v3 .site-footer-credit { margin: 0; min-width: 0; }
body.finder-v3 .site-footer-legal {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 13px;
}
/* Text links keep their small look but get a 44px tap height. */
body.finder-v3 .site-footer-legal a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  color: var(--ink);
  text-decoration: none;
}
/* Social icons: the same look as the other v3 pages (Aziz, 2026-11-18): plain dark-indigo symbols,
   20px, in 44px tap areas, no discs (website-social.css draws discs on the other Laravel pages). */
body.finder-v3 .site-footer .site-social { gap: 6px; }
body.finder-v3 .site-footer .site-social-link {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
}
body.finder-v3 .site-footer .site-social-link:hover,
body.finder-v3 .site-footer .site-social-link:focus-visible { background: rgba(13, 6, 71, 0.08); }
body.finder-v3 .site-footer .site-social-link img {
  width: 20px;
  height: 20px;
  padding: 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
  filter: brightness(0) saturate(100%) invert(9%) sepia(60%) saturate(4000%) hue-rotate(245deg);
}
body.finder-v3 .site-footer-legal a:hover { color: var(--ink); text-decoration: underline; }
body.finder-v3 .site-footer .site-social { justify-content: flex-end; }
@media (max-width: 767px) {
  /* Phones: the seven icons get their own row under the logo, like the other v3 pages. */
  body.finder-v3 .site-footer .footer-row:first-child { flex-wrap: wrap; }
  body.finder-v3 .site-footer .site-social { width: 100%; flex-wrap: nowrap; justify-content: space-between; gap: 0; order: 0; }
  body.finder-v3 .site-footer .site-social-link { flex: 0 1 44px; min-width: 0; }
  /* Phones: the credit keeps its own line break, after "All rights reserved." */
  body.finder-v3 .site-footer-credit { flex: 1 1 100%; font-size: 12px; line-height: 1.35; white-space: pre-line; }
}
/* Phones: the search card covers the middle of the map, so the "Tap to load the live map" label and
   its line sit at the bottom of the map, above the footer. The whole map stays the load button. */
@media (max-width: 640px) {
  body.finder-v3 .finder-with-map .map-load { justify-content: flex-end; padding-bottom: 204px; }
}
/* Narrow phones (under 375px): a slightly tighter search pill keeps the whole hint visible beside the button. */
@media (max-width: 374px) {
  body.finder-v3 .search-card { padding: 14px 12px; }
  body.finder-v3 .search-card form[role="search"] input { padding-left: 14px; padding-right: 88px; }
  body.finder-v3 .search-card form[role="search"] input::placeholder { font-size: 14px; }
  body.finder-v3 .search-card form[role="search"] .city-search-submit { padding: 0 12px; }
  body.finder-v3 .search-card form[role="search"] .clear-search { right: 84px; }
  body.finder-v3 .search-card form[role="search"]:has(.clear-search:not([hidden])) input { padding-right: 130px; }
}

/* Top line, floating over the map like the footer (no box, indigo text, soft white edge), at the top
   left where the live finder had it. Wider than 900px only: on phones the search card fills the top. */
body.finder-v3 .v3-caption {
  position: absolute;
  top: 76px;
  left: max(16px, calc((100% - var(--content)) / 2));
  z-index: 3;
  max-width: 420px;
  pointer-events: none;
  text-align: left;
  color: var(--ink);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.95), 0 0 12px rgba(255, 255, 255, 0.6);
}
body.finder-v3 .v3-caption .eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--ink);
}
body.finder-v3 .v3-caption h1 {
  margin: 12px 0 0;
  font-size: clamp(28px, 2.4vw, 38px);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
  color: var(--ink);
}
/* Hidden visually only, so screen readers still get the page's main heading on phones and tablets. */
@media (max-width: 900px) {
  body.finder-v3 .v3-caption {
    top: 0; left: 0; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
  }
}

body.finder-v3 :is(button, a, input, summary):focus-visible {
  outline: 3px solid var(--app-purple);
  outline-offset: 2px;
}
body.finder-v3 .page-band :is(button, a):focus-visible { outline-color: var(--gold); }
body.finder-v3 .skip-link {
  color: var(--ink);
  border-color: var(--gold);
  background: var(--white);
}

/* ---------- Finder states in the v3 look (Aziz, 2026-11-18: upgrade the design, keep every function) ----------
   Covers what appears after a search, a map tap or a pin tap: place list, prayer-times link, Clear search
   (desktop), the masjid card with "Take me there", the map notice, status line and map buttons. Old navy,
   cream, lavender and square corners give way to the v3 tokens. Markup, ids and behaviour are unchanged. */
/* The footer is in the page flow below the map (see the top of this file), so offsets from the bottom of
   the map area need no footer height. The name is kept because the rules below use it. */
body.finder-v3 { --finder-footer-h: 0px; }

/* The live Google map ends above the floating footer (and, 901-1599px, before the search card, as on the
   live finder), so its zoom control, Google logo and credit stay visible and tappable. */
body.finder-v3 .finder-with-map #geographic-map { bottom: var(--finder-footer-h); }
@media (min-width: 901px) and (max-width: 1599px) {
  body.finder-v3 .finder-with-map #geographic-map { right: 436px; }
}
body.finder-v3 .finder-with-map .map-actions { bottom: calc(var(--finder-footer-h) + 12px); }
body.finder-v3 .finder-with-map .map-notice { bottom: calc(var(--finder-footer-h) + 68px); }
@media (min-width: 901px) and (max-width: 1599px) {
  body.finder-v3 .finder-with-map .map-notice { right: 452px; }
}
/* Status line: under the header on phones; under the floating top line on wider screens. */
body.finder-v3 .finder-with-map .map-status { top: 60px; }
@media (min-width: 901px) { body.finder-v3 .finder-with-map .map-status { top: 200px; left: max(16px, calc((100% - var(--content)) / 2)); } }

/* Search box text and helper text. */
body.finder-v3 .search-card form[role="search"] input { font-size: 16px; color: var(--ink); }
body.finder-v3 .search-card .muted,
body.finder-v3 .search-card #place-message { color: var(--app-muted); }

/* Place list ("Choose a place"): v3 heading, no outside numbers, rounded gold tiles with ink text. The list
   stays an ordered list for screen readers. */
body.finder-v3 .search-card #place-results {
  margin: 18px 0 10px; font-size: 18px; font-weight: 600; letter-spacing: 0; line-height: 1.3; color: var(--ink);
}
body.finder-v3 .search-card #place-results:focus { outline: none; }
body.finder-v3 .search-card #place-results:focus-visible { outline: 3px solid var(--app-purple); outline-offset: 2px; }
body.finder-v3 .search-card ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
body.finder-v3 .search-card li { margin: 0; }
body.finder-v3 .search-card .place-pick {
  border-radius: 12px; border-color: var(--gold); background: var(--gold); color: var(--ink);
  font-size: 16px; font-weight: 700; padding: 12px 16px;
}
body.finder-v3 .search-card .place-pick span { color: var(--ink); opacity: 0.75; font-weight: 500; font-size: 14px; }
body.finder-v3 .search-card .place-pick:hover,
body.finder-v3 .search-card .place-pick:active { background: var(--gold); border-color: var(--gold); filter: brightness(0.96); }
body.finder-v3 .search-card .place-pick:focus-visible { outline: 3px solid var(--app-purple); outline-offset: 2px; }

/* Secondary buttons: the v3 outline pill (as Qibla's "Use phone compass"). */
body.finder-v3 .search-card .city-prayer-link,
body.finder-v3 .search-card .clear-search {
  min-height: 48px; padding: 0 20px; border: 2px solid var(--app-purple); border-radius: 999px;
  background: var(--white); color: var(--app-purple); font-size: 15px; font-weight: 700;
}
body.finder-v3 .search-card .city-prayer-link { width: 100%; }
body.finder-v3 .search-card .city-prayer-link:hover,
body.finder-v3 .search-card .clear-search:hover { background: #f5f1fa; }
body.finder-v3 .search-card .city-prayer-link:focus-visible,
body.finder-v3 .search-card .clear-search:focus-visible { outline: 3px solid var(--app-purple); outline-offset: 2px; }

/* Masjid card: v3 white card; "Take me there" is the v3 gold primary pill. */
body.finder-v3 .mosque-card:focus-visible { outline: 3px solid var(--app-purple); outline-offset: -3px; }
body.finder-v3 .take-me {
  min-height: 48px; margin-top: 16px; padding: 10px 20px; border-radius: 999px;
  background: var(--gold); color: var(--ink); font-size: 16px; font-weight: 700;
}
body.finder-v3 .take-me:hover { background: var(--gold); filter: brightness(0.97); }
body.finder-v3 .take-me:focus-visible { outline: 3px solid var(--app-purple); outline-offset: 3px; }

/* Map notice, status line and map buttons: white v3 cards and pills. */
body.finder-v3 .map-notice {
  background: var(--white); color: var(--ink); border: 2px solid var(--gold); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(13, 6, 71, 0.12);
}
body.finder-v3 .map-notice a { color: var(--app-purple); font-weight: 600; }
body.finder-v3 .map-status {
  color: var(--ink); border-radius: 12px; box-shadow: 0 4px 16px rgba(13, 6, 71, 0.12); font-size: 15px;
}
body.finder-v3 .map-actions button {
  min-height: 44px; padding: 0 18px; border: 1px solid var(--app-line); border-radius: 999px;
  background: var(--white); color: var(--ink); font-size: 15px; font-weight: 600;
  box-shadow: 0 4px 12px rgba(13, 6, 71, 0.12);
}
body.finder-v3 .map-actions button:focus-visible { outline: 3px solid var(--app-purple); outline-offset: 2px; }

/* The search column (results, masjid card, "Take me there") ends above the floating footer at every width;
   anything taller scrolls inside the column. */
body.finder-v3 .sidebar {
  max-height: calc(100% - 52px - var(--finder-footer-h) - 12px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ---------- Independent review fixes (2026-11-18, qa-results/2026-11-18-finder-v3-review.md) ---------- */
/* F2: the live map's fixed 100% height/width overrode its bottom/right offsets, so Google's zoom control,
   logo and credit sat under the footer and the card. Size it from its edges instead. */
body.finder-v3 .finder-with-map #geographic-map {
  width: auto; height: auto; top: 0; left: 0; right: 0; bottom: var(--finder-footer-h);
}
@media (min-width: 901px) and (max-width: 1599px) {
  body.finder-v3 .finder-with-map #geographic-map { right: 436px; }
}
/* F1: at 900px and narrower mosque-finder.css puts the map buttons and the notice back in the old page
   flow (position: static), which sent them under the header and the search card. Keep them over the map,
   above the footer, and above the search column so they stay visible and tappable. */
@media (max-width: 900px) {
  body.finder-v3 .finder-with-map .map-actions {
    position: absolute; left: 16px; right: 16px; max-width: none; padding: 0;
    background: transparent; pointer-events: none; z-index: 5;
  }
  body.finder-v3 .finder-with-map .map-actions button { pointer-events: auto; }
  body.finder-v3 .finder-with-map .map-notice { position: absolute; left: 16px; right: 16px; margin: 0; z-index: 5; }
  /* The search column leaves room for the map buttons above the footer. */
  body.finder-v3 .sidebar { max-height: calc(100% - 52px - var(--finder-footer-h) - 68px); }
}
/* F7: the whole map is the load button; its focus ring belongs on the label (mosque-finder.css), not
   around the entire screen. */
body.finder-v3 .map-load:focus-visible { outline: none; }
/* R1 (re-check): while the map notice shows (limit reached), the search column stops above it, so the
   notice never covers "Take me there" or the last results. */
@media (max-width: 900px) {
  body.finder-v3:has(#map-notice-wrap:not([hidden])) .sidebar {
    max-height: calc(100% - 52px - var(--finder-footer-h) - 68px - 160px);
  }
}

/* ---------- "Quiet map" (Aziz chose direction A, 2026-11-20, ticket #258) ----------
   The same layout with the noise taken out. CSS only: markup, ids, forms, aria and behaviour are unchanged.
   Review and before/after screenshots: qa-results/2026-11-20-finder-simple-design/. */
/* 1. One surface: white cards (the grey card on the beige map read as switched off). */
body.finder-v3 .search-card,
body.finder-v3 .mosque-card {
  background: var(--white);
  box-shadow: 0 6px 24px rgba(13, 6, 71, 0.12);
}
body.finder-v3 .search-card { margin-bottom: 16px; }

/* 2. One search box at every width: the phone pill (approved 2026-11-18) with Search inside it.
      Removes the box-inside-a-box. The label stays for screen readers. */
body.finder-v3 .search-card form[role="search"] {
  position: relative; display: block; padding: 0; border: 0; background: transparent; border-radius: 0;
}
body.finder-v3 .search-card form[role="search"] label[for="city-query"] {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
body.finder-v3 .search-card form[role="search"] input {
  display: block; width: 100%; min-height: 54px; border: 1.5px solid #8d8b99; border-radius: 999px;
  background: var(--white); font-size: 16px; color: var(--ink); padding: 12px 98px 12px 18px; box-shadow: none;
}
body.finder-v3 .search-card form[role="search"] input::placeholder { color: var(--app-muted); font-size: 15px; }
body.finder-v3 .search-card form[role="search"] input:focus-visible {
  outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 999px; box-shadow: none;
}
body.finder-v3 .search-card .city-search-actions { display: contents; }
body.finder-v3 .search-card form[role="search"] .city-search-submit {
  position: absolute; top: 5px; right: 5px; min-height: 44px; height: 44px; padding: 0 16px; font-size: 15px;
  flex: none; width: auto; max-width: none;
}
body.finder-v3 .search-card form[role="search"] .clear-search {
  position: absolute; top: 5px; right: 92px; flex: none; width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  max-width: none; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--app-muted);
  display: inline-flex; align-items: center; justify-content: center; font-size: 0; text-decoration: none;
}
body.finder-v3 .search-card form[role="search"] .clear-search[hidden] { display: none; }
/* The cross is drawn, not typed: every browser shows it and the link's name stays "Clear search". */
body.finder-v3 .search-card form[role="search"] .clear-search::before {
  content: ""; width: 14px; height: 14px;
  background:
    linear-gradient(45deg, transparent calc(50% - 1.25px), currentColor calc(50% - 1.25px), currentColor calc(50% + 1.25px), transparent calc(50% + 1.25px)),
    linear-gradient(-45deg, transparent calc(50% - 1.25px), currentColor calc(50% - 1.25px), currentColor calc(50% + 1.25px), transparent calc(50% + 1.25px));
}
body.finder-v3 .search-card form[role="search"] .clear-search:hover { background: rgba(13, 6, 71, 0.06); }
body.finder-v3 .search-card form[role="search"]:has(.clear-search:not([hidden])) input { padding-right: 140px; }
body.finder-v3 .search-card #place-help { margin: 10px 4px 0; font-size: 13px; line-height: 1.5; }
body.finder-v3 .search-card #place-message { margin: 8px 4px 0; font-size: 14px; }
body.finder-v3 .search-card #place-message:empty { margin: 0; }

/* 3. Gold means "the one main action" (Search, Take me there). Place rows become quiet white rows. */
body.finder-v3 .search-card .place-pick {
  position: relative; padding: 10px 40px 10px 16px; border: 1px solid var(--app-line); border-radius: 12px;
  background: var(--white); color: var(--ink); font-size: 16px; font-weight: 700;
}
/* The arrow is drawn, not typed, for the same reason. */
body.finder-v3 .search-card .place-pick::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 7px; height: 7px;
  border-top: 2px solid var(--ink); border-right: 2px solid var(--ink); transform: translateY(-50%) rotate(45deg);
}
body.finder-v3 .search-card .place-pick span { color: var(--app-muted); opacity: 1; font-weight: 500; font-size: 14px; }
body.finder-v3 .search-card .place-pick:hover,
body.finder-v3 .search-card .place-pick:active { background: #f4f4f8; border-color: var(--ink); filter: none; }

/* 4. Brand indigo instead of purple for outlines and focus. */
body.finder-v3 .search-card .city-prayer-link,
body.finder-v3 .search-card .clear-search { border-color: var(--ink); color: var(--ink); }
body.finder-v3 .search-card .city-prayer-link { margin-top: 14px; }
body.finder-v3 .search-card .city-prayer-link:hover { background: #f4f4f8; }
body.finder-v3 :is(button, a, input, summary):focus-visible,
body.finder-v3 .search-card :is(.city-search-submit, .place-pick, .city-prayer-link, .clear-search):focus-visible,
body.finder-v3 .take-me:focus-visible { outline-color: var(--ink); }
body.finder-v3 .page-band :is(button, a):focus-visible { outline-color: var(--ink); }

/* 5. The result card in the local demo: readable title and a link that looks and taps like one. */
body.finder-v3 .search-card[aria-labelledby="finder-preview-heading"] > p { margin: 0; font-size: 13px; }
body.finder-v3 .search-card[aria-labelledby="finder-preview-heading"] h2 {
  margin: 4px 0 2px; color: var(--ink); font-size: 20px; font-weight: 600; letter-spacing: 0; line-height: 1.3;
}
body.finder-v3 .search-card[aria-labelledby="finder-preview-heading"] a {
  display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-size: 15px; font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px;
}

/* 6. Calmer backdrop: the illustration stays (existing asset), fainter, without the made-up place names. */
body.finder-v3 .map > svg { opacity: 0.5; }
body.finder-v3 .map > svg text { display: none; }
/* The note was stretched into a tall white box at 900px and narrower when no live map is configured. */
body.finder-v3 .map-note,
body.finder-v3 .finder-with-map .map-note {
  position: absolute; top: auto; left: auto; right: 12px; bottom: calc(var(--finder-footer-h) + 8px); margin: 0;
  max-width: none; background: transparent; padding: 0; color: #55535f; font-size: 11px;
}

/* 7. "Tap to load the live map": no dark veil over the whole page; the label is a v3 pill. */
body.finder-v3 .map-load { background: transparent; }
body.finder-v3 .map-load-label { border: 0; border-radius: 999px; background: var(--ink); color: var(--gold); box-shadow: 0 8px 24px rgba(13, 6, 71, 0.25); }
body.finder-v3 .map-load-line { border: 0; border-radius: 999px; padding: 8px 16px; font-weight: 600; box-shadow: 0 2px 10px rgba(13, 6, 71, 0.12); }
@media (max-width: 640px) { body.finder-v3 .finder-with-map .map-load-line { display: none; } }

/* 8. Footer: a solid white bar instead of text floating on the map. One row on laptops, two on tablets,
      three short rows on phones. The second Arkaan logo is hidden (the header already shows it). */
body.finder-v3 .site-footer {
  background: var(--white); border-top: 1px solid var(--app-line); text-shadow: none;
}
body.finder-v3 .site-footer .footer-logo { display: none; }
body.finder-v3 .site-footer .footer-row:first-child { justify-content: flex-end; }
body.finder-v3 .site-footer-credit { white-space: normal; }
@media (min-width: 1000px) {
  body.finder-v3 .site-footer {
    display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: 16px;
    min-height: 56px; padding-inline: max(16px, calc((100% - var(--content)) / 2));
  }
  body.finder-v3 .site-footer .wrap { width: auto; margin: 0; }
  body.finder-v3 .site-footer .footer-row + .footer-row { gap: 0 28px; margin: 0; flex-wrap: nowrap; }
}
@media (max-width: 767px) {
  body.finder-v3 .site-footer-credit { flex: 1 1 100%; font-size: 11px; line-height: 1.3; padding-top: 4px; }
  body.finder-v3 .site-footer-legal { gap: 18px; }
}
body.finder-v3 .site-footer-legal a { min-width: 44px; justify-content: center; }

/* 9. One headline on the map: the small line above it is kept for screen readers only. */
body.finder-v3 .v3-caption .eyebrow {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
body.finder-v3 .v3-caption h1 { margin: 0; font-size: clamp(26px, 2.2vw, 34px); }
body.finder-v3 .search-card { padding: 22px; }
@media (max-width: 640px) { body.finder-v3 .search-card { padding: 16px; } }

/* 10. The "Illustrated map" note never sits under a card or a button.
       Wider than 900px it stays in the map area left of the search column; at 900px and narrower it sits in
       the strip just above the footer, with the live-map buttons one row above it. website-map.js hides the
       note once the live Google map is shown, so it cannot cover Google's own controls. */
@media (min-width: 901px) {
  body.finder-v3 .map-note,
  body.finder-v3 .finder-with-map .map-note { right: 452px; }
}
@media (min-width: 901px) and (max-width: 1099px) {
  body.finder-v3 .finder-with-map .map-actions { bottom: calc(var(--finder-footer-h) + 30px); }
}
@media (min-width: 1600px) {
  body.finder-v3 .map-note,
  body.finder-v3 .finder-with-map .map-note { right: calc(5% + 398px); }
}
@media (max-width: 900px) {
  body.finder-v3 .map-note,
  body.finder-v3 .finder-with-map .map-note { right: 16px; bottom: calc(var(--finder-footer-h) + 4px); }
  body.finder-v3 .finder-with-map .map-actions { bottom: calc(var(--finder-footer-h) + 26px); }
  body.finder-v3 .sidebar { max-height: calc(100% - 52px - var(--finder-footer-h) - 82px); }
  body.finder-v3:has(#map-notice-wrap:not([hidden])) .sidebar {
    max-height: calc(100% - 52px - var(--finder-footer-h) - 82px - 160px);
  }
  body.finder-v3 .finder-with-map .map-notice { bottom: calc(var(--finder-footer-h) + 82px); }
}

/* ---------- Nearby masjids and the masjid card (Aziz chose direction B, 2026-11-20, ticket #306) ----------
   The list appears when the live map opens. A row or a pin opens the card in its place; "Nearby masjids"
   or Escape goes back. Three layouts, chosen here by screen size only (website-map.js reads
   --finder-layout and nothing else):
     column  wider than 900px: the floating search column, as before.
     flow    768-900px, phones on their side, short screens (under 700px tall) and very small or
             heavily zoomed screens: one scrolling page (search, map, then the list or the card).
     sheet   phones and folded or unfolded foldables up to 767px wide and at least 700px tall: the list
             or the card is a sheet at the bottom of the map; the live map ends at the top of the sheet.
             Shorter screens do not get the sheet because the search card and the sheet together would
             leave almost no map.
   No animation anywhere, so nothing changes for reduced motion. Colours are the v3 tokens above; the two
   new ones are the grey of a Google pin and the green "Open" dot (a stand-in until it is read from Figma). */
:root { --pin-grey: #8f8e99; --open-green: #1c7c43; }
body.finder-v3 .finder { --finder-layout: column; --sheet-inset: 0px; }

body.finder-v3 .nearby-card {
  padding: 18px 22px 10px; border-radius: var(--card-radius); background: var(--white);
  box-shadow: 0 6px 24px rgba(13, 6, 71, 0.12);
}
body.finder-v3 .nearby-card h2 { margin: 0; color: var(--ink); font-size: 20px; font-weight: 600; line-height: 1.25; letter-spacing: 0; }
body.finder-v3 .nearby-card h2:focus { outline: none; }
body.finder-v3 .nearby-from { margin: 2px 0 8px; color: var(--app-muted); font-size: 13px; line-height: 1.4; }
body.finder-v3 :is(.nearby-list, .card-prayers, .card-chips) { margin: 0; padding: 0; list-style: none; }
body.finder-v3 .nearby-list > li { padding: 2px 0; border-top: 1px solid var(--app-line); }
body.finder-v3 .near-main {
  display: block; width: 100%; min-height: 48px; padding: 8px 0 4px; border: 0; background: transparent; color: var(--ink);
  font: inherit; text-align: left; cursor: pointer;
}
body.finder-v3 .near-main:hover .near-name { text-decoration: underline; text-underline-offset: 3px; }
body.finder-v3 .near-name { display: block; font-size: 16px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
body.finder-v3 .near-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 2px; color: var(--app-muted); font-size: 14px; line-height: 1.4; }
body.finder-v3 .near-open { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
body.finder-v3 .open-dot { flex: none; align-self: center; width: 10px; height: 10px; border-radius: 50%; background: var(--open-green); }
/* Closed is a hollow ring, so the two states do not differ by colour alone. */
body.finder-v3 [data-open="false"] > .open-dot { border: 2px solid var(--app-muted); background: transparent; }
body.finder-v3 .near-links { display: flex; flex-wrap: wrap; gap: 0 20px; margin-top: -6px; }
body.finder-v3 :is(.near-links, .card-contact, .card-full) a {
  display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-size: 15px; font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px;
}
body.finder-v3 .near-links a { font-size: 14px; }
/* "Show all 12 masjids" under the eight nearest. */
body.finder-v3 .nearby-all {
  display: block; width: 100%; min-height: 48px; padding: 0; border: 0; border-top: 1px solid var(--app-line); background: transparent;
  color: var(--ink); font: inherit; font-size: 15px; font-weight: 700; text-align: left; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
body.finder-v3 .nearby-all[hidden] { display: none; }

body.finder-v3 .mosque-card { position: relative; overflow: hidden; }
body.finder-v3 .mosque-card:focus { outline: none; }
body.finder-v3 .mosque-card:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
body.finder-v3 .card-back {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 22px; border: 0;
  border-bottom: 1px solid var(--app-line); background: transparent; color: var(--ink); font-size: 15px; font-weight: 700; cursor: pointer;
}
/* The back arrow is drawn, not typed, like the arrows in the place list. */
body.finder-v3 .card-back::before {
  content: ""; width: 7px; height: 7px; border-bottom: 2px solid var(--ink); border-left: 2px solid var(--ink); transform: rotate(45deg);
}
body.finder-v3 .card-back:hover { background: #f4f4f8; }
body.finder-v3 .sheet-handle { display: none; }
body.finder-v3 .mosque-card .summary { padding: 18px 22px 4px; }
body.finder-v3 .card-kicker { margin: 0 0 6px; color: var(--app-muted); font-size: 12px; font-weight: 700; letter-spacing: 0.14em; line-height: 1.4; text-transform: uppercase; }
body.finder-v3 .mosque-card h2 { margin: 0 0 8px; color: var(--ink); font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: 0; overflow-wrap: anywhere; }
body.finder-v3 .card-status { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 8px; color: var(--ink); font-size: 15px; line-height: 1.4; }
body.finder-v3 .card-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 22px 18px; }
body.finder-v3 .card-actions .take-me {
  flex: 1 1 auto; min-height: 46px; margin: 0; padding: 8px 18px; border: 2px solid var(--gold); font-size: 15px; white-space: nowrap;
}
body.finder-v3 .card-actions .take-me.is-quiet { border-color: var(--ink); background: var(--white); }
body.finder-v3 .card-actions .take-me.is-quiet:hover { background: #f4f4f8; filter: none; }
body.finder-v3 :is(.card-address, .card-note, .card-quiet) { margin: 0; color: var(--ink); font-size: 15px; line-height: 1.5; }
body.finder-v3 :is(.card-address, .card-note) { padding: 0 22px 16px; }
/* Tabs: the chosen tab is bold with an indigo underline, so it does not depend on colour alone. */
body.finder-v3 .card-tabs { display: flex; padding: 0 12px; border-top: 1px solid var(--app-line); border-bottom: 1px solid var(--app-line); }
body.finder-v3 .card-tabs button {
  flex: 1 1 0; min-height: 48px; padding: 0 8px; border: 0; border-bottom: 3px solid transparent; background: transparent;
  color: var(--app-muted); font-size: 15px; font-weight: 600; cursor: pointer;
}
body.finder-v3 .card-tabs button[aria-selected="true"] { border-bottom-color: var(--ink); color: var(--ink); font-weight: 700; }
body.finder-v3 .card-panel { padding: 16px 22px 18px; }
body.finder-v3 .card-label { margin: 0 0 6px; color: var(--app-muted); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
body.finder-v3 .card-panel .card-label:not(:first-child) { margin-top: 18px; }
body.finder-v3 .card-prayers li {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 12px; min-height: 44px;
  border-bottom: 1px solid var(--app-line); color: var(--ink); font-size: 15px;
}
body.finder-v3 .card-prayers li:last-child { border-bottom: 0; }
body.finder-v3 .prayer-name { font-weight: 600; }
body.finder-v3 .prayer-when { text-align: right; }
body.finder-v3 .card-hours { margin: 0; }
body.finder-v3 .card-hours div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; color: var(--ink); font-size: 15px; }
body.finder-v3 .card-hours dt { font-weight: 600; }
body.finder-v3 .card-hours dd { margin: 0; text-align: right; }
body.finder-v3 .card-chips { display: flex; flex-wrap: wrap; gap: 6px; }
body.finder-v3 .card-chips li { padding: 6px 12px; border: 1px solid var(--app-line); border-radius: 999px; color: var(--ink); font-size: 14px; }
body.finder-v3 .card-contact { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; }
body.finder-v3 .card-full { margin: 10px 0 0; }

/* flow: one normal scrolling page. */
@media (min-width: 768px) and (max-width: 900px), (max-width: 339px), (max-width: 900px) and (max-height: 699px), (max-height: 420px) {
  body.finder-v3:has(.finder-with-map) { height: auto; min-height: 100dvh; overflow: visible; }
  body.finder-v3:has(.finder-with-map) .page-band { position: relative; }
  body.finder-v3 .finder-with-map {
    --finder-layout: flow; display: flex; flex: 1 0 auto; flex-direction: column; gap: 12px; overflow: visible;
    padding: 12px 16px 16px; background: var(--app-page);
  }
  /* The column's boxes become rows of the page, so the map can sit between the search card and the list. */
  body.finder-v3 .finder-with-map .sidebar { display: contents; }
  body.finder-v3 .finder-with-map .search-card { order: 1; margin: 0; }
  body.finder-v3 .finder-with-map .map {
    order: 2; display: block; position: relative; inset: auto; flex: none; height: clamp(240px, 46vh, 460px);
    border-radius: var(--card-radius); overflow: hidden;
  }
  body.finder-v3 .finder-with-map :is(.nearby-card, .mosque-card) { order: 3; margin: 0; scroll-margin-top: 12px; }
  body.finder-v3 .finder-with-map #geographic-map { right: 0; bottom: 0; }
  body.finder-v3 .finder-with-map .map-load { justify-content: center; padding-bottom: 0; }
  body.finder-v3 .finder-with-map .map-status { top: 12px; left: 16px; }
  body.finder-v3 .finder-with-map .map-actions { position: absolute; left: 16px; right: 72px; bottom: 12px; padding: 0; background: transparent; }
  body.finder-v3 .finder-with-map .map-notice { position: absolute; left: 16px; right: 16px; bottom: 68px; margin: 0; }
  body.finder-v3 .finder-with-map .map-note { right: 16px; bottom: 2px; }
  body.finder-v3 .finder-with-map .v3-caption {
    top: 0; left: 0; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
  }
}
@media (max-height: 420px) { body.finder-v3 .finder-with-map .map { height: 200px; } }

/* sheet: the list or the card sits at the bottom of the map. Pushed down it shows the name, Open or Closed
   and the buttons (the list shows its two nearest rows); the handle or a second look opens the rest. */
@media (max-width: 767px) and (min-width: 340px) and (min-height: 700px) {
  /* --map-strip: the map kept clear between the search card and the sheet, enough for a whole pin above
     the map buttons (website-map.js PIN_SPACE). A long search card scrolls inside itself instead. */
  body.finder-v3 .finder-with-map { --finder-layout: sheet; --sheet-peek: 208px; --map-strip: 120px; }
  body.finder-v3 .finder-with-map:has(.nearby-card:not([hidden]), .mosque-card:not([hidden])) { --sheet-inset: var(--sheet-peek); }
  /* The search card stays over the top of the map and stops above the sheet. */
  body.finder-v3 .finder-with-map .sidebar,
  body.finder-v3:has(#map-notice-wrap:not([hidden])) .finder-with-map .sidebar {
    position: static; max-height: calc(100% - 52px - var(--sheet-inset) - var(--map-strip));
  }
  body.finder-v3 .finder-with-map .search-card { position: relative; z-index: 4; }
  body.finder-v3 .finder-with-map #geographic-map { bottom: var(--sheet-inset); }
  body.finder-v3 .finder-with-map .map-actions { bottom: calc(var(--sheet-inset) + 12px); }
  body.finder-v3 .finder-with-map :is(.map-notice, .map-status) { top: auto; bottom: calc(var(--sheet-inset) + 68px); }
  body.finder-v3 .finder-with-map .map-status { left: 16px; }

  body.finder-v3 .finder-with-map :is(.nearby-card, .mosque-card) {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; margin: 0; min-height: var(--sheet-peek);
    max-height: calc(100% - 60px); padding-top: 44px; overflow-y: auto; overscroll-behavior: contain;
    border-radius: var(--card-radius) var(--card-radius) 0 0; box-shadow: 0 -6px 24px rgba(13, 6, 71, 0.16);
  }
  /* The handle is a real button at the top right of the sheet; its arrow is drawn and turns when open. */
  body.finder-v3 .finder-with-map .sheet-handle {
    position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 64px; height: 44px; padding: 0;
    border: 0; background: transparent; color: var(--ink); cursor: pointer;
  }
  body.finder-v3 .finder-with-map .sheet-handle::before {
    content: ""; width: 9px; height: 9px; margin-top: 5px; border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); transform: rotate(45deg);
  }
  body.finder-v3 .finder-with-map .sheet-handle[aria-expanded="true"]::before { margin-top: -5px; transform: rotate(225deg); }
  body.finder-v3 .finder-with-map .card-back { position: absolute; top: 0; left: 0; width: auto; padding: 0 16px; border-bottom: 0; }
  body.finder-v3 .finder-with-map .nearby-card { padding: 44px 16px 8px; }
  body.finder-v3 .finder-with-map .nearby-card h2 { position: absolute; top: 0; left: 16px; display: flex; align-items: center; min-height: 44px; font-size: 18px; }
  body.finder-v3 .finder-with-map .nearby-from { margin-top: 0; }
  body.finder-v3 .finder-with-map .nearby-card[data-sheet="peek"] .nearby-list > li:nth-child(n+3),
  body.finder-v3 .finder-with-map .nearby-card[data-sheet="peek"] .near-links,
  body.finder-v3 .finder-with-map .nearby-card[data-sheet="peek"] .nearby-all,
  body.finder-v3 .finder-with-map .mosque-card[data-sheet="peek"] .card-more { display: none; }
  body.finder-v3 .finder-with-map .mosque-card .summary { padding: 2px 16px 0; }
  body.finder-v3 .finder-with-map .mosque-card h2 { font-size: 20px; margin-bottom: 4px; }
  body.finder-v3 .finder-with-map .mosque-card[data-sheet="peek"] h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.finder-v3 .finder-with-map .card-status { margin-bottom: 0; }
  body.finder-v3 .finder-with-map .card-actions { flex-wrap: nowrap; padding: 10px 16px 14px; }
  body.finder-v3 .finder-with-map .card-actions .take-me { flex: 1 1 0; min-width: 0; padding: 8px 6px; font-size: 14px; }
  body.finder-v3 .finder-with-map :is(.card-address, .card-note) { padding: 0 16px 14px; }
  body.finder-v3 .finder-with-map .card-panel { padding: 14px 16px 16px; }
}
@media (max-width: 359px) and (min-width: 340px) and (min-height: 700px) {
  body.finder-v3 .finder-with-map .card-actions { gap: 6px; }
  body.finder-v3 .finder-with-map .card-actions .take-me { padding: 8px 4px; font-size: 13px; }
}

/* Two screens side by side (a foldable opened flat with a hinge down the middle): the notice stays on the
   left screen so no sentence runs across the hinge. Browsers without viewport segments ignore this. */
@media (horizontal-viewport-segments: 2) and (min-width: 901px) {
  body.finder-v3 .finder-with-map .map-notice { right: calc(100% - env(viewport-segment-right 0 0, 50%) + 16px); }
}
