/* ============================================================
   whatismylocation.ai — .NET rebuild stylesheet
   Ported design tokens from the Next.js globals.css (Topographic +
   Aurora themes × light/dark), Tailwind removed, plus components
   for every new tool (compass, speedometer, QR, embed, places…).
   Fonts: system stacks only — zero font downloads, maximum privacy.
   ============================================================ */

/* ---------- Theme 1: TOPOGRAPHIC (default) ---------- */
:root,
[data-theme="topo"] {
  --bg: #fafaf9; --bg-elev: #ffffff; --bg-subtle: #f5f5f4;
  --surface: #ffffff; --surface-2: #f5f5f4;
  --border: #e7e5e4; --border-strong: #d6d3d1;
  --text: #1c1917; --text-muted: #57534e; --text-subtle: #78716c;
  --accent: #047857; --accent-hover: #065f46; --accent-soft: #d1fae5;
  --accent-ring: rgba(4,120,87,.18); --accent-on: #ffffff;
  --accent-gradient: linear-gradient(135deg,#047857 0%,#047857 100%);
  --warning: #b45309; --danger: #b91c1c; --ok: #047857; --grid-line: #e7e5e4;
  --radius-sm: 4px; --radius-md: 6px; --radius-lg: 8px; --radius-xl: 12px; --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.08);
  --font-display: Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --display-weight: 600; --display-tracking: -0.03em;
}

html.dark, html.dark [data-theme="topo"] {
  --bg: #0c0a09; --bg-elev: #1c1917; --bg-subtle: #292524;
  --surface: #1c1917; --surface-2: #292524;
  --border: #292524; --border-strong: #44403c;
  --text: #f5f5f4; --text-muted: #d6d3d1; --text-subtle: #a8a29e;
  --accent: #34d399; --accent-hover: #6ee7b7; --accent-soft: rgba(52,211,153,.15);
  --accent-ring: rgba(52,211,153,.25); --accent-on: #042f2e;
  --accent-gradient: linear-gradient(135deg,#34d399 0%,#34d399 100%);
  --warning: #fbbf24; --danger: #f87171; --ok: #34d399; --grid-line: #292524;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,.35);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.5);
}

/* ---------- Theme 2: AURORA ---------- */
[data-theme="aurora"] {
  --bg: #fcfcfd; --bg-elev: #ffffff; --bg-subtle: #f4f4f7;
  --surface: #ffffff; --surface-2: #f4f4f7;
  --border: #e9e9ef; --border-strong: #d4d4dc;
  --text: #18181b; --text-muted: #52525b; --text-subtle: #71717a;
  --accent: #6366f1; --accent-hover: #4f46e5; --accent-soft: #eef2ff;
  --accent-ring: rgba(99,102,241,.25); --accent-on: #ffffff;
  --accent-gradient: linear-gradient(135deg,#6366f1 0%,#d946ef 50%,#f97316 100%);
  --warning: #d97706; --danger: #dc2626; --ok: #059669; --grid-line: #efeff4;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 22px;
  --shadow-sm: 0 1px 3px rgba(24,24,27,.06), 0 1px 2px rgba(24,24,27,.04);
  --shadow-md: 0 8px 24px rgba(24,24,27,.08), 0 2px 6px rgba(24,24,27,.04);
  --shadow-lg: 0 20px 50px rgba(99,102,241,.12), 0 8px 20px rgba(24,24,27,.06);
  --font-display: var(--font-sans); --display-weight: 700; --display-tracking: -0.035em;
}

html.dark [data-theme="aurora"] {
  --bg: #0a0a14; --bg-elev: #16162a; --bg-subtle: #1f1f33;
  --surface: #16162a; --surface-2: #1f1f33;
  --border: #27273e; --border-strong: #3a3a55;
  --text: #f4f4f7; --text-muted: #c4c4cf; --text-subtle: #9696a8;
  --accent: #818cf8; --accent-hover: #a5b4fc; --accent-soft: rgba(129,140,248,.18);
  --accent-ring: rgba(129,140,248,.35); --accent-on: #0a0a14;
  --accent-gradient: linear-gradient(135deg,#818cf8 0%,#f472b6 50%,#fb923c 100%);
  --warning: #fbbf24; --danger: #f87171; --ok: #34d399; --grid-line: #1f1f33;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; border-color: var(--border); }
/* The hidden attribute must ALWAYS win. Without this, any rule that sets display
   (e.g. .btn-secondary { display:inline-flex }) overrides the UA's [hidden] and
   "reveal later" buttons (w3w map link, native share, compass/qibla/batch extras)
   show up dead before their JS arms them. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-sans); line-height: 1.6; font-size: 16px;
  transition: background-color .3s ease, color .3s ease;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { letter-spacing: -0.02em; font-weight: 600; line-height: 1.2; color: var(--text); }
h1 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.05; margin: .25em 0 .35em; }
h2 { font-size: 1.35rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1.05rem; margin: 1.25rem 0 .5rem; }
p { margin: .6em 0; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }
.container-inner { max-width: 760px; margin: 0 auto; }
.muted { color: var(--text-subtle); font-weight: 400; font-size: .85em; }
.w-full { width: 100%; }

.topo-bg { position: relative; }
[data-theme="topo"] body.topo-bg,
:root:not([data-theme="aurora"]) body.topo-bg {
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 80px 80px; background-attachment: fixed;
}

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent); color: var(--accent-on); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 1.25rem; height: 60px; }
.wordmark { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.05rem; letter-spacing: -0.025em; display: inline-flex; align-items: center; gap: .5rem; color: var(--text); }
.wordmark:hover { text-decoration: none; }
.wordmark-mark { display: inline-flex; width: 20px; height: 20px; border: 1.5px solid var(--accent); border-radius: 50%; position: relative; flex: none; }
.wordmark-mark::before { content: ""; position: absolute; inset: 4px; background: var(--accent); border-radius: 50%; }
.main-nav { display: flex; align-items: center; gap: 1rem; margin-left: auto; font-size: .9rem; }
.main-nav > a { color: var(--text-muted); white-space: nowrap; }
.main-nav > a:hover { color: var(--accent); text-decoration: none; }
.nav-more { position: relative; }
.nav-more > summary { list-style: none; cursor: pointer; color: var(--text-muted); }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary::after { content: " ▾"; font-size: .75em; }
.nav-more-panel { position: absolute; right: 0; top: calc(100% + 10px); background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: .5rem; min-width: 230px; display: flex; flex-direction: column; z-index: 60; }
.nav-more-panel a { padding: .45rem .75rem; border-radius: var(--radius-sm); color: var(--text); }
.nav-more-panel a:hover { background: var(--bg-subtle); text-decoration: none; }
.header-actions { display: flex; gap: .5rem; align-items: center; }
.theme-switcher { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--bg-elev); border: 1px solid var(--border); color: var(--text); cursor: pointer; }
.theme-switcher:hover { border-color: var(--border-strong); }
/* Pass 25: "EN" escape hatch shown in the header on every non-English page. */
.en-switch { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 .55rem; border-radius: var(--radius-md); background: var(--bg-elev); border: 1px solid var(--border); color: var(--text); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-decoration: none; unicode-bidi: isolate; }
.en-switch:hover { border-color: var(--border-strong); background: var(--bg-subtle); text-decoration: none; }
/* Pass 25: footer articles whose TITLE is translated but whose body is still English.
   unicode-bidi: isolate keeps the Latin "EN" from reordering the RTL line around it. */
.en-badge { display: inline-block; margin-inline-start: .35rem; padding: 0 .3rem; border-radius: 3px; border: 1px solid var(--border); background: var(--bg-subtle); color: var(--text-muted); font-size: .62rem; font-weight: 700; letter-spacing: .05em; line-height: 1.5; vertical-align: middle; unicode-bidi: isolate; cursor: help; }
html:not(.dark) .ico-moon { display: none; } html.dark .ico-sun { display: none; }
@media (max-width: 760px) { .main-nav > a:not(:first-child) { display: none; } }

/* ---------- Buttons / cards / rows (ported) ---------- */
.btn-primary { background: var(--accent); color: var(--accent-on); font-weight: 600; padding: .8rem 1.4rem; border-radius: var(--radius-md); border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-size: .95rem; font-family: inherit; transition: all .18s cubic-bezier(.4,0,.2,1); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 14px var(--accent-ring); text-decoration: none; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-secondary { background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); font-weight: 500; padding: .55rem .9rem; border-radius: var(--radius-md); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-size: .85rem; font-family: inherit; transition: all .18s; }
.btn-secondary:hover { border-color: var(--border-strong); background: var(--bg-subtle); text-decoration: none; }
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; margin: 0 0 1rem; }
.card-label { color: var(--text-subtle); font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 600; margin-bottom: .65rem; }
.coord-value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.coord-row { display: grid; grid-template-columns: minmax(105px,auto) 1fr auto; gap: .75rem; align-items: center; padding: .7rem .25rem; border-bottom: 1px solid var(--border); font-size: .92rem; }
.coord-row:last-child { border-bottom: none; }
.coord-row .label { color: var(--text-subtle); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.coord-row .value { overflow-wrap: anywhere; }
.coord-row .copy-btn { background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-subtle); cursor: pointer; padding: .2rem .5rem; font-size: .8rem; }
.coord-row .copy-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Hero / page structure ---------- */
.page-hero { padding: 2.5rem 1.25rem 1rem; }
.breadcrumbs { font-size: .8rem; color: var(--text-subtle); margin-bottom: .75rem; }
.answer-up-front { font-size: 1.08rem; color: var(--text-muted); max-width: 62ch; }
.crosshair { position: relative; display: inline-block; }
[data-theme="topo"] .crosshair::before { content: ""; position: absolute; left: -14px; top: 50%; width: 8px; height: 1px; background: var(--accent); }
.content-sections { max-width: 800px; padding-bottom: 1rem; }
.content-sections h2 { border-bottom: 1px solid var(--border); padding-bottom: .35rem; }
.content-sections ul { padding-left: 1.25rem; }
.howto-steps ol { padding-left: 1.25rem; } .howto-steps li { margin: .4rem 0; }
.section-divider { display: flex; align-items: center; gap: 1rem; margin: 2.5rem 0 1.25rem; color: var(--text-subtle); font-size: .75rem; text-transform: uppercase; letter-spacing: .15em; font-weight: 600; }
.section-divider::before, .section-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Widget ---------- */
.widget-wrap, .tool-wrap { padding-bottom: 2rem; }
.widget-cta { text-align: center; padding: 2rem 1.25rem; }
.btn-locate { font-size: 1.05rem; padding: 1rem 2rem; }
.widget-cta .btn-secondary { margin-left: .5rem; }
.locate-status { min-height: 1.2em; color: var(--text-muted); font-size: .9rem; }
.locate-status.error { color: var(--danger); }
.privacy-note { font-size: .8rem; color: var(--text-subtle); max-width: 56ch; }
.widget-cta .privacy-note { margin: .75rem auto 0; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 820px) { .result-grid { grid-template-columns: 1fr; } }
.address-line { font-size: 1.05rem; font-weight: 500; margin: .25rem 0; }
.meta-line { font-size: .8rem; color: var(--text-subtle); }
.map-view { height: 320px; border-radius: var(--radius-md); background: var(--bg-subtle); }
.map-hint { font-size: .78rem; color: var(--text-subtle); margin: .5rem 0 0; }
.coords-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.unit-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-full); overflow: hidden; }
.unit-toggle button { background: none; border: none; padding: .3rem .8rem; font-size: .78rem; cursor: pointer; color: var(--text-subtle); font-family: inherit; }
.unit-toggle button.active { background: var(--accent); color: var(--accent-on); }
.extra-list { margin: 0; display: grid; gap: .1rem; }
.extra-list > div { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.extra-list > div:last-child { border-bottom: none; }
.extra-list dt { color: var(--text-subtle); } .extra-list dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .5rem 0; }
.share-card .btn-secondary, .share-card .btn-primary { margin-bottom: .35rem; }

/* QR block (3.4) — persuasion copy lives ONLY here, where sharing intent lives */
.qr-block { border-top: 1px solid var(--border); margin-top: .85rem; padding-top: .85rem; }
.qr-pitch { font-size: .82rem; color: var(--text-muted); margin: .5rem 0; }
.qr-holder { text-align: center; padding: .75rem 0 .25rem; }
.qr-holder svg, .qr-holder img { width: 200px; height: 200px; background: #fff; padding: 10px; border-radius: var(--radius-md); border: 1px solid var(--border); }
.qr-caption { font-size: .75rem; color: var(--text-subtle); margin-top: .5rem; }

.export-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.history-drawer { margin-top: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-elev); padding: .9rem 1.15rem; }
.history-drawer > summary { cursor: pointer; font-weight: 500; }
.history-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: .75rem 0; }
.switch-label { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--text-muted); }
.history-list { list-style: none; margin: 0; padding: 0; }
.history-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .6rem 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.history-list li:last-child { border-bottom: none; }
.history-list .h-actions { margin-left: auto; display: flex; gap: .35rem; }
.history-list .h-pin { color: var(--warning); }
.history-list button { background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; color: var(--text-subtle); font-size: .75rem; padding: .2rem .5rem; }
.history-list button:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Forms / inputs ---------- */
/* NOTE: keep type="password" (and search/url) in this list — the /xr-seo login once
   shipped with bare native password fields because only type="text" was styled. */
input[type="text"], input[type="email"], input[type="number"], input[type="date"],
input[type="password"], input[type="search"], input[type="url"] {
  width: 100%; padding: .7rem .85rem; border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  background: var(--bg); color: var(--text); font: inherit; font-size: .95rem;
}
input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.input-row { display: flex; gap: .5rem; } .input-row input { flex: 1; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: .75rem; }
@media (max-width: 640px) { .two-col, .input-row { grid-template-columns: 1fr; flex-direction: column; } }
.tool-form { margin-bottom: .5rem; } .tool-form .btn-primary { margin-top: .75rem; }
.form-error { color: var(--danger); font-size: .9rem; }
.date-input { max-width: 180px; }

/* ---------- Geocode results ---------- */
.geocode-results { list-style: none; margin: .5rem 0 0; padding: 0; }
.geocode-results li { padding: .6rem .25rem; border-bottom: 1px solid var(--border); display: flex; gap: .75rem; align-items: baseline; }
.geocode-results li:last-child { border-bottom: none; }
.geocode-results button { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; text-align: left; padding: 0; }
.geocode-results button:hover { text-decoration: underline; }

/* ---------- IP tool ---------- */
.ip-value { font-size: 1.6rem; font-weight: 600; overflow-wrap: anywhere; margin: .25rem 0 .75rem; }
.ip-details { margin-top: 1rem; }

/* ---------- Compass (minimal stage) ---------- */
.compass-stage { max-width: 480px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; text-align: center; }
.compass-dial-wrap { position: relative; margin: 0 auto; max-width: 340px; }
#compass-dial { width: 100%; height: auto; display: block; }
.dial-ring { fill: var(--bg-elev); stroke: var(--border-strong); stroke-width: 2; }
.dial-ticks line { stroke: var(--text-subtle); stroke-width: 1; }
.dial-ticks line.major { stroke: var(--text); stroke-width: 2; }
.dial-cardinal { fill: var(--text); font-size: 22px; font-weight: 600; font-family: var(--font-sans); }
.dial-n { fill: var(--danger); }
.dial-lubber { fill: var(--accent); }
.dial-hub { fill: var(--accent); }
#dial-rotor { transform-origin: 150px 150px; will-change: transform; }
.compass-readout { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.compass-heading { font-size: 2.6rem; font-weight: 700; text-shadow: 0 1px 8px var(--bg); }
.compass-cardinal { font-size: .95rem; color: var(--text-muted); text-shadow: 0 1px 8px var(--bg); }
.compass-controls { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; align-items: center; margin: 1.1rem 0 .4rem; }
.compass-note { font-size: .78rem; color: var(--text-subtle); }
/* Focus (fullscreen) mode strips ALL chrome — the compass is the page */
body.compass-focus .site-header, body.compass-focus .site-footer,
body.compass-focus .page-hero, body.compass-focus .content-sections,
body.compass-focus .howto-steps, body.compass-focus .faq-block,
body.compass-focus .related-tools, body.compass-focus .consent-banner { display: none !important; }
body.compass-focus { background: var(--bg); }
body.compass-focus .compass-stage { padding-top: 8vh; max-width: 560px; }
body.compass-focus .compass-dial-wrap { max-width: 440px; }

/* ---------- Speedometer ---------- */
.speedo-card { text-align: center; }
.speedo-main { display: flex; align-items: baseline; justify-content: center; gap: .75rem; padding: 1rem 0 .5rem; }
.speedo-value { font-size: clamp(4rem, 18vw, 7rem); font-weight: 700; line-height: 1; }
.speedo-unit { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-full); padding: .35rem .9rem; font-size: 1rem; cursor: pointer; color: var(--text-muted); font-family: inherit; }
.speedo-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: 1rem 0; }
.speedo-stats > div { background: var(--bg-subtle); border-radius: var(--radius-md); padding: .6rem .25rem; }
.speedo-stats dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-subtle); }
.speedo-stats dd { margin: 0; font-size: 1.05rem; font-weight: 600; }
@media (max-width: 520px) { .speedo-stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- VPN checker ---------- */
.verdict-card .vpn-verdict { font-size: 1.35rem; font-weight: 700; margin: .25rem 0; }
.vpn-verdict.ok { color: var(--ok); } .vpn-verdict.warn { color: var(--warning); } .vpn-verdict.bad { color: var(--danger); }
.cmp-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.cmp-table th, .cmp-table td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.cmp-table th { color: var(--text-subtle); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.cmp-table code { background: var(--bg-subtle); padding: .1rem .35rem; border-radius: 4px; font-size: .82em; overflow-wrap: anywhere; }

/* ---------- w3w ---------- */
.w3w-value { font-size: 1.5rem; color: var(--danger); font-weight: 600; }

/* ---------- Moon ---------- */
.moon-visual { text-align: center; font-size: 3rem; line-height: 1; padding: .5rem 0; }

/* ---------- Place pages ---------- */
.place-index h3 { margin-top: 1.5rem; color: var(--text-muted); }
.place-list { list-style: none; padding: 0; margin: .25rem 0; columns: 2; column-gap: 2rem; }
.place-list li { padding: .3rem 0; break-inside: avoid; font-size: .92rem; }
@media (max-width: 640px) { .place-list { columns: 1; } }
.locator-card { text-align: center; margin: 1rem 0; padding: 1rem; }
.locator-card img { border-radius: var(--radius-md); }
.locator-card figcaption { font-size: .8rem; color: var(--text-subtle); margin-top: .5rem; }
.place-article { padding: 1rem 0; }
.place-article h2 { border-bottom: 1px solid var(--border); padding-bottom: .35rem; }
.place-article img { border-radius: var(--radius-md); margin: .5rem 0; }
.place-article table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.place-article th, .place-article td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--border); }
#place-page .coords-card { overflow-wrap: anywhere; }

/* ---------- Related / FAQ / footer ---------- */
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.related-card { display: flex; flex-direction: column; gap: .35rem; color: var(--text); font-size: .85rem; }
.related-card:hover { border-color: var(--accent); text-decoration: none; }
.related-card strong { color: var(--accent); }
.related-card span { color: var(--text-subtle); }
.faq-block { max-width: 800px; padding-bottom: 1rem; }
details.faq-item, .faq-block details { border-bottom: 1px solid var(--border); padding: .9rem 0; }
.faq-block details > summary { cursor: pointer; list-style: none; font-weight: 500; display: flex; justify-content: space-between; gap: 1rem; }
.faq-block details > summary::-webkit-details-marker { display: none; }
.faq-block details > summary::after { content: "+"; color: var(--text-subtle); }
.faq-block details[open] > summary::after { content: "−"; }
.faq-block details > div { margin-top: .6rem; color: var(--text-muted); }

.site-footer { border-top: 1px solid var(--border); background: var(--bg-elev); margin-top: 3rem; padding: 2.5rem 0 2rem; font-size: .85rem; }
.footer-brand { max-width: 420px; margin-bottom: 1.5rem; color: var(--text-muted); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1.5rem; }
.footer-col h3 { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-subtle); margin: 0 0 .5rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { padding: .18rem 0; }
.footer-col a { color: var(--text-muted); }
.footer-col a:hover { color: var(--accent); }
.footer-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--border); margin-top: 2rem; padding-top: 1.25rem; color: var(--text-subtle); }

/* ---------- Consent banner ---------- */
.consent-banner { position: fixed; bottom: 1rem; left: 1rem; right: 1rem; z-index: 90; display: flex; justify-content: center; }
.consent-inner { background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 1rem 1.25rem; max-width: 560px; }
.consent-inner p { margin: 0 0 .75rem; font-size: .88rem; }
.consent-actions { display: flex; gap: .5rem; justify-content: flex-end; }

/* ---------- Code blocks / API docs ---------- */
.code-block { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-md); padding: .9rem 1rem; overflow-x: auto; font-family: var(--font-mono); font-size: .82rem; line-height: 1.55; }
.key-block { font-size: 1rem; user-select: all; }
.api-table code { white-space: nowrap; }
.key-card { border-color: var(--accent); }

/* ---------- Embed builder ---------- */
.embed-opts fieldset { border: 1px solid var(--border); border-radius: var(--radius-md); margin: 0 0 .75rem; padding: .6rem .9rem; }
.embed-opts legend { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-subtle); padding: 0 .35rem; }
.embed-opts label { display: inline-flex; align-items: center; gap: .35rem; margin-right: 1rem; font-size: .9rem; }
.embed-opts input[type="text"], .embed-opts input[type="number"] { width: auto; padding: .3rem .5rem; }
.embed-preview { border: 1px dashed var(--border-strong); border-radius: var(--radius-md); padding: .5rem; min-height: 260px; }
.embed-preview iframe { width: 100%; border: 0; }

/* ---------- Batch geocoding (4.10) ---------- */
textarea { width: 100%; padding: .7rem .85rem; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg); color: var(--text); font: inherit; font-size: .9rem; resize: vertical; }
textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.progress-wrap { margin-top: .9rem; }
.progress-bar { height: 8px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: var(--radius-full); transition: width .3s ease; }
.table-scroll { max-height: 420px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.table-scroll table { margin: 0; }
.table-scroll thead th { position: sticky; top: 0; background: var(--bg-elev); z-index: 1; }
label[for="batch-file"] { cursor: pointer; }

/* ---------- Calendar feed card ---------- */
.calendar-card { border-color: var(--accent); margin-top: 1rem; }
.calendar-card .input-row { margin: .6rem 0; }

/* ---------- Infographics ---------- */
/* direction:ltr pins SVG text-anchor math to the authored x-coordinates even on RTL
   pages (Arabic/Hebrew/Urdu/Farsi guides) — glyphs inside each text run still shape RTL. */
.infographic { width: 100%; height: auto; margin: 1rem 0; direction: ltr; }
/* ...but direction:ltr also picks the bidi BASE for the text inside, and that
   part is not wanted: it made every label mixing an RTL run with a Latin token
   render its runs in English reading order — "موقعیت‌یابی Wi-Fi" put Wi-Fi on
   the wrong side, and "≈15–40 م" detached the number from its unit. plaintext
   takes the base direction from each label's own first strong character and
   leaves `direction` alone, so the anchor maths above still holds. Measured
   over all 48 RTL infographics: 140 labels change reading order, and the
   widest bounding-box shift is 0.56px — inside the 6px slack, so no budget
   moves. (diag_bidi.py in the pass-26 toolkit re-runs the comparison.) */
html[dir="rtl"] .infographic text { unicode-bidi: plaintext; }
.infographic-card { padding: 1rem; text-align: center; }
.infographic-card figcaption { font-size: .82rem; color: var(--text-muted); margin-top: .25rem; }

/* Infographic animations (guides & explainers) — pure CSS, theme-aware.
   Elements opt in via classes; per-element delays/origins are set inline.
   Everything degrades to the final static frame under prefers-reduced-motion. */
@keyframes ig-draw { to { stroke-dashoffset: 0; } }
@keyframes ig-pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes ig-breathe { 0%, 100% { transform: scale(.55); opacity: .9; } 70% { transform: scale(1.15); opacity: 0; } 71%, 99% { opacity: 0; } }
@keyframes ig-swing { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes ig-flow { to { stroke-dashoffset: -26; } }
.ig-draw { stroke-dasharray: 620; stroke-dashoffset: 620; animation: ig-draw 2.6s ease-out .3s forwards; }
.ig-draw-slow { stroke-dasharray: 820; stroke-dashoffset: 820; animation: ig-draw 3.4s ease-out 1.2s forwards; }
.ig-pulse { animation: ig-pulse 2.4s ease-in-out infinite; }
.ig-breathe { animation: ig-breathe 2.8s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.ig-swing { animation: ig-swing 3.6s ease-in-out infinite; transform-box: fill-box; }
.ig-flow { stroke-dasharray: 9 8; animation: ig-flow 1.1s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .ig-draw, .ig-draw-slow, .ig-pulse, .ig-breathe, .ig-swing, .ig-flow {
    animation: none !important; stroke-dashoffset: 0 !important; opacity: 1 !important;
  }
}

/* ---------- Multilingual (4.8): switcher, phrase chips, suggest banner, RTL ---------- */
.lang-switcher { border-top: 1px solid var(--border); margin-top: 2rem; padding-top: 1.25rem; }
.lang-switcher > summary { cursor: pointer; list-style: none; color: var(--text-muted); font-size: .85rem; }
.lang-switcher > summary::-webkit-details-marker { display: none; }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .35rem .9rem; margin-top: .9rem; }
.lang-grid a { color: var(--text-muted); font-size: .85rem; padding: .15rem 0; }
.lang-grid a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.switch-en { margin-inline-start: .5rem; }

.phrase-chips { display: flex; flex-wrap: wrap; gap: .5rem; padding-top: .5rem; padding-bottom: .5rem; }
.phrase-chip { font-size: .85rem; padding: .3rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-full); color: var(--text-muted); background: var(--bg-elev); }

.locale-suggest { position: fixed; bottom: 1rem; inset-inline-start: 50%; transform: translateX(-50%); z-index: 80;
  display: flex; align-items: center; gap: .75rem; background: var(--bg-elev); border: 1px solid var(--accent);
  border-radius: var(--radius-full); box-shadow: var(--shadow-lg); padding: .55rem 1.1rem; max-width: min(92vw, 480px); }
html[dir="rtl"] .locale-suggest { transform: translateX(50%); }
.locale-suggest a { font-size: .9rem; font-weight: 500; }
.locale-suggest button { background: none; border: none; color: var(--text-subtle); cursor: pointer; font-size: .9rem; padding: .15rem; }

/* RTL (ar / he / ur / fa): direction flips flex/grid automatically; fix the leftovers */
html[dir="rtl"] .main-nav { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .nav-more-panel { right: auto; left: 0; }
html[dir="rtl"] .theme-switcher-popover { right: auto; left: 0; }
html[dir="rtl"] .extra-list dd { text-align: left; }
html[dir="rtl"] .coord-value, html[dir="rtl"] .code-block { direction: ltr; unicode-bidi: embed; text-align: left; }
/* Inline <code> in running RTL prose was missed by the line above, which only
   covers the block form. Punctuation inside a code span is bidi-neutral, so it
   reorders against the surrounding Arabic/Hebrew: allow="geolocation" rendered
   as "allow="geolocation. isolate seals the span so its neutrals resolve
   against LTR, which is what a frozen code literal always wants. */
html[dir="rtl"] code { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] [data-theme="topo"] .crosshair::before { left: auto; right: -14px; }


/* ---------- SEO admin (/xr-seo) ---------- */
.status-pill { display: inline-block; padding: .12rem .55rem; border-radius: var(--radius-full); font-size: .72rem; font-weight: 600; border: 1px solid var(--border); color: var(--text-subtle); }
.st-submitted, .st-indexed { color: var(--ok); border-color: var(--ok); background: var(--accent-soft); }
.st-failed { color: var(--danger); border-color: var(--danger); }
.st-dry-run { color: var(--warning); border-color: var(--warning); }
.st-pending, .st-noop, .st-unconfigured { color: var(--text-subtle); }
.row-actions { display: flex; gap: .3rem; }
.row-actions form { display: inline; }
.row-actions button { background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; color: var(--text-muted); font-size: .72rem; padding: .15rem .45rem; }
.row-actions button:hover { color: var(--accent); border-color: var(--accent); }
select.date-input { width: auto; padding: .55rem .7rem; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg); color: var(--text); font: inherit; font-size: .9rem; }


/* ---------- Wave 2/3 tools ---------- */
.nav-more-panel { display: grid; grid-template-columns: 1fr 1fr; min-width: 440px; }
@media (max-width: 560px) { .nav-more-panel { grid-template-columns: 1fr; min-width: 230px; } }
.dropzone { text-align: center; padding: 2rem 1.25rem; border: 2px dashed var(--border-strong); }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-title { font-size: 1.05rem; font-weight: 500; }
.linklike { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
.qibla-pointer { fill: var(--danger); }
.qibla-label { font-size: 22px; }
.photo-preview-wrap { text-align: center; margin-bottom: .75rem; }
.photo-preview-wrap img { max-height: 220px; border-radius: var(--radius-md); border: 1px solid var(--border); }
.fv-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: .45rem; }

/* ---------- Misc ---------- */
::selection { background: var(--accent-soft); color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.shimmer { background: linear-gradient(90deg, var(--bg-subtle) 0%, var(--border) 50%, var(--bg-subtle) 100%); background-size: 200% 100%; animation: shimmer 1.5s ease-in-out infinite; color: transparent; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Leaflet theme overrides */
.leaflet-container { background: var(--bg-subtle) !important; font-family: inherit !important; }
html.dark .leaflet-tile { filter: invert(.92) hue-rotate(180deg) brightness(.95) contrast(.9); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--bg-elev) !important; color: var(--text) !important; border: 1px solid var(--border) !important; }
.leaflet-control-zoom a { background: var(--bg-elev) !important; color: var(--text) !important; border: 1px solid var(--border) !important; }
.leaflet-control-attribution { background: var(--bg-elev) !important; color: var(--text-muted) !important; font-size: 10px !important; }

/* ---------- Signup captcha (self-hosted) + honeypot ---------- */
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.captcha-box { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; margin: .75rem 0; }
.captcha-img { padding: .4rem .6rem; }
.captcha-svg { width: 190px; height: 56px; display: block; user-select: none; }
.captcha-box input[name="captcha"] { max-width: 10rem; letter-spacing: .35em; font-family: var(--font-mono, monospace); text-transform: uppercase; }

/* ---------- Map pick modal (W.pickOnMap — saved places & any coordinate input) ---------- */
.map-pick-overlay { position: fixed; inset: 0; z-index: 4000; background: rgba(8, 12, 10, .55); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.map-pick-dialog { background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-md); width: min(720px, 100%); max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 64px rgba(0, 0, 0, .4); }
.map-pick-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem 1rem; border-bottom: 1px solid var(--border); }
.map-pick-x { background: none; border: 0; color: var(--text); font-size: 1.5rem; line-height: 1; cursor: pointer; padding: .1rem .5rem; border-radius: 6px; }
.map-pick-x:hover { background: var(--bg-subtle); }
.map-pick-chips { display: flex; gap: .4rem; padding: .55rem 1rem; overflow-x: auto; border-bottom: 1px solid var(--border); scrollbar-width: thin; }
.map-pick-chips .chip { flex: 0 0 auto; background: var(--bg-elev); border: 1px solid var(--border); color: var(--text); border-radius: 999px; padding: .3rem .75rem; font-size: .8rem; cursor: pointer; font-family: inherit; transition: border-color .15s; }
.map-pick-chips .chip:hover { border-color: var(--accent); }
.map-pick-map { height: min(52vh, 420px); min-height: 260px; background: var(--bg-subtle); }
.map-pick-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem 1rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.map-pick-coords { font-size: .85rem; }
.map-pick-actions { display: inline-flex; gap: .5rem; }
html.map-pick-open, html.map-pick-open body { overflow: hidden; }

/* ---------- Recents dropdown (W.attachRecents on coordinate inputs) ---------- */
.recents-panel { position: absolute; z-index: 60; background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto; padding: .25rem; }
.recents-head { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-subtle); padding: .35rem .6rem .25rem; }
.recents-item { display: flex; flex-direction: column; align-items: flex-start; gap: .05rem; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: .45rem .6rem; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; font-size: .88rem; }
.recents-item:hover { background: var(--bg-subtle); }
.recents-coords { font-size: .75rem; }

/* ---------- Recents input (shared control) + QR share hero (pass 16) ---------- */
.recents-input input { width: 100%; }
.widget-recents { margin-top: .6rem; }
.widget-recents input { font-size: .85rem; }
.qr-share-card { text-align: center; padding: 1.6rem 1.25rem; }
.qr-share-coords { font-size: 1.05rem; margin: 0 0 .75rem; }
.qr-share-hero {
  display: inline-flex; align-items: center; gap: .9rem; text-align: left;
  background: var(--accent-gradient); color: var(--accent-on); border: 0; cursor: pointer;
  padding: 1.05rem 1.6rem; border-radius: 16px; font-family: inherit;
  box-shadow: 0 10px 30px var(--accent-ring), var(--shadow-md);
  transition: transform .16s ease, box-shadow .16s ease; max-width: 100%;
}
.qr-share-hero:hover { transform: translateY(-2px); box-shadow: 0 16px 40px var(--accent-ring), var(--shadow-lg); }
.qr-share-hero:active { transform: translateY(0); }
.qr-share-hero svg { flex: none; }
.qr-share-hero strong { display: block; font-size: 1.05rem; letter-spacing: -0.01em; }
.qr-share-hero small { display: block; opacity: .85; font-size: .8rem; margin-top: .15rem; }
.qr-share-result { margin-top: 1.25rem; }
.qr-share-canvas { width: min(280px, 70vw); margin: 0 auto .75rem; background: #fff; padding: 12px; border-radius: 12px; box-shadow: var(--shadow-md); }
.qr-share-canvas svg { display: block; width: 100%; height: auto; }
.qr-share-result .compass-controls { justify-content: center; }

/* ---------- /xr-seo login form ---------- */
.login-form { padding: 1.5rem; }
.login-form .card-label { margin-bottom: .4rem; }
.login-form input + .card-label { margin-top: 1rem; display: block; }
.login-alt { margin: 1.1rem 0 .25rem; border-top: 1px solid var(--border); padding-top: .9rem; }
.login-alt summary { cursor: pointer; color: var(--text-subtle); font-size: .85rem; list-style: none; }
.login-alt summary::before { content: "▸ "; font-size: .75em; }
.login-alt[open] summary::before { content: "▾ "; }
.login-alt summary::-webkit-details-marker { display: none; }
.login-alt .card-label { margin-top: .9rem; display: block; }
.login-form .btn-primary { margin-top: 1.25rem; }

/* ---------------------------------------------------------------- Google AdSense
   Slots render only when enabled at /xr-seo/ads, so on an install that has not opted in
   none of these rules match anything.

   min-height is set inline per slot by _AdSlot.cshtml rather than here: AdSense fills
   asynchronously, and without space reserved up front every fill shoves the article down
   and books a layout shift against a site whose whole pitch is an instant answer. */
.ad-slot {
    margin: 2rem auto;
    text-align: center;
    /* contain the unit so a mis-sized creative cannot widen the page and cause a
       horizontal scrollbar on mobile */
    max-width: 100%;
    overflow: hidden;
}

.ad-label {
    display: block;
    font-size: .68rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: .4rem;
}

/* The label is a disclosure, not decoration — it stays legible in both themes and is not
   hidden on small screens, because labelling paid placement is the honest default. */
html[dir="rtl"] .ad-slot { direction: rtl; }
html[dir="rtl"] .ad-slot .adsbygoogle { direction: ltr; }

.ad-anchor {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;              /* under the consent banner, which site.js also gates on */
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: .25rem .5rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.ad-anchor-close {
    flex: 0 0 auto;
    width: 1.6rem;
    height: 1.6rem;
    line-height: 1;
    font-size: 1.1rem;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg);
    color: var(--muted);
    cursor: pointer;
}

.ad-anchor .adsbygoogle { flex: 1 1 auto; }

/* Never in print, and never for readers who have asked for reduced motion to be respected
   in the layout sense — an overlay that follows the viewport is exactly what that asks
   against. */
@media print {
    .ad-slot, .ad-anchor { display: none !important; }
}
