/* ---------- cores (tema claro e escuro) ---------- */
:root, [data-theme="light"] {
  color-scheme: light;
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f1efe9;
  --ink: #16201b;
  --ink-2: #3a4640;
  --muted: #5f6a63;
  --line: #e7e3da;
  --line-2: #d8d3c7;
  --brand: #12603f;
  --brand-ink: #0e5134;
  --brand-soft: #e2efe7;
  --on-brand: #ffffff;
  --fresh: #c2410c;
  --warn: #b4321f;
  --warn-soft: #fbe8e3;
  --wa: #1fa855;
  --amber: #8a5a00;
  --amber-soft: #fdf3dc;
  --wa-soft: #e9f7ee;
  --wa-ink: #0f6b33;
  --ok-soft: #e3f4e8; --ok-ink: #17773c;
  --shadow-sm: 0 1px 2px rgba(22, 32, 27, .06);
  --shadow: 0 1px 2px rgba(22, 32, 27, .05), 0 6px 20px rgba(22, 32, 27, .07);
  --shadow-lg: 0 12px 40px rgba(22, 32, 27, .16);
  --scrim: rgba(22, 32, 27, .36);
  /* cores por tipo de vaga: fundo forte e vibrante + texto com contraste ≥ 4,5:1 (badge, legenda e ponto no pino) */
  --c-single: #1d6fe8; --c-single-ink: #ffffff;
  --c-double: #a21caf; --c-double-ink: #ffffff;
  --c-shared: #d4410b; --c-shared-ink: #ffffff;
  --c-studio: #0e7c70; --c-studio-ink: #ffffff;
  --c-house: #c81e5b; --c-house-ink: #ffffff;
  --c-other: #5b6560; --c-other-ink: #ffffff;
  /* pinos do mapa: escuros no tema claro (destacam no mapa claro) */
  --pin-bg: #16201b; --pin-ink: #ffffff; --pin-line: #ffffff;
  /* ponto do tipo dentro do pino escuro: tons claros para aparecer */
  --p-single: #5aa2ff; --p-double: #e879f9; --p-shared: #ff9a3d; --p-studio: #2fd4bd; --p-house: #ff6f9f; --p-other: #aab4ae;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111614;
  --surface: #181e1b;
  --surface-2: #1e2622;
  --ink: #e9eeeb;
  --ink-2: #c3cdc7;
  --muted: #8f9a94;
  --line: #2a332f;
  --line-2: #36413c;
  --brand: #3fb07b;
  --brand-ink: #7fd3a8;
  --brand-soft: #1d3a2d;
  --on-brand: #0c1410;
  --fresh: #ff7a52;
  --warn: #ff8f7a;
  --warn-soft: #3a211c;
  --wa: #25c264;
  --amber: #f2b84b;
  --amber-soft: #352a14;
  --wa-soft: #17301f;
  --wa-ink: #6fe09c;
  --ok-soft: #173322; --ok-ink: #74dc9b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 14px 44px rgba(0, 0, 0, .55);
  --scrim: rgba(0, 0, 0, .55);
  --c-single: #5aa2ff; --c-single-ink: #0c1410;
  --c-double: #e879f9; --c-double-ink: #0c1410;
  --c-shared: #ff9a3d; --c-shared-ink: #0c1410;
  --c-studio: #2fd4bd; --c-studio-ink: #0c1410;
  --c-house: #ff6f9f; --c-house-ink: #0c1410;
  --c-other: #aab4ae; --c-other-ink: #0c1410;
  /* pinos do mapa: claros no tema escuro */
  --pin-bg: #f2f5f3; --pin-ink: #111614; --pin-line: #111614;
  --p-single: #1d6fe8; --p-double: #a21caf; --p-shared: #d4410b; --p-studio: #0e7c70; --p-house: #c81e5b; --p-other: #5b6560;
}

:root {
  --radius: 16px;
  --radius-sm: 11px;
  --sb-w: 440px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--sb-w) 1fr;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -40px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 8px; }

/* ---------- barra lateral ---------- */
.sidebar {
  position: relative; z-index: 3;
  background: var(--bg); border-right: 1px solid var(--line);
  overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; min-height: 0;
  scrollbar-width: thin;
}
.sb-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 6px; padding-top: max(16px, env(safe-area-inset-top)); }
.brand { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.logo { width: 32px; height: 32px; flex: none; display: block; }
.brand-name { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.brand-name span { color: var(--brand); }
/* seletor em menu (região no topo e ordenação da lista): mesmo visual nos dois */
.dd { position: relative; }
.dd summary {
  list-style: none; display: flex; align-items: center; gap: 3px; cursor: pointer; user-select: none; white-space: nowrap;
  padding: 4px 8px 4px 10px; border-radius: 99px; background: var(--surface-2); font-weight: 600; font-size: 13px;
  transition: background .15s;
}
.dd summary:hover { background: var(--line); }
.dd summary::-webkit-details-marker { display: none; }
.dd summary svg { width: 15px; height: 15px; transition: transform .2s; flex: none; }
.dd[open] summary svg { transform: rotate(180deg); }
.dd.end .menu { left: auto; right: 0; }
.dd summary .globe { width: 15px; height: 15px; margin-right: 2px; color: var(--muted); }
.dd[open] summary .globe { transform: none; }
.menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 230px; z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px;
}
.menu p { margin: 6px 10px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.menu li { list-style: none; display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 9px; font-size: 14px; }
.menu ul { margin: 0; padding: 0; }
.menu li.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.menu li.soon { color: var(--muted); }
.menu li small { font-size: 12px; }
.menu .opt {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left;
  border: 0; background: none; padding: 9px 10px; border-radius: 9px; font-size: 14px;
}
.menu .opt:hover:not(:disabled) { background: var(--surface-2); }
.menu .opt[aria-checked="true"] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.menu .opt svg { width: 16px; height: 16px; stroke-width: 2.4; flex: none; }
.menu .opt:disabled { color: var(--muted); cursor: not-allowed; }
.menu .opt small { display: block; font-size: 12px; font-weight: 400; }
.sb-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2);
  display: grid; place-items: center; transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 19px; height: 19px; }

.live {
  display: flex; align-items: center; gap: 7px; margin: 2px 18px 12px; font-size: 13px; color: var(--muted);
  cursor: default;
}
.live b { color: var(--fresh); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; }
.live i, .map-live i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--fresh); flex: none; }
.live i::after, .map-live i::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--fresh);
  animation: ping 2s var(--ease) infinite;
}
.live.off b { color: var(--muted); }
.live.off i, .map-live.off i { background: var(--muted); }
.live.off i::after, .map-live.off i::after { display: none; }
@keyframes ping { 0% { transform: scale(.4); opacity: 1; } 80%, 100% { transform: scale(1.5); opacity: 0; } }

/* ---------- ferramentas (filtros, perto de mim, ordenar) ---------- */
.tools { position: sticky; top: 0; z-index: 6; background: var(--bg); padding: 2px 18px 12px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }

.row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.row > * { flex: none; }

/* preço: rótulo, controle e valor numa linha só */
.price { display: flex; align-items: center; gap: 12px; min-height: 36px; }
.price label { font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.price output { min-width: 86px; text-align: right; font-size: 13.5px; font-weight: 700; color: var(--brand-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { flex: 1; min-width: 0; width: 100%; accent-color: var(--brand); height: 26px; margin: 0; cursor: pointer; }

/* tipos, contas e "perto de mim": todos com a mesma altura */
.types { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; height: 32px;
  border: 1px solid var(--line-2); background: var(--surface); border-radius: 99px;
  padding: 0 12px 0 10px; font-weight: 600; font-size: 13px; color: var(--ink-2); transition: background .15s, border-color .15s, color .15s;
}
.pill[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.clear-f { border: 0; background: none; padding: 0 6px; height: 32px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.clear-f:hover { color: var(--ink); }
.clear-f[hidden] { display: none; }
.tools .lg { height: 32px; padding: 0 12px 0 10px; font-size: 13px; border-color: var(--line-2); }
.pill:hover { border-color: var(--muted); }
.pill svg { width: 16px; height: 16px; }
.place {
  display: flex; align-items: center; gap: 10px; margin-top: 8px;
  background: var(--brand-soft); color: var(--brand-ink); border-radius: 12px; padding: 4px 4px 4px 12px; font-size: 13px; font-weight: 600;
}
.place[hidden] { display: none; }
.place label { white-space: nowrap; }
.place input[type="range"] { flex: 1; min-width: 60px; }
.place output { min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
.place svg { width: 16px; height: 16px; flex: none; }
.place button { border: 0; background: transparent; color: inherit; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.place button:hover { background: rgba(127, 127, 127, .15); }
.place button svg { width: 16px; height: 16px; }

/* ---------- lista ---------- */
.list-head { padding: 4px 18px 8px; }
.lh-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.list-head h1 { margin: 0; font-family: 'Bricolage Grotesque', sans-serif; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.cards { list-style: none; margin: 0; padding: 0 12px 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }

.card {
  position: relative; border-radius: var(--radius); border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.card:hover, .card.hover { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-sm); }
.card.active { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.card.enter { animation: enter .8s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(-6px); background: var(--brand-soft); } }
.card-main { width: 100%; min-width: 0; display: flex; align-items: flex-start; text-align: left; border: 0; background: none; padding: 12px 10px 12px 14px; border-radius: var(--radius); }
.c-body { flex: 1; min-width: 0; display: block; }
.c-top { display: flex; align-items: baseline; gap: 8px; }
.c-price { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.c-price small { font-family: 'DM Sans', sans-serif; font-weight: 500; font-size: 13px; color: var(--muted); letter-spacing: 0; }
.c-price.na { font-size: 16px; color: var(--ink-2); }
.d-price.na { font-size: 22px; color: var(--ink-2); }
.c-time { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.c-time.fresh { color: var(--fresh); font-weight: 600; }
.c-time svg, .c-meta .avail svg { width: 13px; height: 13px; flex: none; opacity: .8; }
.c-meta .avail { display: inline-flex; align-items: center; gap: 5px; }
.c-title { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-weight: 600; font-size: 14.5px; color: var(--ink); min-width: 0; }
.c-title > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* badge do tipo (cores por categoria) */
.tb { flex: none; display: inline-block; padding: 2px 9px; border-radius: 7px; font-size: 12px; font-weight: 700; letter-spacing: .01em; line-height: 1.5; }
.c-single { --c: var(--c-single); --ci: var(--c-single-ink); }
.c-double { --c: var(--c-double); --ci: var(--c-double-ink); }
.c-shared { --c: var(--c-shared); --ci: var(--c-shared-ink); }
.c-studio { --c: var(--c-studio); --ci: var(--c-studio-ink); }
.c-house { --c: var(--c-house); --ci: var(--c-house-ink); }
.c-other { --c: var(--c-other); --ci: var(--c-other-ink); }
.tb { background: var(--c); color: var(--ci); }

/* legenda = filtro rápido por tipo */
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lg {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 99px;
  border: 1px solid var(--line); background: transparent; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  transition: background .15s, border-color .15s;
}
.lg i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.lg:hover { border-color: var(--line-2); }
.lg[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: var(--ci); }
.lg[aria-pressed="true"] i { background: var(--ci); }
.c-meta { margin-top: 3px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.c-meta .good { color: var(--brand-ink); font-weight: 500; }
.c-meta .dist { color: var(--ink-2); font-weight: 600; }
/* seta "ver detalhes": igual em todos os cartões */
.c-go {
  flex: none; align-self: center; width: 32px; height: 32px; margin-left: 4px; border-radius: 50%;
  display: grid; place-items: center; color: var(--muted); transition: background .15s, color .15s, transform .2s var(--ease);
}
.c-go svg { width: 18px; height: 18px; stroke-width: 2.2; }
.card:hover .c-go, .card.hover .c-go, .card-main:focus-visible .c-go { background: var(--surface-2); color: var(--ink); transform: translateX(2px); }
.card.active .c-go { background: var(--brand-soft); color: var(--brand-ink); }

.empty { text-align: center; padding: 40px 18px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
/* botão de texto (lista vazia, aviso da lista) */
.btn { border-radius: 12px; padding: 9px 16px; font-weight: 600; font-size: 14px; border: 1px solid var(--brand); background: transparent; color: var(--brand-ink); cursor: pointer; }
.btn:hover { background: var(--brand-soft); }
.skeleton { height: 70px; margin: 4px 0; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.sb-foot { margin: auto 18px 0; padding: 14px 0 20px; border-top: 1px solid var(--line); }
.disclaimer { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; }
.legal-links a, .legal-links .link { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.legal-links a:hover, .legal-links .link:hover { color: var(--ink); text-decoration-color: currentColor; }
.link { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; }

/* "Este anúncio é seu?" no fim do detalhe */
.d-owner { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.d-owner a { color: var(--ink-2); }

/* ---------- "como funciona" ---------- */
.help { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); overflow: auto; }
.help::backdrop { background: var(--scrim); }
.help[open] { animation: pop .2s var(--ease); }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.help-card { position: relative; padding: 24px 24px 20px; }
.help-x { position: absolute; top: 12px; right: 12px; }
.help-lang { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 44px 14px 0; }
.help-lang button { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink-2); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.help-lang button:hover { background: var(--surface-2); color: var(--ink); }
.help-lang button[aria-pressed="true"] { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
.help h2 { margin: 0 40px 6px 0; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 23px; letter-spacing: -.02em; line-height: 1.2; }
.help-brand { color: var(--brand); } /* "Search" verde, como no nome do topo */
.help-intro { margin: 0 0 16px; color: var(--ink-2); }
.help-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: s; }
.help-steps li { display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; counter-increment: s; }
.help-steps li::before { content: counter(s); grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); font-weight: 800; font-size: 14px; }
.help-steps b { font-size: 15px; }
.help-steps span { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.help-tips { margin: 18px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.help-tips b { color: var(--ink); }
.help-contact { margin: 14px 0 8px; font-size: 13.5px; color: var(--ink-2); }
.help-contact a { color: var(--brand-ink); font-weight: 600; }

/* ---------- aviso de cookies: discreto, não cobre a lista nem pede nada ---------- */
/* no computador fica no canto do mapa, sem cobrir a lista de vagas */
.cookie-note { position: fixed; left: calc(var(--sb-w) + 16px); bottom: 16px; z-index: 55; width: min(380px, calc(100vw - 32px)); padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 13.5px; }
.cookie-note[hidden] { display: none; }
.cookie-note p { margin: 0 0 10px; color: var(--ink-2); line-height: 1.45; }
.cookie-note div { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.cookie-note a { color: var(--ink-2); font-weight: 600; }
.btn-ok { border: 0; border-radius: 10px; padding: 8px 16px; background: var(--brand); color: var(--on-brand); font-weight: 700; cursor: pointer; }

/* ---------- mapa ---------- */
.map-area { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--surface-2); }
.map-top {
  position: absolute; left: 12px; right: 12px; top: max(12px, env(safe-area-inset-top)); z-index: 2;
  display: none; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: -6px -12px; padding: 6px 12px; /* respiro para a sombra não ser cortada */
}
.map-top::-webkit-scrollbar { display: none; }
.map-top > * { flex: none; }
.map-live {
  margin: 0; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 34px; border-radius: 99px;
  background: var(--surface); box-shadow: var(--shadow); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.map-legend { margin: 0; flex-wrap: nowrap; gap: 2px; padding: 3px; height: 34px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow); }
.map-legend .lg { border-color: transparent; padding: 0 10px 0 8px; height: 28px; gap: 5px; }
.map-btn {
  position: absolute; right: 10px; bottom: 34px; z-index: 2;
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); font-size: 13px; font-weight: 600;
}
.map-btn svg { width: 16px; height: 16px; }
.poi-ico { width: 26px; height: 26px; margin-left: -5px; border-radius: 50%; display: grid; place-items: center; flex: none; transition: background .15s, color .15s; }
.map-btn[aria-pressed="true"] .poi-ico { background: var(--brand); color: var(--on-brand); }
.map-btn[aria-pressed="false"] { color: var(--muted); }
.map-btn[aria-pressed="false"] .poi-ico { background: var(--surface-2); }
.poi-ico .cut-bg { stroke: var(--surface-2); stroke-width: 5; }
.mini-switch { position: relative; width: 30px; height: 18px; border-radius: 99px; background: var(--line-2); transition: background .15s; flex: none; margin-left: 2px; }
.mini-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease); }
.map-btn[aria-pressed="true"] .mini-switch { background: var(--brand); }
.map-btn[aria-pressed="true"] .mini-switch::after { transform: translateX(12px); }
.maplibregl-ctrl-group { background: var(--surface) !important; box-shadow: var(--shadow) !important; border-radius: 12px !important; overflow: hidden; }
.maplibregl-ctrl-group button { width: 34px !important; height: 34px !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important; }
[data-theme="dark"] .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-attrib { font-size: 10.5px; background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--muted); }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }
[data-theme="dark"] .maplibregl-ctrl-attrib-button { filter: invert(1); }

.pin {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--pin-bg); color: var(--pin-ink); border: 1.5px solid var(--pin-line);
  border-radius: 99px; padding: 3px 9px 3px 7px; font-weight: 700; font-size: 12.5px; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .28); cursor: pointer; position: relative; transition: transform .15s var(--ease);
}
.pin .pd { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pd.c-single { background: var(--p-single); } .pd.c-double { background: var(--p-double); } .pd.c-shared { background: var(--p-shared); }
.pd.c-studio { background: var(--p-studio); } .pd.c-house { background: var(--p-house); } .pd.c-other { background: var(--p-other); }
.pin.active .pd { box-shadow: 0 0 0 1.5px var(--pin-line); }
.pin:hover, .pin.hover { transform: scale(1.12); }
.pin.fresh::before { content: ''; position: absolute; top: -4px; right: -4px; width: 9px; height: 9px; border-radius: 50%; background: var(--fresh); border: 2px solid var(--pin-line); }
.pin.active { background: var(--brand); color: var(--on-brand); border-color: var(--pin-line); transform: scale(1.14); }
.pin.drop { animation: drop .7s var(--ease); }
@keyframes drop { 0% { transform: translateY(-30px); opacity: 0; } 60% { transform: translateY(3px); opacity: 1; } }
.cluster {
  display: flex; flex-direction: column; align-items: center; line-height: 1.15; cursor: pointer;
  background: var(--brand); color: var(--on-brand); border: 2px solid var(--surface); border-radius: 14px;
  padding: 5px 11px; box-shadow: var(--shadow); white-space: nowrap; transition: transform .15s var(--ease);
}
.cluster:hover { transform: scale(1.06); }
.cluster b { font-size: 13px; }
.cluster small { font-size: 11px; }
.soon-label { background: var(--surface); color: var(--muted); border: 1px dashed var(--line-2); border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: default; }
.soon-label b { color: var(--ink-2); }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(37, 99, 235, .25), var(--shadow); }
.me-dot.preview { opacity: .6; }

.poi { display: flex; align-items: center; gap: 6px; cursor: default; }
.poi i {
  width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; flex: none;
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); color: var(--ink-2);
}
.poi i svg { width: 14px; height: 14px; }
.poi span {
  font-size: 11.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; display: none;
  text-shadow: 0 0 3px var(--bg), 0 0 3px var(--bg), 0 0 3px var(--bg);
}
.map-area.zoomed .poi span { display: inline; }
.poi.school i { color: #b45309; }
.poi.uni i { color: #1d4ed8; }
.poi.mall i { color: #be185d; }
.poi.transit i { color: #0f766e; }
.poi.hospital i { color: #b91c1c; }
.poi.market i { width: 20px; height: 20px; border-radius: 6px; color: #15803d; }
.poi.market i svg { width: 12px; height: 12px; }
[data-theme="dark"] .poi.school i { color: #fbbf24; }
[data-theme="dark"] .poi.uni i { color: #93c5fd; }
[data-theme="dark"] .poi.mall i { color: #f9a8d4; }
[data-theme="dark"] .poi.transit i { color: #5eead4; }
[data-theme="dark"] .poi.hospital i { color: #fca5a5; }
[data-theme="dark"] .poi.market i { color: #86efac; }
.map-area.no-poi .poi, .map-area.far .poi { display: none; }
/* são muitos supermercados: só aparecem com o mapa mais perto, e o nome só bem de perto */
.map-area:not(.zoomed) .poi.market, .map-area:not(.close) .poi.market span { display: none; }

/* ---------- detalhe ---------- */
@keyframes fade { from { opacity: 0; } }
.detail {
  position: fixed; z-index: 41; top: 0; bottom: 0; left: 0; width: var(--sb-w);
  background: var(--bg); border-right: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain;
  animation: slide .28s var(--ease);
}
@keyframes slide { from { transform: translateX(-16px); opacity: 0; } }
.d-bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px;
  padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
}
.d-bar .back { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; font-weight: 600; padding: 6px 10px 6px 4px; border-radius: 10px; }
.d-bar .back:hover { background: var(--surface-2); }
.d-bar .back svg { width: 20px; height: 20px; }
.d-bar .share { margin-left: auto; }
.d-map {
  display: none; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: var(--surface);
  border-radius: 99px; padding: 6px 13px 6px 11px; font-weight: 600; font-size: 13.5px; white-space: nowrap;
}
.d-map svg { width: 16px; height: 16px; }
.d-map + .share { margin-left: 0; }
.d-body { padding: 4px 20px 32px; }

/* ---------- fotos do anúncio ---------- */
.gallery { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 20px 10px; scroll-padding-inline: 20px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.g-item { flex: none; height: 168px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--line); scroll-snap-align: start; cursor: zoom-in; }
.g-item img { display: block; height: 100%; width: auto; max-width: 300px; object-fit: cover; transition: transform .2s; }
.g-item:hover img { transform: scale(1.03); }
.gallery.one .g-item { width: 100%; }
.gallery.one .g-item img { width: 100%; max-width: none; height: 220px; }
@media (max-width: 899px) { .g-item { height: 190px; } }
@media (prefers-reduced-motion: reduce) { .g-item img { transition: none; } }

.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; color: #fff; overflow: hidden; }
.lightbox::backdrop { background: rgba(0, 0, 0, .9); }
.lb-track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide { flex: 0 0 100%; height: 100%; margin: 0; display: grid; place-items: center; scroll-snap-align: center; scroll-snap-stop: always; }
.lb-slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lb-btn { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; }
.lb-btn svg { width: 22px; height: 22px; }
.lb-btn:disabled { opacity: .25; cursor: default; }
.lb-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.lb-close { top: calc(12px + env(safe-area-inset-top)); right: 12px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }
.lb-count { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); padding: 4px 12px; border-radius: 99px; background: rgba(0, 0, 0, .55); font-size: 13px; font-variant-numeric: tabular-nums; }
.lb-count:empty { display: none; }
/* no celular arrasta com o dedo: as setas só atrapalham a foto */
@media (hover: none) { .lb-prev, .lb-next { display: none; } }
.d-kicker { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.d-kicker .d-kicker .d-kicker b { color: var(--ink-2); font-weight: 600; }
.d-kicker .c-price.na { font-size: 16px; color: var(--ink-2); }
.d-price.na { font-size: 22px; color: var(--ink-2); }
.c-time { margin-left: auto; }
.detail h2 { margin: 12px 0 6px; font-family: 'Bricolage Grotesque', sans-serif; font-size: 25px; line-height: 1.2; letter-spacing: -.02em; }
.d-price { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 30px; letter-spacing: -.02em; }
.d-price small { font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.d-note { font-size: 13.5px; color: var(--muted); margin-left: 6px; }
.d-place { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.d-place svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.d-place .dist { margin-left: auto; font-weight: 600; }
/* Eircode em destaque, logo abaixo do endereço */
.d-eircode { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.d-eircode.only-link { padding: 0; border: 0; background: none; }
.ec-label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ec-code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 17px; font-weight: 700; letter-spacing: .06em; color: var(--ink); }
.ec-copy { border: 1px solid var(--line-2); background: transparent; border-radius: 99px; padding: 4px 11px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.ec-copy:hover { background: var(--surface-2); }
.ec-map { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 600; color: var(--brand-ink); text-decoration: none; }
.d-eircode.only-link .ec-map { margin-left: 0; }
.ec-map:hover { text-decoration: underline; text-underline-offset: 3px; }
.ec-map svg { width: 16px; height: 16px; }
.bills { display: inline-flex; align-items: center; gap: 7px; margin: 10px 0 0; padding: 6px 12px 6px 9px; border-radius: 99px; font-size: 13.5px; font-weight: 600; }
.bills svg { width: 16px; height: 16px; stroke-width: 2.4; flex: none; }
.bills.yes { background: var(--ok-soft); color: var(--ok-ink); }
.bills.no { background: var(--warn-soft); color: var(--warn); }
.bills.unk { background: var(--surface-2); color: var(--muted); font-weight: 500; }
/* endereço incerto: sem pino (none) ou só a área do Eircode */
.placebox { display: flex; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--ink); font-size: 13.5px; line-height: 1.45; }
.placebox.none { background: var(--amber-soft); }
.placebox > svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--brand); }
.placebox.none > svg { color: var(--amber); }
.placebox b { display: block; font-size: 14px; }
.placebox p { margin: 2px 0 0; color: var(--ink-2); }
.placebox p b { display: inline; font-size: inherit; color: var(--ink); }
.list-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.list-note svg { width: 16px; height: 16px; flex: none; }
.list-note span { flex: 1; min-width: 180px; }
.contact { margin: 18px 0; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.contact h3 { margin: 0 0 2px; font-size: 15px; }
.contact p { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.contact .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.contact .wa-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%;
  border-radius: 12px; padding: 13px 14px; font-weight: 700; font-size: 15px; text-decoration: none; border: 0;
}
/* verde do WhatsApp mais fechado: texto branco com contraste ≥ 4,5:1 nos dois temas */
.contact .wa-btn { background: #0f8043; color: #fff; }
.contact .wa-btn:hover { background: #0c6d39; }
.contact .wa-btn svg { width: 19px; height: 19px; fill: currentColor; stroke: none; }
.contact .num { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.contact .num span, .contact .num a { font-weight: 600; letter-spacing: .01em; }
.contact .num a { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); text-decoration: none; font-size: 16px; }
.contact .num a svg { width: 16px; height: 16px; color: var(--muted); }
.contact .num button { margin-left: auto; border: 1px solid var(--line-2); background: transparent; border-radius: 99px; padding: 4px 11px; font-size: 12.5px; font-weight: 600; }
.contact .site { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--brand-ink); }
.contact.none { background: var(--surface-2); border-color: transparent; }
.contact.none p { margin: 0; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin: 18px 0; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 1px 0 0; font-weight: 600; font-size: 14.5px; }
.summary { font-size: 15px; color: var(--ink-2); margin: 0; }
.original { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.original summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 14px; font-weight: 700; font-size: 14.5px; color: var(--ink); transition: background .15s;
}
.original summary::-webkit-details-marker { display: none; }
.original summary:hover { background: var(--surface-2); }
.original summary > span { display: inline-flex; align-items: center; gap: 9px; }
.original summary svg { width: 18px; height: 18px; color: var(--brand-ink); }
.original summary .chev { color: var(--muted); transition: transform .2s; }
.original[open] summary { border-bottom: 1px solid var(--line); }
.original[open] summary .chev { transform: rotate(180deg); }
.original pre { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 14px; line-height: 1.6; color: var(--ink-2); margin: 0; padding: 14px; }
.safety { margin: 18px 0 0; font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; }
.safety svg { width: 17px; height: 17px; flex: none; color: var(--brand); }

/* ---------- avisos ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: grid; gap: 8px; max-width: min(360px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; text-align: left; width: 100%; border: 0;
  background: var(--ink); color: var(--bg); padding: 12px 14px; border-radius: 14px;
  box-shadow: var(--shadow-lg); font-size: 14px; animation: toast .35s var(--ease);
}
.toast i { width: 8px; height: 8px; border-radius: 50%; background: var(--fresh); margin-top: 6px; flex: none; }
.toast b { display: block; }
@keyframes toast { from { transform: translateY(10px); opacity: 0; } }

.view-switch { display: none; }

/* ---------- celular e tablet ---------- */
@media (max-width: 899px) {
  body { display: block; }
  .sidebar, .map-area { position: fixed; inset: 0; }
  .sidebar { border-right: 0; }
  body[data-view="map"] .sidebar { visibility: hidden; }
  .map-top { display: flex; }
  .cards { padding-bottom: 96px; }
  /* no celular o zoom é com os dedos: os botões + e − só ocupariam o espaço da legenda */
  .maplibregl-ctrl-top-right { display: none; }
  /* referências: só o ícone, redondo, com área de toque de 44 px */
  .map-btn { bottom: calc(84px + env(safe-area-inset-bottom)); width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; }
  .map-btn .poi-ico { margin: 0; width: 34px; height: 34px; }
  .map-btn .poi-ico svg { width: 18px; height: 18px; }
  .map-btn .poi-txt, .map-btn .mini-switch { display: none; }
  .d-map { display: inline-flex; margin-left: auto; }

  .view-switch {
    display: inline-flex; align-items: center; gap: 8px; position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 35;
    background: var(--ink); color: var(--bg); border: 0; border-radius: 99px; padding: 12px 20px; font-weight: 700; box-shadow: var(--shadow-lg);
  }
  .view-switch svg { width: 18px; height: 18px; }

  .detail { left: 0; right: 0; width: auto; border: 0; animation: up .28s var(--ease); padding-bottom: env(safe-area-inset-bottom); }
  @keyframes up { from { transform: translateY(30px); opacity: 0; } }

  .toasts { left: 16px; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); max-width: none; }
  .cookie-note { left: 12px; right: 12px; width: auto; bottom: calc(78px + env(safe-area-inset-bottom)); }
  .sb-foot { padding-bottom: 96px; }
}
/* celular estreito: o logo sozinho já identifica o site e libera espaço para região, ajuda, tema e idioma */
@media (max-width: 440px) {
  .sb-head { gap: 6px; padding-left: 14px; padding-right: 12px; }
  .brand-name { display: none; }
  .sb-actions { gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
