:root {
  --bg: #0f1117;
  --bg2: #151823;
  --surface: #1c2030;
  --surface2: #242938;
  --card: #1c2030;
  --border: #2e3446;
  --primary: #6366f1;
  --primary2: #8b5cf6;
  --primary-dim: #4338ca;
  --text: #f4f5fb;
  --muted: #9aa2b8;
  --gostei: #22c55e;
  --talvez: #f59e0b;
  --evitar: #ef4444;
  --nav-h: 62px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --radius: 16px;
  --shadow: 0 4px 20px rgba(0,0,0,.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; overscroll-behavior: none; }
#app { height: 100%; display: flex; flex-direction: column; }
h1, h2, h3 { letter-spacing: -0.02em; }

/* ── Top bar ── */
.topbar {
  background: rgba(21,24,35,.85); backdrop-filter: blur(12px);
  padding: 14px 16px 12px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100;
  padding-top: max(14px, env(safe-area-inset-top, 14px));
}
.topbar h1 { font-size: 22px; font-weight: 800; flex: 1; background: linear-gradient(120deg, var(--text), #c7cbe0); -webkit-background-clip: text; background-clip: text; }
.topbar .icon-btn { background: var(--surface2); border: 1px solid var(--border); color: var(--text); width: 36px; height: 36px; border-radius: 12px; font-size: 20px; cursor: pointer; line-height: 1; display: flex; align-items: center; justify-content: center; }
.topbar .icon-btn:active { opacity: 0.6; }

/* ── Main ── */
.main { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px); -webkit-overflow-scrolling: touch; }

/* ── Bottom nav ── */
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 200; background: rgba(21,24,35,.9); backdrop-filter: blur(12px); border-top: 1px solid var(--border); display: flex; height: calc(var(--nav-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom); }
.nav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; background: none; border: none; color: var(--muted); cursor: pointer; gap: 3px; font-size: 11px; padding-bottom: 4px; transition: color .15s; }
.nav-btn svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn.active { color: var(--primary); }
.nav-btn:active { opacity: 0.7; }

/* ── Search + filtros ── */
.searchbar { display: flex; gap: 8px; padding: 14px 16px 2px; align-items: center; }
.searchbar input { flex: 1; background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 11px 14px; border-radius: 14px; font-size: 15px; outline: none; transition: border-color .15s; -webkit-appearance: none; }
.searchbar input:focus { border-color: var(--primary); }
.sort-btn { flex-shrink: 0; padding: 11px 13px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; color: var(--muted); font-size: 14px; font-weight: 700; cursor: pointer; min-width: 48px; }
.sort-btn.active { border-color: var(--primary); color: var(--primary); background: rgba(99,102,241,.12); }

.filters { display: flex; gap: 8px; padding: 12px 16px 4px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; padding: 7px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 13px; cursor: pointer; white-space: nowrap; transition: all .15s; }
.chip.active { border-color: transparent; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary2)); }

/* ── Cards ── */
.cards { padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.card { background: linear-gradient(160deg, var(--surface2), var(--card)); border-radius: var(--radius); overflow: hidden; display: flex; cursor: pointer; transition: transform .12s, box-shadow .12s; border: 1px solid var(--border); box-shadow: var(--shadow); }
.card:active { transform: scale(.985); box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.card-img { width: 112px; align-self: stretch; object-fit: cover; flex-shrink: 0; }
.card-img-placeholder { width: 112px; flex-shrink: 0; background: radial-gradient(circle at 50% 40%, var(--surface2), var(--bg2)); display: flex; align-items: center; justify-content: center; font-size: 36px; }
.card-body { padding: 12px 14px; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.card-nome { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-local { font-size: 13px; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px; background: var(--surface2); color: var(--muted); }
.badge.gostei { background: rgba(34,197,94,.16); color: var(--gostei); }
.badge.talvez { background: rgba(245,158,11,.16); color: var(--talvez); }
.badge.evitar { background: rgba(239,68,68,.16); color: var(--evitar); }
.badge-quero { background: rgba(99,102,241,.18); color: #a5b4fc; }
.badge-info { background: var(--surface2); color: var(--muted); }

/* ── Empty / loading ── */
.empty { text-align: center; padding: 60px 32px; color: var(--muted); }
.empty-icon { font-size: 52px; margin-bottom: 12px; }
.empty p { font-size: 15px; line-height: 1.5; }
.loading { display: flex; align-items: center; justify-content: center; height: 140px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Map ── */
#map-view { height: 100%; position: relative; }
#leaflet-map { height: 100%; }
.leaflet-container { background: #12151f; }
.leaflet-control-zoom a { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
.leaflet-popup-content-wrapper { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.leaflet-popup-tip { background: var(--card); }

/* ── Stats ── */
.stats-body { padding: 16px; display: flex; flex-direction: column; gap: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 10px; text-align: center; box-shadow: var(--shadow); }
.stat-n { font-size: 26px; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--primary2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-l { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.stat-block { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-block h3 { font-size: 15px; margin-bottom: 12px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.bar-lbl { width: 84px; flex-shrink: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 8px; background: var(--surface2); border-radius: 6px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary2)); border-radius: 6px; }
.bar-val { width: 26px; text-align: right; font-weight: 700; }

/* ── Config ── */
.config-body { padding: 24px 16px; display: flex; flex-direction: column; gap: 18px; }
.config-info { color: var(--muted); }

/* ── Panel ── */
.panel { position: fixed; inset: 0; z-index: 300; background: var(--bg); display: flex; flex-direction: column; overflow: hidden; animation: slideUp .25s ease-out; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.panel-header { background: var(--surface); padding: 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); padding-top: max(16px, env(safe-area-inset-top, 16px)); flex-shrink: 0; }
.panel-header h2 { flex: 1; font-size: 17px; font-weight: 800; }
.back-btn { background: none; border: none; color: var(--muted); font-size: 24px; cursor: pointer; line-height: 1; padding: 2px 6px; }
.fav-btn { background: none; border: none; font-size: 22px; cursor: pointer; line-height: 1; padding: 2px 6px; color: var(--muted); }
.fav-btn.on { color: #fbbf24; }
.panel-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ── Detail ── */
.detail-hero { width: 100%; max-height: 280px; object-fit: cover; display: block; }
.gallery-strip { display: flex; gap: 8px; padding: 10px 16px 0; overflow-x: auto; scrollbar-width: none; }
.gallery-strip::-webkit-scrollbar { display: none; }
.gallery-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex-shrink: 0; cursor: pointer; border: 2px solid transparent; }
.gallery-thumb:active { border-color: var(--primary); }
.detail-body { padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.detail-nome { font-size: 23px; font-weight: 800; }
.detail-local { color: var(--muted); font-size: 15px; }
.detail-meta { color: var(--text); font-size: 14px; }
.detail-contactos { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-link { text-decoration: none; background: var(--surface2); color: var(--text); padding: 8px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.detail-map { height: 190px; border-radius: 14px; overflow: hidden; }
.btn-maps { display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 14px; padding: 13px; font-size: 15px; font-weight: 600; text-decoration: none; }
.btn-maps:active { opacity: 0.7; }

.visitas-header { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.visitas-header h3 { font-size: 17px; }
.btn-sm { background: linear-gradient(135deg, var(--primary), var(--primary2)); color: #fff; border: none; border-radius: 20px; padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; }
.visitas-lista { display: flex; flex-direction: column; gap: 12px; }
.sem-visitas { color: var(--muted); font-size: 14px; padding: 8px 0; }
.visita-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.visita-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.visita-data { color: var(--muted); font-size: 13px; margin-left: 8px; }
.visita-edit { background: none; border: none; font-size: 16px; cursor: pointer; }
.visita-pratos { font-size: 14px; }
.visita-notas { font-size: 14px; line-height: 1.55; color: var(--muted); }
.vfotos-grupo { display: flex; flex-direction: column; gap: 5px; }
.vfotos-lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.vfotos-row { display: flex; gap: 6px; flex-wrap: wrap; }
.vfoto { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }

.detail-actions { display: flex; gap: 10px; padding: 0 16px 20px; }
.detail-actions .btn-primary, .detail-actions .btn-danger { flex: 1; }

/* ── Forms ── */
.form-body { padding: 20px 16px; display: flex; flex-direction: column; gap: 16px; }
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.label-sub { text-transform: none; letter-spacing: 0; font-weight: 600; opacity: .8; }
.preco-legenda { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.preco-legenda b { color: var(--text); font-weight: 700; }
.form-group input, .form-group textarea, .form-group select { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 12px; border-radius: 12px; font-size: 16px; width: 100%; font-family: inherit; outline: none; transition: border-color .15s; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 80px; }

.veredicto-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.v-btn { padding: 11px 4px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; text-align: center; transition: all .15s; }
.v-btn.sel-gostei { border-color: var(--gostei); color: var(--gostei); background: rgba(34,197,94,.12); }
.v-btn.sel-talvez { border-color: var(--talvez); color: var(--talvez); background: rgba(245,158,11,.12); }
.v-btn.sel-evitar { border-color: var(--evitar); color: var(--evitar); background: rgba(239,68,68,.12); }

.pick-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pick-btn { flex: 1; padding: 11px 6px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); color: var(--muted); font-size: 15px; font-weight: 700; cursor: pointer; transition: all .15s; }
.pick-btn.pick-preco { min-width: 48px; white-space: nowrap; }
.pick-btn.wide { font-size: 13px; }
.pick-btn.sel { border-color: var(--primary); color: #fff; background: rgba(99,102,241,.18); }

.switch-row { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text); cursor: pointer; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--primary); }

.tipo-foto-row { display: flex; gap: 6px; margin-bottom: 8px; }
.tipo-foto-btn { flex: 1; padding: 8px 4px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.tipo-foto-btn.sel { border-color: var(--primary); color: var(--primary); background: rgba(99,102,241,.12); }

.fotos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.foto-cell { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; }
.foto-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-tag { position: absolute; bottom: 4px; left: 4px; background: rgba(15,17,23,.8); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; }
.foto-del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: none; background: rgba(15,17,23,.8); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.foto-add { aspect-ratio: 1; background: var(--surface); border: 2px dashed var(--border); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 12px; cursor: pointer; }
.foto-add span { font-size: 26px; line-height: 1; }

.gps-row { display: flex; gap: 8px; align-items: center; }
.gps-row input { flex: 1; }
.gps-btn { flex-shrink: 0; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--primary); font-size: 20px; cursor: pointer; line-height: 1; }

/* pesquisa online (Nominatim) */
.osm-results { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.osm-hint { color: var(--muted); font-size: 13px; padding: 4px 2px; }
.osm-item { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; color: var(--text); font-size: 13px; cursor: pointer; line-height: 1.35; }
.osm-item:active { border-color: var(--primary); }

.form-actions { padding: 16px; padding-bottom: max(16px, var(--safe-bottom)); display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary2)); color: #fff; border: none; border-radius: 14px; padding: 15px; font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 16px rgba(99,102,241,.35); }
.btn-primary:active { opacity: 0.85; }
.btn-danger { background: rgba(239,68,68,.12); color: var(--evitar); border: 1px solid rgba(239,68,68,.3); border-radius: 14px; padding: 13px; font-size: 15px; font-weight: 700; cursor: pointer; }

/* ── Cards modernos (grid 2 colunas, quadrados) ── */
.cards { padding: 14px 16px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cardm { background: var(--card); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; cursor: pointer; box-shadow: var(--shadow); transition: transform .14s, box-shadow .14s; display: flex; flex-direction: column; }
.cardm:active { transform: scale(.985); box-shadow: 0 2px 12px rgba(0,0,0,.4); }
.cardm-media { position: relative; aspect-ratio: 1; width: 100%; }
.cardm-img { width: 100%; height: 100%; background-size: cover; background-position: center; }
.cardm-noimg { display: flex; align-items: center; justify-content: center; font-size: 38px; }
.cardm-pill { position: absolute; left: 8px; bottom: 8px; right: 8px; color: #fff; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 20px; backdrop-filter: blur(4px); box-shadow: 0 2px 8px rgba(0,0,0,.3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cardm-fav { position: absolute; top: 8px; left: 8px; font-size: 16px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.cardm-dist { position: absolute; top: 8px; right: 8px; background: rgba(15,17,23,.8); color: #fff; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 20px; backdrop-filter: blur(4px); }
.cardm-body { padding: 10px 11px 12px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.cardm-nome { font-weight: 800; font-size: 14.5px; letter-spacing: -0.01em; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cardm-local { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cardm-body .badges { gap: 4px; }
.cardm-body .badge { font-size: 10.5px; padding: 2px 7px; }

/* ── Detalhe: hero moderno com foto de fundo ── */
.panel-header.slim { background: transparent; border-bottom: none; position: absolute; top: 0; left: 0; right: 0; z-index: 10; }
.panel-header.slim h2 { color: transparent; }
.panel-header.slim .back-btn { background: rgba(15,17,23,.55); border-radius: 50%; width: 38px; height: 38px; backdrop-filter: blur(6px); color: #fff; display: flex; align-items: center; justify-content: center; }
.panel-header.slim .share-btn { background: rgba(15,17,23,.55); border: none; border-radius: 50%; width: 38px; height: 38px; backdrop-filter: blur(6px); color: #fff; font-size: 17px; cursor: pointer; margin-right: 52px; display: flex; align-items: center; justify-content: center; }
.detail-hero2 { position: relative; height: 240px; background-size: cover; background-position: center; display: flex; align-items: flex-end; }
.detail-hero2.no-img { align-items: flex-end; justify-content: flex-start; }
.detail-hero2 .hero-emoji { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-60%); font-size: 72px; opacity: .5; }
.hero-grad { position: absolute; inset: 0; background: linear-gradient(to top, rgba(15,17,23,.96) 8%, rgba(15,17,23,.4) 45%, rgba(15,17,23,.15) 100%); }
.fav-fab { position: absolute; top: max(14px, env(safe-area-inset-top, 14px)); right: 14px; z-index: 5; width: 42px; height: 42px; border-radius: 50%; border: none; background: rgba(15,17,23,.55); backdrop-filter: blur(6px); color: #fff; font-size: 20px; cursor: pointer; }
.fav-fab.on { color: #fbbf24; }
.hero-content { position: relative; z-index: 2; padding: 18px 18px 20px; width: 100%; }
.hero-nome { font-size: 27px; font-weight: 800; letter-spacing: -0.03em; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.hero-local { font-size: 14px; color: #e5e7ef; margin-top: 4px; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.hero-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hpill { color: #fff; font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.hpill-dark { background: rgba(15,17,23,.7) !important; backdrop-filter: blur(4px); }

/* ── Ficha de dados ── */
.ficha { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 6px 16px; box-shadow: var(--shadow); }
.ficha-title { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 12px 0 8px; }
.ficha-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); font-size: 15px; }
.ficha-k { color: var(--muted); }
.ficha-v { font-weight: 700; text-align: right; }
.ficha-vazia { padding: 4px 0 14px; color: var(--muted); font-size: 14px; }
.ficha-contactos { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 0 14px; border-top: 1px solid var(--border); }

/* ── Distância no card ── */
.card-dist { font-size: 12px; font-weight: 600; color: var(--primary); background: rgba(99,102,241,.14); padding: 2px 8px; border-radius: 12px; margin-left: 8px; white-space: nowrap; }
.card-nome { display: flex; align-items: center; }
.card-nome > .card-dist { margin-left: auto; }

/* ── Detalhe reorganizado (info primeiro, foto menor, mapa no fim) ── */
.detail-head { background: linear-gradient(160deg, var(--surface2), var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.detail-fotos { display: flex; gap: 10px; overflow-x: auto; padding: 2px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.detail-fotos::-webkit-scrollbar { display: none; }
.detail-foto { height: 140px; min-width: 140px; object-fit: cover; border-radius: 14px; cursor: pointer; scroll-snap-align: start; box-shadow: var(--shadow); }
.detail-loc-section { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.detail-map { height: 150px; border-radius: 14px; overflow: hidden; }

/* ── Lightbox ── */
.lightbox { position: fixed; inset: 0; z-index: 600; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; animation: fadein .15s; }
.lightbox img { max-width: 96vw; max-height: 88vh; border-radius: 12px; }
.lb-close { position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); right: 16px; width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(255,255,255,.15); color: #fff; font-size: 18px; cursor: pointer; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ── Config ── */
.config-hero { text-align: center; padding: 24px 0 8px; }
.config-logo { font-size: 56px; filter: drop-shadow(0 6px 16px rgba(99,102,241,.4)); }
.config-title { font-size: 24px; font-weight: 800; margin-top: 10px; }
.config-ver { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary2)); padding: 3px 12px; border-radius: 20px; text-transform: uppercase; letter-spacing: .05em; }
.config-url { color: var(--muted); font-size: 13px; margin-top: 8px; }
.config-footer { text-align: center; color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 8px; }

/* ── Toast ── */
.toast { position: fixed; bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px); left: 50%; transform: translateX(-50%); background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 11px 20px; border-radius: 20px; font-size: 14px; z-index: 500; opacity: 0; pointer-events: none; transition: opacity .2s; white-space: nowrap; max-width: calc(100vw - 32px); box-shadow: var(--shadow); }
.toast.show { opacity: 1; }

/* ── Login ── */
.login-wrap { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.login-form { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 320px; margin-top: 24px; }
.login-form input { background: var(--surface2, #1f2937); border: 1px solid var(--border, #374151); color: var(--text, #f9fafb); border-radius: 14px; padding: 13px 16px; font-size: 15px; text-align: center; }
.login-err { color: var(--evitar, #ef4444); font-size: 13px; min-height: 18px; }
.convite-intro { max-width: 320px; margin-top: 20px; color: var(--muted); font-size: 14px; line-height: 1.55; text-align: center; }
.welcome-num { margin-top: 10px; padding: 8px 16px; border-radius: 999px; background: var(--surface2, #1f2937); border: 1px solid var(--border, #374151); font-size: 14px; }
.welcome-num b { color: var(--primary, #f59e0b); font-size: 16px; }
.welcome-fundador { border-color: var(--primary, #f59e0b); }

/* Feed de novidades */
.nav-btn { position: relative; }
.nav-dot { position: absolute; top: 6px; right: 22%; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; }
.feed-body { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.feed-row { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; }
.feed-texto { font-size: 14px; line-height: 1.45; }
.feed-texto b { color: var(--text); }
.feed-data { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Comentários nas visitas */
.visita-coment { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.coment-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.coment-texto { flex: 1; line-height: 1.4; }
.coment-meta { color: var(--muted); font-size: 11px; white-space: nowrap; }
.coment-del { background: none; border: none; cursor: pointer; font-size: 12px; opacity: .7; }
.coment-add { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.coment-react { background: var(--surface2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 8px; cursor: pointer; font-size: 14px; }
.coment-in { flex: 1; min-width: 0; background: var(--surface2); border: 1px solid var(--border); color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.coment-send { background: var(--primary); color: #fff; border: none; border-radius: 999px; width: 30px; height: 30px; cursor: pointer; flex-shrink: 0; }
.convite-intro p { margin: 0 0 10px; }
.convite-intro b { color: var(--text); }

/* ── Caixa de partilha (formulários) ─────────────────────────────────────── */
.share-box { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px 14px; margin: 4px 0; background: var(--surface); display: flex; flex-direction: column; gap: 12px; }
.share-box legend { padding: 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.share-hint { font-size: 12px; color: var(--muted); line-height: 1.45; margin: 0; }
.share-hint b { color: var(--text); }

/* ── Pinos do mapa (tipo gota, com destaque) ─────────────────────────────── */
.map-pin-wrap { background: none; border: none; }
.map-pin {
  width: 34px; height: 34px; border-radius: 50% 50% 50% 0;
  background: var(--pin, var(--primary));
  transform: rotate(-45deg);
  border: 2.5px solid #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
}
.map-pin-emoji { transform: rotate(45deg); font-size: 16px; line-height: 1; }
.leaflet-marker-icon.map-pin-wrap { transition: transform .12s; }
.leaflet-marker-icon.map-pin-wrap:hover { transform: scale(1.12); }

/* ── Modal genérico (novidades / instalação) ─────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 18px; animation: fadeIn .18s ease-out; }
.modal-card { background: linear-gradient(160deg, var(--surface2, var(--surface)), var(--card)); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; max-width: 440px; max-height: 86vh; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── "O que há de novo" ──────────────────────────────────────────────────── */
.nov-header { display: flex; align-items: center; gap: 10px; }
.nov-header h2 { font-size: 20px; font-weight: 800; }
.nov-spark { font-size: 24px; }
.nov-body { display: flex; flex-direction: column; gap: 18px; }
.nov-sec { display: flex; flex-direction: column; gap: 6px; }
.nov-ver { font-size: 12px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .04em; }
.nov-titulo { font-size: 16px; font-weight: 700; color: var(--text); }
.nov-lista { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.nov-lista li { font-size: 14px; line-height: 1.5; color: var(--text); padding-left: 2px; }

/* ── Instruções de instalação (PWA) ──────────────────────────────────────── */
.install-box { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin: 16px 0 4px; display: flex; flex-direction: column; gap: 12px; }
.install-title { font-size: 15px; font-weight: 800; color: var(--text); }
.install-intro { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0; }
.install-intro b, .install-plat b { color: var(--text); }
.install-plat { background: var(--surface2, var(--card)); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.install-plat-h { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.install-plat ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.install-plat li { font-size: 13px; line-height: 1.5; color: var(--text); }
.install-plat .ic { font-family: -apple-system, system-ui, sans-serif; }
