/* Atlas da Família — estilos */

:root {
  --paper: #E8EEE7;
  --panel: #F6F8F4;
  --card: #FFFFFF;
  --ink: #18324A;
  --ink-2: #3E566C;
  --ink-3: #6E8295;
  --line: #CCD7CD;
  --line-2: #DFE6DE;
  --gold: #B9820F;
  --gold-2: #E2AE3A;
  --gold-soft: #F6E6B8;
  --danger: #B3362F;
  --focus: #2F6FED;
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;
  --display: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --panel-w: 420px;
  --shadow-float: 0 6px 24px rgba(24, 50, 74, .16), 0 1px 3px rgba(24, 50, 74, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: -.01em; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* ---------- Carregando ---------- */
.loading {
  position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px;
  color: var(--ink-2);
}
.loading-stamp {
  width: 64px; height: 64px; border-radius: 50%;
  border: 4px dashed var(--gold-2);
  animation: spin 3s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Marca ---------- */
.brand-title { font-size: 30px; font-weight: 800; color: var(--ink); }
.brand-sub { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }

/* ---------- Entrar / instalação ---------- */
.auth-page {
  min-height: 100%; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(circle at 50% 40%, transparent 0 120px, rgba(24,50,74,.06) 121px 122px, transparent 123px 220px, rgba(24,50,74,.05) 221px 222px, transparent 223px 340px, rgba(24,50,74,.04) 341px 342px, transparent 343px),
    var(--paper);
}
.auth-card {
  width: min(420px, 100%); background: var(--card); border-radius: var(--radius-l);
  padding: 32px 28px; box-shadow: var(--shadow-float);
  display: grid; gap: 14px;
}
.auth-lead { margin: 0; color: var(--ink-2); }

/* ---------- Formulários ---------- */
.form { display: grid; gap: 14px; }
.form label, .field-label, fieldset legend { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.form input:not([type=checkbox]):not([type=color]):not([type=file]), .form textarea {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-s);
  background: #fff; font-weight: 400; font-size: 16px;
}
.form textarea { resize: vertical; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(24,50,74,.14); }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.form .check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--ink); }
.color-field input { width: 64px; height: 40px; border: 0; padding: 0; background: none; }

.msg { margin: 0; padding: 10px 12px; border-radius: var(--radius-s); background: var(--paper); font-size: 14px; }
.msg-error { background: #FBE9E7; color: var(--danger); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #22446A; }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-danger { background: transparent; color: var(--danger); border-color: transparent; padding-left: 4px; padding-right: 4px; }
.btn-danger:hover { text-decoration: underline; }
.btn-sm { padding: 6px 12px; font-size: 14px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center;
}
.icon-btn:hover { background: var(--paper); }
.icon-btn svg, .fab svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; }

/* ---------- Estrutura do app ---------- */
.app { display: grid; grid-template-columns: 1fr var(--panel-w); height: 100vh; height: 100dvh; }
.map-wrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: #DCE6E4; }
.panel { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.panel-body { overflow-y: auto; padding: 20px 22px 110px; flex: 1; }

.map-head {
  position: absolute; top: 16px; left: 16px; z-index: 500;
  background: rgba(246, 248, 244, .92); backdrop-filter: blur(6px);
  padding: 12px 18px 12px; border-radius: var(--radius-m); box-shadow: var(--shadow-float);
  max-width: calc(100% - 32px);
}
.map-controls {
  position: absolute; top: 16px; right: 16px; z-index: 500;
  display: grid; justify-items: end; gap: 8px; max-width: calc(100% - 340px);
}
.filter {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px;
  background: rgba(246, 248, 244, .92); backdrop-filter: blur(6px);
  padding: 6px; border-radius: 999px; box-shadow: var(--shadow-float);
}
.filter button {
  border: 0; background: transparent; padding: 7px 13px; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: 14px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px;
}
.filter button:hover { background: rgba(24,50,74,.07); }
.filter button[aria-checked="true"] { background: var(--ink); color: #fff; }
.filter .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px rgba(255,255,255,.8); }
.toggle {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  background: rgba(246, 248, 244, .92); padding: 6px 12px; border-radius: 999px; box-shadow: var(--shadow-float); cursor: pointer;
}
.toggle input { accent-color: var(--ink); }

.map-legend {
  position: absolute; left: 16px; bottom: 24px; z-index: 500;
  background: rgba(246, 248, 244, .92); backdrop-filter: blur(6px);
  padding: 10px 14px; border-radius: var(--radius-m); box-shadow: var(--shadow-float);
  display: grid; gap: 6px; font-size: 13px; color: var(--ink-2);
}
.map-legend div { display: flex; align-items: center; gap: 9px; }
.legend-pin { width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(24,50,74,.3); }
.legend-stamp { width: 16px; height: 16px; border-radius: 50%; border: 2px dashed var(--gold); background: var(--gold-soft); }

.fab {
  position: absolute; right: 20px; bottom: 28px; z-index: 600;
  display: inline-flex; align-items: center; gap: 8px; padding: 14px 22px 14px 18px;
  border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 10px 30px rgba(24, 50, 74, .35); cursor: pointer;
}
.fab:hover { background: #22446A; }

/* ---------- Abas ---------- */
.tabs { display: flex; gap: 2px; padding: 12px 16px 0; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 2; }
.tabs button {
  flex: 1; border: 0; background: none; padding: 10px 2px 12px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-3); white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.public-banner { background: var(--ink); color: #fff; font-size: 14px; padding: 10px 18px; }

/* ---------- Conteúdo do painel ---------- */
.section { margin-bottom: 28px; }
.section h2 { font-size: 21px; margin-bottom: 4px; }
.section h3 { font-size: 17px; }
.section-lead { margin: 0 0 14px; color: var(--ink-2); font-size: 14px; }

.tally { display: flex; align-items: baseline; gap: 10px 22px; flex-wrap: wrap; margin-bottom: 18px; }
.tally div { display: grid; }
.tally b { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; }
.tally span { color: var(--ink-2); font-size: 14px; }

/* Passaporte de estados: mapa de quadradinhos */
.passport {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px;
  background: var(--card); border-radius: var(--radius-m); padding: 14px; border: 1px solid var(--line-2);
}
.uf {
  aspect-ratio: 1; border-radius: 9px; border: 1.5px dashed var(--line);
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 15px;
  color: var(--ink-3); background: transparent; cursor: pointer; padding: 0; position: relative;
}
.uf:hover { border-color: var(--ink-3); }
.uf.on { border-style: solid; border-color: transparent; background: var(--c); color: #fff; }
.uf.excl {
  background: repeating-linear-gradient(135deg, var(--gold-soft) 0 5px, #FBF1D6 5px 10px);
  border: 2.5px dashed var(--gold); color: var(--gold); transform: rotate(-4deg);
}
.uf.multi { background: var(--stripes); border: 0; color: #fff; text-shadow: 0 1px 2px rgba(10, 20, 30, .55); }
.uf.multi.all { box-shadow: 0 0 0 2px var(--card), 0 0 0 4.5px var(--ink); }
.uf-badge {
  position: absolute; right: -6px; top: -7px; width: 19px; height: 19px; border-radius: 50%;
  background: var(--c); color: #fff; border: 2px solid var(--card);
  display: grid; place-items: center; font: 700 10px/1 var(--body); font-style: normal; text-shadow: none;
}
.uf-badge svg { width: 11px; height: 11px; fill: #fff; }
.passport-key { display: grid; gap: 6px; margin: 10px 2px 0; font-size: 13px; color: var(--ink-2); }
.passport-key span { display: flex; align-items: center; gap: 9px; }
.key-swatch { width: 18px; height: 18px; border-radius: 5px; background: var(--stripes); flex: none; }
.key-swatch.all { box-shadow: 0 0 0 1.5px var(--card), 0 0 0 3px var(--ink); }
.key-swatch.gold { background: repeating-linear-gradient(135deg, var(--gold-soft) 0 4px, #FBF1D6 4px 8px); border: 2px dashed var(--gold); }

.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line-2); border-radius: var(--radius-m); overflow: hidden; border: 1px solid var(--line-2); }
.facts li { background: var(--card); padding: 11px 14px; display: flex; justify-content: space-between; gap: 12px; }
.facts li span { color: var(--ink-2); }
.facts li b { text-align: right; }

/* Pessoas */
.people { display: grid; gap: 10px; }
.person {
  background: var(--card); border-radius: var(--radius-m); padding: 14px; border: 1px solid var(--line-2);
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center;
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--c); color: #fff;
  display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 17px; grid-row: span 2;
}
.person-name { font-weight: 700; }
.person-stats { color: var(--ink-2); font-size: 14px; }
.person-solo { grid-column: 1 / -1; margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-s); background: var(--gold-soft); color: #6A4A06; font-size: 14px; }
.person-solo b { color: #5A3E04; }

/* Lista de viagens */
.seg { display: inline-flex; background: var(--paper); border-radius: 999px; padding: 4px; margin-bottom: 14px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(24,50,74,.15); }
.search { width: 100%; padding: 10px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; margin-bottom: 14px; font-size: 15px; }
.group-title { font-family: var(--display); font-size: 18px; font-weight: 700; margin: 18px 0 8px; display: flex; justify-content: space-between; align-items: baseline; }
.group-title small { font-family: var(--body); font-weight: 500; color: var(--ink-3); font-size: 13px; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-m); padding: 10px 12px; cursor: pointer; text-align: left; width: 100%;
}
.row:hover { border-color: var(--line); background: #FBFCFA; }
.row-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--paper); display: grid; place-items: center; }
.row-thumb.stamp { border: 2px dashed var(--gold); background: var(--gold-soft); }
.row-thumb .pin-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.row-main { min-width: 0; }
.row-title { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { display: block; color: var(--ink-3); font-size: 13px; }
.dots { display: flex; }
.dots i { width: 22px; height: 22px; border-radius: 50%; background: var(--c); border: 2px solid var(--card); margin-left: -6px; font-style: normal; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.empty { text-align: center; padding: 30px 10px; color: var(--ink-2); }
.empty .btn { margin-top: 12px; }

/* Conquistas: carimbos */
.awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 14px 10px; }
.award { display: grid; justify-items: center; align-content: start; text-align: center; gap: 6px; }
.award-stamp {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; position: relative;
  border: 3px dashed var(--line); color: var(--ink-3); font-family: var(--display); font-weight: 800; font-size: 20px;
  background: var(--card);
}
.award-stamp::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 1.5px solid currentColor; opacity: .35; }
.award.won .award-stamp { color: var(--ink); border-color: var(--ink); background: #fff; transform: rotate(var(--r, -6deg)); }
.award.won.gold .award-stamp { color: var(--gold); border-color: var(--gold); background: var(--gold-soft); }
.award-name { font-weight: 700; font-size: 14px; line-height: 1.25; }
.award-desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.3; }
.award-bar { width: 74px; height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.award-bar i { display: block; height: 100%; background: var(--ink-3); }
.award.won .award-bar { display: none; }

/* Cidade aberta */
.back { border: 0; background: none; color: var(--ink-2); font-weight: 600; cursor: pointer; padding: 4px 0; margin-bottom: 10px; display: inline-flex; gap: 6px; align-items: center; }
.back svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.2; fill: none; }
.city-head { margin-bottom: 16px; }
.city-head h2 { font-size: 30px; }
.city-head p { margin: 4px 0 0; color: var(--ink-2); }
.stamp-note { display: flex; gap: 12px; align-items: center; background: var(--gold-soft); color: #5A3E04; border-radius: var(--radius-m); padding: 12px 14px; margin-bottom: 16px; font-size: 14px; }
.stamp-note .mini-stamp { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2.5px dashed var(--gold); display: grid; place-items: center; font-family: var(--display); font-weight: 800; color: var(--gold); transform: rotate(-8deg); }
.visit { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-m); overflow: hidden; margin-bottom: 12px; }
.visit img { width: 100%; max-height: 260px; object-fit: cover; display: block; cursor: zoom-in; }
.visit-body { padding: 12px 14px; display: grid; gap: 6px; }
.visit-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.visit-date { font-weight: 700; }
.visit-note { margin: 0; color: var(--ink-2); white-space: pre-line; }
.visit-who { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 10px 3px 6px; border-radius: 999px; background: var(--paper); }
.tag::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.rating { color: var(--gold); letter-spacing: 1px; }

/* Família / ajustes */
.card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-m); padding: 16px; display: grid; gap: 12px; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.member-row:last-child { border-bottom: 0; }
.member-row .avatar { width: 34px; height: 34px; font-size: 15px; }
.member-row div { flex: 1; min-width: 0; }
.member-row small { display: block; color: var(--ink-3); }
.link-box { display: flex; gap: 8px; }
.link-box input { flex: 1; min-width: 0; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-s); background: var(--paper); font-size: 14px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; }
.switch input { appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(18px); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; background: var(--c); box-shadow: 0 0 0 1.5px var(--line); cursor: pointer; }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }
.muted { color: var(--ink-3); font-size: 14px; margin: 0; }

/* ---------- Diálogos ---------- */
dialog.sheet {
  border: 0; padding: 0; border-radius: var(--radius-l); width: min(520px, calc(100% - 24px));
  max-height: calc(100dvh - 32px); box-shadow: 0 20px 60px rgba(24,50,74,.35); background: var(--panel); color: var(--ink);
}
dialog.sheet::backdrop { background: rgba(16, 32, 48, .45); }
dialog.sheet .form { padding: 20px 22px 22px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { font-size: 24px; }
.sheet-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 4px; }
.sheet-actions .btn-primary { margin-left: auto; }

.ac { position: relative; }
.ac-list {
  position: absolute; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 6px; list-style: none; z-index: 5;
  background: #fff; border-radius: var(--radius-s); box-shadow: var(--shadow-float); max-height: 280px; overflow-y: auto; font-weight: 400;
}
.ac-list li { padding: 9px 10px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.ac-list li small { color: var(--ink-3); }
.ac-list li[aria-selected="true"], .ac-list li:hover { background: var(--paper); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px 7px 8px; cursor: pointer; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
}
.chips button::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--c); background: transparent; box-sizing: border-box; }
.chips button[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); }
.chips button[aria-pressed="true"]::before { background: var(--c); box-shadow: inset 0 0 0 3px #fff; }
.stars { display: flex; gap: 4px; }
.stars button { border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--line); padding: 2px; }
.stars button.on { color: var(--gold-2); }
.photo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#photo-preview, .photo-preview { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 3000;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; box-shadow: var(--shadow-float); font-weight: 600;
  max-width: calc(100% - 32px);
}
.lightbox { position: fixed; inset: 0; z-index: 4000; background: rgba(10,20,30,.88); display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* ---------- Mapa: marcadores ---------- */
.leaflet-container { font-family: var(--body); }
.pin { width: 16px; height: 16px; border-radius: 50%; background: var(--c); border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(24,50,74,.45); }
.pin-stamp {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold-soft); border: 2.5px dashed var(--gold); transform: rotate(-10deg);
  box-shadow: 0 2px 6px rgba(90, 62, 4, .35);
}
.pin-stamp span { width: 18px; height: 18px; border-radius: 50%; background: var(--c); color: #fff; font: 700 10px/18px var(--body); text-align: center; transform: rotate(10deg); }
.pin-home {
  width: 38px; height: 38px; border-radius: 50%; background: var(--ink); display: grid; place-items: center;
  border: 3px solid #fff; box-shadow: 0 3px 10px rgba(24,50,74,.45);
}
.pin-home svg { width: 20px; height: 20px; fill: #fff; }
.ring-label {
  font: 700 12px var(--body); color: var(--ink-2); background: rgba(246,248,244,.9); padding: 1px 8px; border-radius: 999px;
  white-space: nowrap; transform: translate(-50%, -50%); display: inline-block; box-shadow: 0 1px 3px rgba(24,50,74,.15);
}
.leaflet-tooltip.city-tip { font-family: var(--body); font-weight: 600; border-radius: 8px; border: 0; box-shadow: var(--shadow-float); padding: 5px 10px; }
.leaflet-top.leaflet-left { top: 100px; }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow-float) !important; }
.leaflet-control-attribution { font-size: 10px; }

/* ---------- Celular ---------- */
@media (max-width: 860px) {
  .app { display: block; height: auto; }
  .map-wrap { height: 62vh; height: 62svh; }
  .panel { border-left: 0; border-top: 1px solid var(--line); min-height: 38vh; }
  .panel-body { overflow: visible; padding: 18px 16px 110px; }
  .tabs { padding: 8px 8px 0; }
  .map-head { top: 10px; left: 10px; padding: 9px 13px; }
  .brand-title { font-size: 22px; }
  .brand-sub { font-size: 12.5px; }
  .map-controls { top: auto; bottom: 12px; left: 10px; right: 10px; max-width: none; justify-items: start; }
  .filter { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .filter button { flex: none; }
  .toggle { display: none; }
  .map-legend { display: none; }
  .fab { position: fixed; bottom: 18px; right: 16px; }
  .leaflet-top.leaflet-left { top: 64px; }
  .auth-page { min-height: 100vh; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Mapa de fundo mais suave, para os carimbos e cores da família se destacarem */
.base-tiles { filter: saturate(.45) brightness(1.04) contrast(.92); }

/* Lugares que mais de uma pessoa conhece: anel com as cores de quem conhece */
.pin-group {
  width: 24px; height: 24px; border-radius: 50%; background: var(--ring); padding: 3px;
  display: grid; box-shadow: 0 2px 7px rgba(24, 50, 74, .38); flex: none;
}
.pin-group > span {
  border-radius: 50%; background: #fff; display: grid; place-items: center;
  font: 800 11px/1 var(--body); color: var(--ink);
}
.pin-group.is-all { width: 32px; height: 32px; padding: 4px; box-shadow: 0 0 0 2px #fff, 0 3px 10px rgba(24, 50, 74, .45); }
.pin-group.is-all > span { background: var(--ink); }
.pin-group svg { width: 15px; height: 15px; fill: #fff; }
.pin-group.legend-mini { width: 18px; height: 18px; padding: 2.5px; box-shadow: none; }
.pin-group.legend-mini > span { font-size: 9px; }
.pin-group.legend-mini.is-all { box-shadow: none; }
.pin-group.legend-mini svg { width: 9px; height: 9px; }
.leaflet-tooltip.city-tip small { font-weight: 500; color: var(--ink-2); }
.together-note {
  display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--radius-m); padding: 12px 14px; margin-bottom: 16px; font-size: 14px; color: var(--ink-2);
}

/* Hospedagem */
.lodging-field { gap: 8px; }
.lodging-more { display: grid; gap: 8px; }
.lodging-rate { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.stars-sm button { font-size: 22px; }
.stay {
  display: flex; gap: 10px; align-items: flex-start; background: var(--paper); border-radius: var(--radius-s);
  padding: 9px 11px; font-size: 14px;
}
.stay svg, .row-thumb.bed svg { width: 20px; height: 20px; stroke: var(--ink-2); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.stay small { display: block; color: var(--ink-3); font-size: 12px; }
.stay a { color: var(--ink); font-weight: 700; text-underline-offset: 2px; }
.stay .rating { margin-left: 6px; font-size: 13px; }
.row-thumb.bed { background: var(--paper); }
.row-sub .rating { font-size: 12px; margin-left: 4px; }

/* Próximas viagens */
.plans-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.plans-head > div { flex: 1 1 220px; }
.plan-card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-m); overflow: hidden; margin-bottom: 16px; scroll-margin-top: 70px; }
.plan-cover { position: relative; height: 150px; background: linear-gradient(135deg, #18324A 0%, #2D5878 60%, #3F7A8C 100%); }
.plan-cover img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.plan-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 0 20px; text-align: center;
  color: rgba(255, 255, 255, .92); font: 800 30px/1.05 var(--display); letter-spacing: -.01em;
}
.countdown {
  position: absolute; left: 12px; top: 12px; background: var(--gold-2); color: #3A2A05;
  font-weight: 800; font-size: 13px; padding: 5px 12px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.countdown.now { background: #1E9E74; color: #fff; }
.countdown.past, .countdown.tbd { background: var(--panel); color: var(--ink-2); }
.plan-body { padding: 14px; display: grid; gap: 10px; }
.plan-title { font-size: 21px; font-weight: 800; }
.plan-dates { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }
.plan-past { margin: 0; padding: 10px 12px; border-radius: var(--radius-s); background: var(--gold-soft); color: #5A3E04; font-size: 14px; }
.plan-actions, .visit-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.plan-actions .btn-danger, .visit-actions .btn-danger { margin-left: auto; }
.date-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.city-danger { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line-2); display: grid; justify-items: start; gap: 4px; }

/* Previsão do tempo */
.wx { border-top: 1px solid var(--line-2); padding-top: 12px; display: grid; gap: 8px; }
.wx h4 { margin: 0; font-size: 14px; }
.wx p { margin: 0; font-size: 13px; color: var(--ink-3); }
.wx-days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.wx-day {
  flex: none; width: 76px; background: var(--paper); border-radius: 10px; padding: 8px 4px;
  display: grid; justify-items: center; gap: 1px; font-size: 12px; text-align: center;
}
.wx-dow { color: var(--ink-2); font-weight: 600; }
.wx-ico { font-size: 26px; line-height: 1.15; }
.wx-day b { font-size: 16px; }
.wx-min { color: var(--ink-3); }
.wx-rain { color: #2F6FED; font-weight: 600; margin-top: 2px; }

/* Faixa "próxima viagem" no resumo */
.next-banner {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  background: var(--ink); color: #fff; border: 0; border-radius: var(--radius-m); padding: 12px 14px; margin-bottom: 20px;
}
.next-banner:hover { background: #22446A; }
.next-banner > span:nth-child(2) { flex: 1; min-width: 0; }
.next-banner b { display: block; font: 800 18px/1.15 var(--display); }
.next-banner small { display: block; opacity: .8; font-size: 12.5px; }
.next-banner .countdown { position: static; box-shadow: none; flex: none; }
.next-icon { width: 38px; height: 38px; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .6); display: grid; place-items: center; flex: none; }
.next-icon svg { width: 18px; height: 18px; fill: #fff; }

/* Pino de próxima viagem no mapa */
.pin-plan {
  width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2.5px dashed var(--ink);
  display: grid; place-items: center; box-shadow: 0 2px 8px rgba(24, 50, 74, .35);
}
.pin-plan svg { width: 14px; height: 14px; fill: var(--ink); transform: rotate(45deg); }
.pin-plan.legend-mini { width: 18px; height: 18px; border-width: 1.5px; box-shadow: none; }
.pin-plan.legend-mini svg { width: 9px; height: 9px; }
@media (max-width: 860px) {
  .date-pair { grid-template-columns: 1fr; }
}

/* Abas com respiro; no celular a barra rola para o lado */
.tabs { gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 0 auto; padding-left: 8px; padding-right: 8px; }

/* Prioridade das viagens planejadas */
.prio-options { display: flex; flex-wrap: wrap; gap: 8px; }
.form .prio-opt {
  display: inline-flex; align-items: center; position: relative; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 16px; background: #fff; font-weight: 600;
}
.prio-opt input { position: absolute; opacity: 0; pointer-events: none; }
.prio-opt:has(input:checked) { color: #fff; border-color: transparent; }
.prio-opt.p1:has(input:checked) { background: var(--prio-1); }
.prio-opt.p2:has(input:checked) { background: var(--ink); }
.prio-opt.p3:has(input:checked) { background: var(--ink-3); }
.prio-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.field-hint { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); font-weight: 400; }
:root { --prio-1: #C2412B; }

.prio-pick { display: inline-flex; background: var(--paper); border-radius: 999px; padding: 3px; gap: 2px; }
.prio-pick button {
  border: 0; background: none; border-radius: 999px; padding: 5px 12px; cursor: pointer;
  font-weight: 600; font-size: 13px; color: var(--ink-3);
}
.prio-pick button:hover { color: var(--ink); }
.prio-pick button[aria-pressed="true"] { color: #fff; }
.prio-pick button.p1[aria-pressed="true"] { background: var(--prio-1); }
.prio-pick button.p2[aria-pressed="true"] { background: var(--ink); }
.prio-pick button.p3[aria-pressed="true"] { background: var(--ink-3); }
.prio-badge {
  position: absolute; right: 12px; top: 12px; background: var(--prio-1); color: #fff;
  font-weight: 800; font-size: 13px; padding: 5px 12px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.plans-empty { margin: 0 0 6px; }

.wish-list { display: grid; gap: 10px; }
.wish {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: start;
  background: var(--card); border: 1px solid var(--line-2); border-left: 5px solid var(--ink-3);
  border-radius: var(--radius-m); padding: 12px 14px; scroll-margin-top: 70px;
}
.wish.p1 { border-left-color: var(--prio-1); }
.wish.p2 { border-left-color: var(--ink); }
.wish-photo { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; cursor: zoom-in; }
.wish:not(:has(.wish-photo)) .wish-main { grid-column: 1 / 3; }
.wish-main { min-width: 0; display: grid; gap: 2px; }
.wish h3 { font-size: 18px; }
.wish-sub { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.wish .visit-note { font-size: 14px; }
.wish-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.wish-actions { display: flex; gap: 6px; }
.pin-plan.hot { border-color: var(--prio-1); background: #FBE5DF; }
.pin-plan.hot svg { fill: var(--prio-1); }

.plan-body .prio-pick { justify-self: start; }

.ac-note { color: var(--ink-3); }
