/* GeoLocatify — site styles. No framework. Mobile first. */

:root {
  --c-bg: #f6f8fa;
  --c-surface: #ffffff;
  --c-text: #1d2733;
  --c-muted: #5a6675;
  --c-border: #d7dee6;
  --c-primary: #0f5c8c;
  --c-primary-dark: #0b4569;
  --c-primary-soft: #e6f0f7;
  --c-ok: #1d7a3e;
  --c-warn: #8a5a00;
  --c-error: #b3261e;
  --radius: 8px;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 1px 3px rgb(16 24 40 / 10%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --container: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.6 var(--font);
  color: var(--c-text);
  background: var(--c-bg);
}
img, svg { max-width: 100%; }
a { color: var(--c-primary); text-underline-offset: 2px; }
a:hover { color: var(--c-primary-dark); }
:focus-visible { outline: 3px solid #f0a500; outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 1.4em 0 .5em; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); margin-top: .3em; }
h2 { font-size: 1.4rem; }
h3, .h3 { font-size: 1.15rem; }
p, ul, ol, dl { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .92em; background: var(--c-primary-soft); padding: 0 .25em; border-radius: 3px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 2000; background: #fff; padding: 8px 12px; }
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- header / navigation ---------- */
/* Sticky header: stays at the top while scrolling; a soft shadow appears once the page is scrolled. */
html { scroll-padding-top: calc(var(--header-h, 61px) + 12px); }
:target, main [id] { scroll-margin-top: calc(var(--header-h, 61px) + 12px); }
.site-header {
  background: var(--c-surface); border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; z-index: 1100; transition: box-shadow .2s ease;
}
.site-header.is-scrolled { box-shadow: 0 2px 10px rgb(16 24 40 / 12%); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 1.25rem; color: var(--c-text); text-decoration: none; }
.logo svg { color: var(--c-primary); }
.nav-toggle {
  display: none; font: inherit; padding: 6px 12px; border: 1px solid var(--c-border);
  border-radius: var(--radius); background: var(--c-surface); cursor: pointer;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav > ul { display: flex; gap: 4px; align-items: center; }
.site-nav a, .site-nav summary {
  display: block; padding: 8px 12px; border-radius: var(--radius); color: var(--c-text);
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.site-nav a:hover, .site-nav summary:hover { background: var(--c-primary-soft); }
.site-nav a[aria-current="page"] { color: var(--c-primary); font-weight: 600; }
.tools-menu { position: relative; }
.tools-menu summary { list-style: none; }
.tools-menu summary::-webkit-details-marker { display: none; }
.tools-menu summary::after { content: ""; display: inline-block; margin-left: 6px; border: 5px solid transparent; border-top-color: currentColor; transform: translateY(3px); }
.tools-menu[open] summary::after { transform: translateY(-2px) rotate(180deg); }
.tools-menu ul {
  position: absolute; right: 0; top: calc(100% + 4px); min-width: 260px; padding: 6px;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow);
}
@media (min-width: 761px) {
  .tools-menu ul {
    display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 0 4px;
    max-height: calc(100vh - var(--header-h, 61px) - 24px); overflow-y: auto;
  }
  /* invisible bridge over the 4px gap so the pointer never "leaves" the menu on its way down */
  .site-nav .has-sub { position: relative; }
  .site-nav .has-sub:has(details[open])::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 6px; }
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; width: 100%; padding-bottom: 8px; }
  /* the open menu scrolls inside the sticky header instead of running off-screen */
  .site-nav.open { display: block; max-height: calc(100vh - var(--header-h, 61px)); max-height: calc(100dvh - var(--header-h, 61px)); overflow-y: auto; overscroll-behavior: contain; }
  .site-nav > ul { flex-direction: column; align-items: stretch; }
  .tools-menu ul { position: static; box-shadow: none; border: 0; padding: 0 0 0 12px; min-width: 0; }
}

/* ---------- breadcrumb ---------- */
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 16px 0 0; font-size: .9rem; color: var(--c-muted); }
.breadcrumb li + li::before { content: "›"; margin-right: 4px; }

/* ---------- tool layout ---------- */
/* space between the last box and the footer (main.container: .container's padding shorthand would reset it) */
main, main.container { padding-bottom: 40px; }
@media (max-width: 640px) { main, main.container { padding-bottom: 28px; } }
.tool-grid { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .tool-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } }
.tool-panel, .map-wrap, .content, .faq {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.tool-panel { padding: 16px; }
.tool-panel > :first-child { margin-top: 0; }
.tool-map { position: sticky; top: calc(var(--header-h, 61px) + 12px); }
.map-wrap { overflow: hidden; }
.map { height: 360px; background: #e8eef3; }
@media (min-width: 900px) { .map { height: 460px; } }
.map-actions { display: flex; align-items: center; justify-content: center; gap: 10px 12px; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid var(--c-border); text-align: center; }
.map-actions .status { flex-basis: 100%; }
.gmaps-dir-row { margin: 4px 0 8px; }
.gmaps-dir-row:has(> [hidden]) { display: none; }
.map-actions .status:empty { display: none; }
.btn .btn-icon { flex: none; }

.content, .faq { padding: 4px 20px 12px; margin-top: 20px; }
.content > :first-child { margin-top: 16px; }
.prose { max-width: none; }
.faq details { border-top: 1px solid var(--c-border); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; }

/* ---------- forms ---------- */
.field { margin-bottom: 12px; position: relative; }
.field label, .dms label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 4px; }
.field-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.field-small { max-width: 220px; }
input[type=text], input[type=search], input[type=email], input:not([type]), select, textarea {
  width: 100%; font: inherit; padding: 9px 11px; color: var(--c-text); background: #fff;
  border: 1px solid #9aa7b5; border-radius: var(--radius);
}
textarea { resize: vertical; min-height: 140px; }
input:focus, select:focus, textarea:focus { border-color: var(--c-primary); outline: 2px solid var(--c-primary-soft); outline-offset: 0; }
[aria-invalid="true"] { border-color: var(--c-error) !important; }
.field-error { color: var(--c-error); font-size: .9rem; margin: 4px 0 0; }
.hint { color: var(--c-muted); font-size: .95rem; }
.hint-list { color: var(--c-muted); padding-left: 1.2em; }
.req { font-weight: 400; color: var(--c-muted); font-size: .85em; }
fieldset.dms { border: 1px solid var(--c-border); border-radius: var(--radius); padding: 8px 12px 4px; margin: 0 0 12px; }
fieldset.dms legend { font-weight: 700; padding: 0 4px; }
.dms-row { display: grid; gap: 8px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dms-row label { font-weight: 400; font-size: .85rem; color: var(--c-muted); }
@media (max-width: 480px) { .dms-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; padding: 9px 16px; border-radius: var(--radius); cursor: pointer;
  color: #fff; background: var(--c-primary); border: 1px solid var(--c-primary);
}
.btn:hover { background: var(--c-primary-dark); }
a.btn, a.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-secondary { color: var(--c-primary); background: #fff; }
.btn-secondary:hover { background: var(--c-primary-soft); }
.linklike { font: inherit; color: var(--c-primary); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

.status { margin: 6px 0 0; font-size: .92rem; min-height: 1.2em; color: var(--c-muted); }
.status[data-kind="error"] { color: var(--c-error); }
.status[data-kind="warn"] { color: var(--c-warn); }
.status[data-kind="ok"] { color: var(--c-ok); }
.map-actions .status { margin: 0; }

.notice { padding: 10px 14px; border-radius: var(--radius); border: 1px solid; }
.notice-ok { color: var(--c-ok); background: #eaf6ee; border-color: #b7dfc3; }
.notice-error { color: var(--c-error); background: #fbeceb; border-color: #f0c2be; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- results ---------- */
.results { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 16px 0 8px; }
.result { position: relative; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 8px 10px; background: #fbfcfd; min-width: 0; }
.result-wide, .result-row { grid-column: 1 / -1; }
/* the copy icon sits in the top right corner beside the label, so the value keeps the full width */
.result dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--c-muted); padding-right: 30px; min-height: 22px; }
.result dd { margin: 2px 0 0; }
.result output { display: block; font-family: var(--mono); font-size: .98rem; overflow-wrap: break-word; min-width: 0; }
.result-wide output { font-family: var(--font); }
/* one part of a value ("lat," / "long", "51.24°" / "(51° 14' 29") NE"): wraps as a whole */
.vp { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
.copy {
  position: absolute; top: 3px; right: 3px; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; border-radius: 8px; cursor: pointer;
  border: 0; background: transparent; color: var(--c-primary);
}
.copy:hover { background: var(--c-primary-soft); }
.copy:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 1px; }
.copy.copied { color: var(--c-ok); background: #eaf6ee; }

.card { border: 1px solid var(--c-border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 16px; background: #fbfcfd; }
/* Key-value lists: <dl class="kv"><div class="kv-row"><dt>…</dt><dd>…</dd></div>…</dl>.
   Two columns when there is room, label above value in narrow containers. Values wrap only
   at spaces; .nw keeps a token (IP, coordinates, zone id, date) on one line. */
.kv { container-type: inline-size; margin: 0; }
.kv-row { display: grid; grid-template-columns: minmax(7.5rem, 38%) minmax(0, 1fr); gap: 2px 14px; padding: 7px 0; border-top: 1px solid var(--c-border); }
.kv-row:first-child { border-top: 0; padding-top: 2px; }
.kv dt { color: var(--c-muted); font-size: .93rem; }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: break-word; }
.kv .kv-sub { display: block; font-weight: 400; font-size: .85rem; color: var(--c-muted); }
@container (max-width: 420px) {
  .kv-row { grid-template-columns: minmax(0, 1fr); gap: 1px; }
  .kv dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; }
  .kv dd { font-size: 1.02rem; }
}
.nw { white-space: nowrap; }
.num-val { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; }
.badge { display: inline-block; margin-left: 6px; padding: 0 6px; font-size: .74rem; font-weight: 700; line-height: 1.5; letter-spacing: .03em;
  color: var(--c-primary-dark); background: var(--c-primary-soft); border: 1px solid #c9dbe8; border-radius: 4px; vertical-align: 1px; }

/* "Copy lat, long" icon (assets/js/llcopy.js): .ll-pill = coordinates + icon, .ll-mini = icon only */
.ll-pill { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin: 6px 0 0; padding: 3px 3px 3px 10px;
  background: #fff; border: 1px solid var(--c-border); border-radius: 10px; vertical-align: middle; }
.ll-val { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; font-size: .92rem; white-space: nowrap; color: var(--c-text); }
.ll-mini { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; vertical-align: middle;
  color: var(--c-primary); background: var(--c-primary-soft); border: 0; border-radius: 8px; cursor: pointer; }
.ll-mini:hover { background: #d6e6f2; }
.ll-mini:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 1px; }
.ll-mini.copied { color: var(--c-ok); background: #eaf6ee; }
.ll-cell .ll-mini { width: 30px; height: 30px; }
.ll-toast { position: fixed; z-index: 3000; left: 50%; bottom: 20px; transform: translate(-50%, 20px); max-width: calc(100vw - 32px);
  padding: 9px 14px; border-radius: var(--radius); background: #1d2733; color: #fff; font-size: .92rem; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; overflow-wrap: break-word; }
.ll-toast.show { opacity: 1; transform: translate(-50%, 0); }
.ll-toast[data-kind="warn"] { background: var(--c-warn); }

/* "Use my current location" button inside search inputs (assets/js/autocomplete.js) */
.input-locate { position: relative; display: block; }
.input-locate > input { padding-right: 46px; }
.locate-in { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 38px; height: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; color: var(--c-primary); background: none; border: 0; border-radius: 6px; cursor: pointer; }
.locate-in:hover, .locate-in:focus-visible { background: var(--c-primary-soft); }
.locate-in[aria-busy="true"] svg { animation: locate-spin 1s linear infinite; }
@keyframes locate-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .locate-in[aria-busy="true"] svg { animation: none; opacity: .5; } }

/* ---------- autocomplete ---------- */
.ac-list {
  position: absolute; z-index: 1200; left: 0; right: 0; margin: 2px 0 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow);
  max-height: 300px; overflow-y: auto;
}
.ac-list li { padding: 7px 9px; border-radius: 6px; cursor: pointer; font-size: .95rem; }
.ac-list li[aria-selected="true"], .ac-list li:hover { background: var(--c-primary-soft); }
.ac-list li.ac-picked { font-weight: 600; box-shadow: inset 3px 0 0 var(--c-primary); }

/* ---------- guides ---------- */
.guide-list { list-style: none; padding: 0; }
.guide-list li { border-top: 1px solid var(--c-border); padding: 4px 0 8px; }
.meta { color: var(--c-muted); font-size: .9rem; }
.link-list { columns: 2 220px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--c-border); background: var(--c-surface); padding: 18px 0 80px; font-size: .92rem; color: var(--c-muted); }
.footer-inner p { margin: 0 0 6px; }
.footer-links { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* ---------- cookie banner ---------- */
.consent {
  position: fixed; z-index: 1500; left: 12px; right: 12px; bottom: 12px; max-width: 560px; margin: 0 auto;
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: 0 8px 30px rgb(16 24 40 / 20%);
  padding: 14px 16px; font-size: .95rem;
}
.consent[hidden] { display: none; }
.consent p { margin: 0 0 8px; }
.consent-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- tools added in phase 1 ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sub-tool { border-top: 1px solid var(--c-border); margin-top: 16px; padding-top: 10px; }
.sub-tool > summary { cursor: pointer; font-weight: 600; color: var(--c-primary); }
.sub-tool[open] > summary { margin-bottom: 8px; }

/* lettered map markers (A, B, M) */
.pin-label span {
  display: flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c-primary);
  border: 2px solid #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 35%);
  color: #fff; font: 700 14px/1 var(--font);
}
.pin-label b { transform: rotate(45deg); }
.pin-mid span { background: #c05600; }
/* area calculator corners */
.vertex { background: #fff; border: 3px solid var(--c-primary); border-radius: 50%; box-shadow: 0 1px 3px rgb(0 0 0 / 35%); cursor: move; }

/* compass */
.compass-panel { text-align: center; }
.compass { position: relative; width: min(280px, 80vw); aspect-ratio: 1; margin: 8px auto 4px; }
.compass svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.compass-dial { transition: transform .12s linear; will-change: transform; }
.dial-bg { fill: #fff; stroke: var(--c-border); stroke-width: 3; }
.dial-ticks line { stroke: var(--c-muted); stroke-width: 2; }
.dial-n, .dial-l { font: 700 20px var(--font); text-anchor: middle; fill: var(--c-text); }
.dial-n { fill: var(--c-error); font-size: 24px; }
.needle-up { fill: var(--c-error); }
.needle-down { fill: #9aa7b5; }
.needle-hub { fill: var(--c-text); }
.compass-reading { font: 700 2rem/1.2 var(--mono); margin: 0 0 8px; }
.compass-actions { justify-content: center; }
.compass-panel .results { text-align: left; }

/* tables in guides and tool texts */
.content table { border-collapse: collapse; width: 100%; margin: 0 0 1em; font-size: .95rem; display: block; overflow-x: auto; }
.content th, .content td { border: 1px solid var(--c-border); padding: 6px 10px; text-align: left; vertical-align: top; }
.content thead th { background: var(--c-primary-soft); }

/* Leaflet popups use our font */
.leaflet-container { font: 13px/1.4 var(--font); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- place pages (/place/) ---------- */
.lead, .place-intro p { font-size: 1.05rem; max-width: 75ch; }
.place-intro { margin-bottom: 16px; }
.results-1 { grid-template-columns: 1fr; }
/* latitude beside longitude: one row per format */
.results-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 480px) {
  /* keep a DMS value such as 151° 12' 53.99" E on one line in half a phone screen */
  .results-pairs .result { padding: 8px; }
  .results-pairs .result dt { font-size: .72rem; letter-spacing: 0; padding-right: 26px; }
  .results-pairs .result output { font-size: .8rem; }
}
.place-facts { margin-top: 4px; }
.fact-note { display: block; font-weight: 400; font-size: .85rem; color: var(--c-muted); }
.map-lazy { display: flex; align-items: center; justify-content: center; }
.map-placeholder { color: var(--c-muted); margin: 0; }
.table-wrap { overflow-x: auto; margin: 0 0 1em; position: relative; }   /* relative: keeps .visually-hidden headings inside the scroller */
.place-table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.content .place-table { display: table; margin: 0; }
.place-table caption { text-align: left; color: var(--c-muted); font-size: .9rem; padding: 0 0 6px; }
.content .place-table th, .content .place-table td, .place-table th, .place-table td { border: 0; border-bottom: 1px solid var(--c-border); padding: 6px 10px; text-align: left; vertical-align: top; }
.place-table thead th { background: var(--c-primary-soft); }
.place-table tbody th { font-weight: 600; }
.content .place-table .num, .place-table .num { text-align: right; white-space: nowrap; }
.place-search { margin-bottom: 20px; }
.place-results { list-style: none; padding: 0; margin: 0 0 8px; columns: 2 260px; }
.place-results li { padding: 3px 0; break-inside: avoid; }
.place-source { margin-top: 16px; }
.continent-group[hidden] { display: none; }
/* ---------- batch geocoding + track viewer ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.seg { border: 1px solid var(--c-border); border-radius: var(--radius); padding: 6px 12px 8px; margin: 0 0 12px; }
.seg legend { font-weight: 700; padding: 0 4px; }
.seg label, .check, .field label.check { display: flex; gap: 8px; align-items: baseline; font-weight: 400; padding: 3px 0; cursor: pointer; }
.label-like { display: block; font-size: .95rem; margin-bottom: 4px; }
.batch progress { width: 100%; height: 10px; margin-top: 10px; accent-color: var(--c-primary); }
.batch-out tr[data-status="not found"] td, .batch-out tr[data-status^="error"] td { color: var(--c-error); }
.drop { border: 2px dashed var(--c-border); border-radius: var(--radius); padding: 16px; text-align: center; background: #fbfcfd; }
.drop.drag { border-color: var(--c-primary); background: var(--c-primary-soft); }
.drop .hint { margin: 8px 0 4px; }
.drop label.btn { display: inline-flex; font-weight: 600; margin: 0; color: #fff; cursor: pointer; }
.profile { margin: 12px 0; }
.profile figcaption { font-weight: 600; font-size: .95rem; margin-bottom: 4px; }
.profile svg { display: block; width: 100%; height: 160px; background: #fbfcfd; border: 1px solid var(--c-border); border-radius: var(--radius); touch-action: none; cursor: crosshair; }
.profile-area { fill: rgb(15 92 140 / 15%); }
.profile-line { fill: none; stroke: var(--c-primary); stroke-width: 2; }
.profile-cursor { stroke: #c05600; stroke-width: 1.5; }
/* sortable reference tables */
.sort-btn { font: inherit; font-weight: 700; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
.sort-btn::after { content: " ↕"; color: var(--c-muted); font-weight: 400; }
th[aria-sort="ascending"] .sort-btn::after { content: " ▲"; color: var(--c-primary); }
th[aria-sort="descending"] .sort-btn::after { content: " ▼"; color: var(--c-primary); }
.place-table tr[hidden] { display: none; }
a.src { font-size: .85em; }
/* code blocks in guides */
.content pre { overflow-x: auto; background: var(--c-primary-soft); padding: 10px 12px; border-radius: var(--radius); font-size: .9rem; }
.content pre code { background: none; padding: 0; }
.content code { overflow-wrap: anywhere; }

/* the hidden attribute always wins over display rules such as .btn or .field-row */
[hidden] { display: none !important; }

/* borough / district notice on place pages */
.place-part-of { background: var(--c-primary-soft); border-left: 4px solid var(--c-primary); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 16px; max-width: 75ch; font-size: 1.05rem; }
.place-part-of a { font-weight: 600; }
td.ll-cell { width: 1%; white-space: nowrap; padding-top: 2px; padding-bottom: 2px; }
.leaflet-popup-content .ll-pill { display: flex; width: max-content; }

/* Google Maps area (assets/js/gmaps.js): shown/hidden in the page, right below its button */
.gmaps-area { display: flex; flex-direction: column; border-top: 1px solid var(--c-border); background: var(--c-surface); }
.gmaps-area[hidden] { display: none; }
.gmaps-dir-row + .gmaps-area { margin: 0 0 12px; border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.gmaps-head { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-bottom: 1px solid var(--c-border); }
.gmaps-title { flex: 1; min-width: 0; margin: 0; font-size: 1rem; }
.gmaps-types { flex: none; display: inline-flex; border: 1px solid var(--c-border); border-radius: 8px; overflow: hidden; }
.gmaps-types button { font: inherit; font-size: .88rem; padding: 5px 11px; border: 0; background: #fff; color: var(--c-text); cursor: pointer; }
.gmaps-types button + button { border-left: 1px solid var(--c-border); }
.gmaps-types button[aria-pressed="true"] { background: var(--c-primary); color: #fff; }
.gmaps-close { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 8px;
  background: none; color: var(--c-text); cursor: pointer; }
.gmaps-close:hover { background: var(--c-primary-soft); }
.gmaps-body { position: relative; height: clamp(320px, 60vh, 480px); background: #e8eef3; }
.gmaps-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.gmaps-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; padding: 20px; text-align: center; color: var(--c-muted); pointer-events: none; }
.gmaps-area.loaded .gmaps-msg { display: none; }
.gmaps-area.failed .gmaps-frame { display: none; }
.gmaps-foot { padding: 7px 14px; border-top: 1px solid var(--c-border); font-size: .9rem; text-align: right; }
@media (max-width: 640px) {
  .gmaps-head { padding-left: 10px; gap: 6px; }
  .gmaps-title { font-size: .95rem; }
  .gmaps-foot { text-align: center; }
}
}
