/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
h1, h2, h3, h4 { font-family: 'Lexend Deca', 'Inter', sans-serif; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img, video { max-width: 100%; display: block; }
input, textarea, select, button { font: inherit; color: inherit; }

/* ===== Tokens ===== */
:root {
  --color-primary: #004080;
  --color-primary-dark: #002b5c;
  --color-accent: #FF7A30;
  --color-accent-dark: #E0631E;
  --color-success: #1FA971;
  --color-danger: #D64545;
  --color-warning: #E0A100;

  --color-bg: #F5F7FA;
  --color-surface: #FFFFFF;
  --color-surface-2: #ECEFF3;
  --color-text: #0B1220;
  --color-text-muted: #5B6472;
  --color-border: rgba(11, 18, 32, 0.1);
  --color-overlay: rgba(11, 18, 32, 0.55);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-7: 32px; --space-8: 48px;

  --radius-sm: 0; --radius-md: 0; --radius-lg: 0; --radius-full: 0;

  --shadow-sm: 0 1px 3px rgba(11,18,32,.08), 0 1px 2px rgba(11,18,32,.06);
  --shadow-md: 0 6px 16px rgba(11,18,32,.12);
  --shadow-lg: 0 16px 40px rgba(11,18,32,.18);

  --topbar-h: 64px;
  --bottomnav-h: 68px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --ease-out: cubic-bezier(.16,1,.3,1);
  color-scheme: light;
}

:root:not([data-theme="light"]) {
  @media (prefers-color-scheme: dark) {
    --color-bg: #0B1220;
    --color-surface: #151C2C;
    --color-surface-2: #1E2740;
    --color-text: #EDF1F7;
    --color-text-muted: #93A0B4;
    --color-border: rgba(255,255,255,.1);
    --color-overlay: rgba(0,0,0,.65);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --color-bg: #0B1220;
  --color-surface: #151C2C;
  --color-surface-2: #1E2740;
  --color-text: #EDF1F7;
  --color-text-muted: #93A0B4;
  --color-border: rgba(255,255,255,.1);
  --color-overlay: rgba(0,0,0,.65);
  color-scheme: dark;
}

/* Logo adaptável: colorida (fundo claro) / branca (fundo escuro) — mesmo padrão
   de :root/@media/[data-theme] usado acima pras cores, pra respeitar tanto o
   tema do SO quanto a troca manual pelo botão de tema. */
.logo-dark { display: none; }
:root:not([data-theme="light"]) {
  @media (prefers-color-scheme: dark) {
    .logo-light { display: none; }
    .logo-dark { display: block; }
  }
}
:root[data-theme="dark"] {
  .logo-light { display: none; }
  .logo-dark { display: block; }
}

@view-transition { navigation: auto; }

/* ===== App shell: top bar ===== */
.app-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  height: calc(var(--topbar-h) + var(--safe-top));
  padding-top: var(--safe-top);
  display: flex; align-items: center; gap: var(--space-2);
  padding-left: var(--space-3); padding-right: var(--space-3);
  background: color-mix(in srgb, var(--color-surface) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
  transition: transform .25s var(--ease-out);
}
.app-topbar__brand { display: flex; align-items: center; gap: var(--space-2); font-family: 'Lexend Deca', sans-serif; font-weight: 600; font-size: 1.05rem; }
.app-topbar__brand img { height: 30px; width: auto; }
.app-topbar__spacer { flex: 1; }
.app-topbar__title { font-family: 'Lexend Deca', sans-serif; font-weight: 600; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius-full);
  background: var(--color-surface-2); color: var(--color-text);
  border: none; cursor: pointer; position: relative; overflow: hidden;
  transition: transform .15s var(--ease-out), background .2s;
  flex-shrink: 0;
}
.icon-btn .material-icons { font-size: 1.4rem; }
.icon-btn:active { transform: scale(.90); }
.icon-btn--dark { background: rgba(11,18,32,.75); color: #fff; }
.icon-btn--accent { background: var(--color-accent); color: #fff; }

/* ===== App shell: bottom nav ===== */
.app-bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 500;
  display: flex; justify-content: space-around; align-items: center;
  height: calc(var(--bottomnav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: color-mix(in srgb, var(--color-surface) 90%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--color-border);
}
.app-bottomnav__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; flex: 1; height: 100%; color: var(--color-text-muted);
  transition: transform .15s var(--ease-out), color .2s;
  position: relative;
  /* reset de <button> — este item também é usado pelo botão "Localizar" */
  background: none; border: none; padding: 0; font: inherit; cursor: pointer;
}
.app-bottomnav__item .material-icons { font-size: 1.5rem; }
.app-bottomnav__item span:last-child { font-size: .68rem; font-weight: 600; }
.app-bottomnav__item:active { transform: scale(.90); }
.app-bottomnav__item.is-active { color: var(--color-primary); }
.app-bottomnav__item.is-active::before {
  content: ''; position: absolute; top: 2px; width: 28px; height: 3px;
  border-radius: var(--radius-full); background: var(--color-accent);
}

@media (min-width: 992px) {
  .app-bottomnav { display: none; }
  .app-topbar { padding-left: var(--space-6); padding-right: var(--space-6); }
  .app-topbar__nav { display: flex; gap: var(--space-5); margin-left: var(--space-6); }
  .app-topbar__nav a, .app-topbar__nav button {
    background: none; border: none; padding: 0; font: inherit; cursor: pointer;
    font-weight: 600; color: var(--color-text-muted); transition: color .2s;
  }
  .app-topbar__nav a.is-active, .app-topbar__nav a:hover,
  .app-topbar__nav button:hover { color: var(--color-primary); }
}
@media (max-width: 991px) {
  .app-topbar__nav { display: none; }
}

.app-main { min-height: 100%; }
.app-main.has-chrome {
  padding-top: calc(var(--topbar-h) + var(--safe-top));
  padding-bottom: calc(var(--bottomnav-h) + var(--safe-bottom));
}

/* ===== Theme toggle ===== */
.theme-toggle .material-icons { transition: transform .4s var(--ease-out); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 12px 22px; border-radius: var(--radius-full); border: none;
  font-weight: 600; font-size: .98rem; cursor: pointer;
  transition: transform .15s var(--ease-out), background .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--color-primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-accent { background: var(--color-accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-accent:hover { background: var(--color-accent-dark); }
.btn-ghost { background: var(--color-surface-2); color: var(--color-text); }
.btn-danger { background: var(--color-danger); color: #fff; box-shadow: var(--shadow-sm); }
.btn-danger:hover { filter: brightness(1.08); }
.btn-block { width: 100%; }
.tap-scale { transition: transform .12s var(--ease-out); }
.tap-scale:active { transform: scale(.96); }

/* ===== Ripple ===== */
.ripple-host { position: relative; overflow: hidden; }
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: currentColor; opacity: .25; transform: scale(0);
  animation: ripple-anim .5s var(--ease-out);
}
@keyframes ripple-anim { to { transform: scale(2.6); opacity: 0; } }

/* ===== Skeleton ===== */
.skeleton {
  position: relative; overflow: hidden; background: var(--color-surface-2);
}
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--color-text) 8%, transparent), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ===== Cards grid (anuncios.html) =====
   Diagramação original preservada: 1º card em destaque + fluxo natural no retrato
   (altura dada pela imagem, sem media query de largura); grade "bento" 4 colunas
   densa na paisagem. Só a pele (cor/animação/badge) foi modernizada. */
#cards-container { display: grid; }

.mycard {
  --i: 0;
  position: relative; border-radius: 0; overflow: hidden; cursor: pointer;
  background: var(--color-surface-2); border: 3px solid #000;
  animation: card-in .45s var(--ease-out) both;
  animation-delay: calc(var(--i) * 40ms);
  transition: transform .2s var(--ease-out);
}
.mycard:active { transform: scale(.98); }
@keyframes card-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.mycard img, .mycard video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Badges no topo do card (título+distância, depois status), igual ao original */
.mycard .info-badge {
  position: absolute; top: 18px; left: var(--space-4); z-index: 10;
  display: flex; align-items: center; gap: 6px; overflow: hidden;
}
.mycard .info-badge .title {
  background: #fff; color: #111; font-family: 'Lexend Deca', sans-serif; font-weight: 600;
  font-size: .95rem; padding: 3px 10px; border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(0,0,0,.3); white-space: nowrap;
}
.mycard .info-badge .distance {
  background: #f5f5dc; color: #222; font-weight: 600; font-size: .85rem;
  padding: 3px 10px; border-radius: var(--radius-full); box-shadow: 0 2px 6px rgba(0,0,0,.3); white-space: nowrap;
}
.mycard .status-badge {
  position: absolute; top: 52px; left: var(--space-4); z-index: 10;
  padding: 3px 10px; border-radius: var(--radius-full); font-size: .8rem; font-weight: 700; color: #fff;
}

/* Placeholders de carregamento precisam de altura própria (não há imagem para defini-la) */
.mycard.skeleton { min-height: 220px; }
@media (orientation: portrait) {
  #cards-container > .mycard.skeleton:first-child { min-height: 55vh; }
}

@media (orientation: portrait) {
  #cards-container { grid-template-columns: 1fr; grid-auto-rows: auto; gap: var(--space-2); padding: var(--space-2); }
  #cards-container > .mycard:first-child { width: 100%; height: 98vh; }
}

@media (orientation: landscape) {
  #cards-container {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2); padding: var(--space-2);
    grid-auto-flow: dense; align-content: start;
    grid-auto-rows: calc((100vh - (var(--space-2) * 2) - (var(--space-2) * 2)) / 3);
  }
  #cards-container .mycard:first-child { grid-column: span 2; grid-row: span 2; min-height: 0; }
  #cards-container .mycard:not(:first-child) { grid-row: span 1; min-height: 0; }
}

#load-more { text-align: center; padding: var(--space-4); color: var(--color-text-muted); }

/* ===== Alternância cards / mapa (anuncios.html) ===== */
#map-view { display: none; }
body.map-mode #cards-view { display: none; }
body.map-mode #map-view { display: block; }
#map-view, #leaflet-map { width: 100%; height: 100vh; }

.map-logo {
  position: fixed; top: calc(var(--space-3) + var(--safe-top)); left: var(--space-3); z-index: 10000;
  display: flex; align-items: center; justify-content: center; pointer-events: none;
  background: var(--color-surface); box-shadow: var(--shadow-md); padding: var(--space-2);
}
.map-logo picture { display: contents; }
.map-logo img {
  height: 80px; width: auto;
}

.map-pin {
  width: 44px; height: 44px; border-radius: 50% 50% 50% 0;
  background: var(--pin-color, var(--color-accent));
  border: 3px solid #fff; box-shadow: var(--shadow-md);
  transform: rotate(-45deg);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.map-pin img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; transform: rotate(45deg); }
.map-pin .material-icons { color: #fff; font-size: 20px; transform: rotate(45deg); }

.map-user-dot { width: 18px; height: 18px; border-radius: 50%; background: #4285F4; border: 3px solid #fff; box-shadow: var(--shadow-sm); position: relative; }
.map-user-dot__pulse {
  position: absolute; inset: -14px; border-radius: 50%; background: rgba(66,133,244,.35);
  animation: map-user-pulse 2s ease-out infinite;
}
@keyframes map-user-pulse { 0% { transform: scale(.4); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }

/* ===== Pull to refresh ===== */
#ptr-indicator {
  position: fixed; left: 0; right: 0; top: var(--safe-top);
  display: flex; justify-content: center; align-items: center; height: 0;
  overflow: hidden; z-index: 400; color: var(--color-primary);
  transition: height .2s var(--ease-out);
}
#ptr-indicator .material-icons { transition: transform .1s linear; }
#ptr-indicator.is-loading .material-icons { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Bottom sheet ===== */
.sheet-backdrop {
  position: fixed; inset: 0; background: var(--color-overlay); z-index: 900;
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease-out);
}
.sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 901;
  background: var(--color-surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg); padding: var(--space-2) var(--space-5) calc(var(--space-6) + var(--safe-bottom));
  transform: translateY(100%); transition: transform .3s var(--ease-out);
  max-height: 85vh; overflow-y: auto; touch-action: none;
}
.sheet.is-open { transform: translateY(0); }
.sheet__handle { width: 40px; height: 4px; border-radius: var(--radius-full); background: var(--color-border); margin: var(--space-2) auto var(--space-4); }

#search-box { position: relative; display: flex; align-items: center; border-bottom: 2px solid var(--color-border); padding-bottom: var(--space-2); }
#search-input { flex: 1; border: none; background: transparent; font-size: 1.25rem; outline: none; }
#search-action { border: none; background: transparent; color: var(--color-text-muted); cursor: pointer; padding: var(--space-1); }

/* ===== Toggle / switch ===== */
.switch-badge {
  display: inline-flex; align-items: center; gap: var(--space-3);
  background: var(--color-surface); box-shadow: var(--shadow-md);
  padding: 12px 20px; border-radius: var(--radius-full); font-weight: 600; cursor: pointer;
  user-select: none; transition: transform .15s var(--ease-out);
}
.switch-badge:active { transform: scale(.96); }
.fixed-bottom-center.switch-badge:active { transform: translateX(-50%) scale(.96); }
.switch-toggle { width: 42px; height: 24px; background: var(--color-surface-2); border-radius: var(--radius-full); position: relative; transition: background .25s; flex-shrink: 0; }
.switch-badge.on .switch-toggle { background: var(--color-success); }
.switch-knob { width: 20px; height: 20px; background: #fff; border-radius: 50%; position: absolute; top: 2px; left: 2px; box-shadow: var(--shadow-sm); transition: left .25s var(--ease-out); }
.switch-badge.on .switch-knob { left: 20px; }

.fab-cluster { position: fixed; right: var(--space-4); bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + var(--space-4)); z-index: 600; display: flex; flex-direction: column; gap: var(--space-3); }
@media (min-width: 992px) { .fab-cluster { bottom: var(--space-6); } }

.fixed-bottom-center {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-bottom) + var(--space-4));
  z-index: 450;
}
@media (min-width: 992px) { .fixed-bottom-center { bottom: var(--space-6); } }

/* ===== Query badges ===== */
#query-badges-container { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-bottom) + 76px); display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); max-width: 92%; z-index: 400; }
.query-badge { background: var(--color-accent); color: #fff; padding: 6px 12px; border-radius: var(--radius-full); font-size: .85rem; font-weight: 600; display: flex; align-items: center; gap: var(--space-2); box-shadow: var(--shadow-sm); }
.query-badge span { cursor: pointer; font-weight: 700; opacity: .85; }

/* ===== Overlays generic ===== */
.overlay-center { position: fixed; inset: 0; z-index: 2000; display: none; justify-content: center; align-items: center; padding: var(--space-4); text-align: center; }
.overlay-center.is-visible { display: flex; }
.overlay-center--dim { background: var(--color-overlay); }
.spinner { width: 52px; height: 52px; border-radius: 50%; border: 5px solid var(--color-surface-2); border-top-color: var(--color-accent); animation: spin .9s linear infinite; }
.btn-spinner { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; vertical-align: -3px; margin-right: 4px; }

.message-toast { color: #fff; font-size: 1.1rem; max-width: 85vw; }

/* Modal de alerta/confirmação (ver static/js/modal.js) — substitui os
   alert()/confirm() nativos do navegador. */
.app-modal-overlay { z-index: 30000; }
.app-modal {
  background: var(--color-surface); border-radius: var(--radius-lg); padding: var(--space-6) var(--space-5);
  max-width: 360px; width: 100%; box-shadow: var(--shadow-lg); text-align: left;
}
.app-modal__title { font-size: 1.15rem; margin: 0 0 var(--space-2); }
.app-modal__message { color: var(--color-text-muted); line-height: 1.5; margin: 0 0 var(--space-3); white-space: pre-line; }
.app-modal__input { width: 100%; box-sizing: border-box; padding: 10px 12px; margin-bottom: var(--space-5); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg); color: var(--color-text); font: inherit; }
.app-modal__actions { display: flex; gap: var(--space-2); justify-content: flex-end; }
.app-modal__actions .btn { padding: 9px 18px; }

/* ===== Landing / localizar (overlay cards) ===== */
.hero-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: var(--space-5); text-align: center; position: relative; overflow: hidden;
  background-color: var(--color-bg);
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.hero-screen::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.35));
  z-index: 0;
}
.hero-card {
  position: relative; z-index: 1; background: color-mix(in srgb, var(--color-surface) 90%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg); padding: var(--space-7) var(--space-6);
  max-width: 420px; width: 100%; box-shadow: var(--shadow-lg);
  animation: hero-in .55s var(--ease-out) both;
}
@keyframes hero-in { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.hero-card img.logo { width: 62%; max-width: 210px; margin: 0 auto var(--space-5); }
.hero-card h2 { font-size: 1.6rem; margin-bottom: var(--space-3); }
.hero-card p { color: var(--color-text-muted); font-size: 1.02rem; line-height: 1.5; margin-bottom: var(--space-6); }

.find-location-screen { color: #fff; }
.find-location-screen img { width: 180px; margin: 0 auto var(--space-4); }
.find-location-screen div.label { font-size: 1.4rem; font-weight: 600; }

/* ===== Card detail page =====
   Mídia ocupa 100% do viewport, fixa atrás de tudo (como um pôster de fundo);
   título/badges flutuam fixos no topo, e o texto descritivo/horário/links
   ficam numa "folha" (bottom sheet) fixa colada embaixo, com fundo
   semitransparente + blur pra continuar legível em cima de qualquer foto —
   a folha rola por dentro se o conteúdo não couber, a mídia nunca se move. */
.card-detail-full { position: relative; }

.gallery {
  position: fixed; inset: 0; width: 100%; height: 100vh; z-index: 0;
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0;
  -webkit-overflow-scrolling: touch;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery > div {
  flex-shrink: 0; width: 100%; height: 100%; scroll-snap-align: center;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.gallery > div img, .gallery > div video { width: 100%; height: 100%; object-fit: cover; }

/* Gradiente permanente sobre a mídia — garante contraste pro título (topo) e
   pra folha de baixo mesmo quando a foto por trás é clara. */
.gallery-scrim {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.5) 0%, rgba(0,0,0,0) 26%, rgba(0,0,0,0) 42%, rgba(0,0,0,.8) 100%);
  transition: opacity .35s var(--ease-out);
}

/* Modo imersivo: toca na mídia de fundo (ver wireImmersiveToggle em card.js)
   pra esconder tudo por cima e ver só a galeria em tela cheia — cada grupo
   de UI sai pela borda mais próxima dele (topo, baixo, direita), não todos
   pro mesmo lugar. Toca de novo em qualquer ponto da mídia pra tudo voltar. */
.card-overlay-top, .card-detail-body, .card-icon-slide {
  transition: transform .35s var(--ease-out), opacity .35s var(--ease-out);
}
body.card-immersive .gallery-scrim { opacity: 0; }
body.card-immersive .card-overlay-top { transform: translateY(-130%); opacity: 0; pointer-events: none; }
body.card-immersive .card-detail-body { transform: translateY(130%); opacity: 0; pointer-events: none; }
body.card-immersive .card-icon-slide { transform: translateX(120px); opacity: 0; pointer-events: none; }

.card-overlay-top {
  position: fixed; top: calc(var(--space-4) + var(--safe-top)); left: var(--space-4); z-index: 20;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  max-width: calc(100vw - 150px);
}
.card-overlay-top .info-badge .title {
  background: #fff; color: #111; font-family: 'Lexend Deca', sans-serif; font-weight: 700;
  font-size: 1.5rem; padding: 8px 18px; box-shadow: 0 3px 10px rgba(0,0,0,.35); display: inline-block;
}
.info-badge-row { display: flex; flex-wrap: wrap; gap: 10px; }
.card-overlay-top .distance {
  background: #f5f5dc; color: #222; font-weight: 700; font-size: 1.05rem;
  padding: 7px 16px; box-shadow: 0 3px 10px rgba(0,0,0,.35);
}
.status-badge-wrap { position: relative; }
.card-overlay-top .status-badge {
  font-size: 1.05rem; font-weight: 700; padding: 7px 12px 7px 16px; color: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.35); border: none; cursor: pointer;
  display: flex; align-items: center; gap: 2px; font-family: inherit;
}
.status-badge__chevron { font-size: 1.2rem; transition: transform .2s ease; }
.status-badge-wrap.is-open .status-badge__chevron { transform: rotate(180deg); }
.hours-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; min-width: 220px;
  background: var(--color-bg); border-radius: var(--radius-md); box-shadow: 0 6px 20px rgba(0,0,0,.35);
  padding: var(--space-3); display: none; flex-wrap: wrap; gap: var(--space-2);
}
.status-badge-wrap.is-open .hours-dropdown { display: flex; }

.gallery-dots { position: static; display: flex; gap: 6px; z-index: 2; margin-top: 2px; }
.gallery-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.5); transition: background .2s, transform .2s; }
.gallery-dots span.is-active { background: #fff; transform: scale(1.3); }

.card-detail-body {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  max-height: 52vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: color-mix(in srgb, var(--color-bg) 85%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: 22px 22px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.4);
  padding: var(--space-3) var(--space-5) calc(var(--space-6) + var(--safe-bottom));
}
.card-detail-body::before {
  content: ''; display: block; width: 40px; height: 4px; border-radius: var(--radius-full);
  background: var(--color-text-muted); opacity: .4; margin: 0 auto var(--space-3);
}

.card-address { color: var(--color-text-muted); margin: 0 0 var(--space-2); }
.card-description { margin: 0 0 var(--space-2); line-height: 1.5; }

.hours-badge { background: var(--color-surface-2); padding: 4px 10px; border-radius: var(--radius-full); font-size: .8rem; display: flex; gap: 4px; }
.hours-day { font-weight: 700; }

/* Painel de links: 1 a 6 botões definidos pelo estabelecimento, sempre centralizados e quebrando linha */
.link-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); margin-top: var(--space-2); }
.link-button {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  background: var(--color-primary); color: #fff; border-radius: var(--radius-full); font-weight: 600;
  transition: background .2s, transform .15s var(--ease-out);
}
.link-button:hover { background: var(--color-primary-dark); }
.link-button:active { transform: scale(.95); }

/* ===== Utility ===== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.fade-in { animation: card-in .4s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }

/* ===== Painel ===== */
.painel { min-height: 100vh; display: flex; flex-direction: column; padding: var(--space-5) var(--space-4) calc(var(--space-8) + var(--safe-bottom)); max-width: 640px; margin: 0 auto; }
.painel-state { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.painel-dashboard { display: block; flex: none; align-items: unset; justify-content: unset; min-height: 0; }

@keyframes bounce-in {
  0% { transform: scale(.3) rotate(-15deg); opacity: 0; }
  60% { transform: scale(1.15) rotate(5deg); opacity: 1; }
  80% { transform: scale(.95) rotate(-2deg); }
  100% { transform: scale(1) rotate(0); }
}
.bounce-in { animation: bounce-in .6s var(--ease-out) both; }

.painel-login-card { text-align: center; max-width: 380px; }
.painel-login-icon { font-size: 4rem; color: var(--color-accent); display: block; margin: 0 auto var(--space-4); }
.painel-login-note {
  display: flex; align-items: flex-start; gap: 6px; text-align: left;
  margin-top: var(--space-3); font-size: .82rem; color: var(--color-text-muted); line-height: 1.4;
}
.painel-login-note .material-icons { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; color: var(--color-accent); }

.painel-header { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-5); }
.painel-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--color-surface-2); box-shadow: var(--shadow-sm); }
.painel-header__info { flex: 1; min-width: 0; }
.painel-header__name { font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.painel-header__email { color: var(--color-text-muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-badge {
  background: linear-gradient(135deg, #ffb703, #fb8500); color: #fff; font-weight: 700; font-size: .7rem;
  padding: 4px 10px; border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: .04em;
  animation: bounce-in .5s var(--ease-out) both;
}

.verified-badge { color: var(--color-success); display: flex; animation: bounce-in .5s var(--ease-out) both; }
.verified-badge .material-icons { font-size: 1.4rem; }

.verify-modal { max-width: 380px; text-align: center; position: relative; }
.verify-icon { font-size: 3.5rem; color: var(--color-accent); display: block; margin: 0 auto var(--space-3); }
.verify-price-hint--free {
  color: var(--color-success); background: color-mix(in srgb, var(--color-success) 12%, transparent);
  padding: 10px 14px; border-radius: var(--radius-lg); animation: bounce-in .5s var(--ease-out) both;
}
.verify-price-hint--free strong { font-weight: 800; }
.verify-waiting { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: var(--space-3); font-size: .88rem; color: var(--color-text-muted); }
.verify-waiting .btn-spinner { border-top-color: var(--color-accent); border-color: color-mix(in srgb, var(--color-accent) 30%, transparent); }

.new-card-btn { margin-bottom: var(--space-6); animation: pulse-accent 2.4s ease-in-out infinite; }
@keyframes pulse-accent { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-accent) 45%, transparent); } 50% { box-shadow: 0 0 0 10px transparent; } }

.painel-section-title { font-family: 'Lexend Deca', sans-serif; font-weight: 600; margin: var(--space-6) 0 var(--space-3); }

.painel-empty { text-align: center; color: var(--color-text-muted); padding: var(--space-6) var(--space-3); }
.painel-empty .material-icons { font-size: 2.5rem; opacity: .5; display: block; margin-bottom: var(--space-2); }
.painel-empty--small { padding: var(--space-4); }

.my-cards-list, .mod-queue { display: flex; flex-direction: column; gap: var(--space-3); }
.my-card-row, .mod-row {
  display: flex; align-items: center; gap: var(--space-3); background: var(--color-surface);
  border-radius: var(--radius-lg); padding: var(--space-3); box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease-out), opacity .25s var(--ease-out);
}
.mod-row--gone { transform: scale(.9) translateX(30px); opacity: 0; }
/* .my-card-row empilha em 2 linhas (thumb+info, depois os botões numa linha
   própria) — com tudo numa linha só (o padrão que .mod-row ainda usa), até
   2 botões de texto espremiam o título até sobrar só "abc...". */
.my-card-row { flex-direction: column; align-items: stretch; gap: var(--space-2); }
.my-card-row__top { display: flex; align-items: center; gap: var(--space-3); }
.my-card-row__thumb { width: 56px; height: 56px; border-radius: var(--radius-md); object-fit: cover; flex-shrink: 0; background: var(--color-surface-2); }
.my-card-row__info { flex: 1; min-width: 0; }
.my-card-row__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-card-row__plan { display: flex; align-items: center; gap: var(--space-2); margin-top: 4px; flex-wrap: wrap; }
.my-card-row__expiry { font-size: .78rem; color: var(--color-text-muted); }
.my-card-row__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.my-card-row__actions .btn { flex: 1; min-width: 108px; padding: 9px 12px; font-size: .85rem; white-space: nowrap; }

.status-pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: var(--radius-full); margin: 3px 0; }
.status-pending { background: color-mix(in srgb, #f4a300 20%, transparent); color: #b06d00; animation: pulse-soft 1.8s ease-in-out infinite; }
.status-published { background: color-mix(in srgb, var(--color-success) 20%, transparent); color: var(--color-success); }
.status-rejected { background: color-mix(in srgb, var(--color-danger) 20%, transparent); color: var(--color-danger); }
@keyframes pulse-soft { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

.plan-progress { display: flex; align-items: center; gap: 6px; }
.plan-progress__bar { width: 56px; height: 6px; border-radius: var(--radius-full); background: var(--color-surface-2); overflow: hidden; flex-shrink: 0; }
.plan-progress__fill { height: 100%; background: var(--color-accent); border-radius: var(--radius-full); transition: width .3s var(--ease-out); }
.plan-progress__label { font-size: .72rem; color: var(--color-text-muted); white-space: nowrap; }

.mod-row__desc { font-size: .82rem; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-row__meta { font-size: .75rem; color: var(--color-text-muted); }
.mod-row__actions { display: flex; gap: var(--space-2); flex-shrink: 0; }
.mod-row__actions .approve-btn { background: var(--color-success); }

.admin-section { margin-top: var(--space-7); border-top: 1px dashed var(--color-border); padding-top: var(--space-5); }
.admin-card { background: var(--color-surface); border-radius: var(--radius-lg); padding: var(--space-4); box-shadow: var(--shadow-sm); margin-bottom: var(--space-4); }
.admin-card h4 { margin: 0 0 var(--space-3); }
/* flex-shrink:0 no botão e nos rótulos ("R$"/"dias") é o que faltava — sem
   isso, o flex:1 do input faz TUDO na linha (rótulo e botão inclusive)
   encolher junto quando não cabe, espremendo o texto do botão "Salvar". */
.admin-fee-row { display: flex; align-items: center; gap: var(--space-2); }
.admin-fee-row input { flex: 1; min-width: 0; padding: 10px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg); color: var(--color-text); }
.admin-fee-row span { flex-shrink: 0; color: var(--color-text-muted); font-weight: 600; }
.admin-fee-row .btn { flex-shrink: 0; white-space: nowrap; padding: 10px 20px; }

.coupons-list { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
.coupon-chip {
  display: flex; align-items: center; gap: var(--space-2); background: var(--color-surface-2);
  padding: 6px 6px 6px 12px; border-radius: var(--radius-full); font-size: .82rem;
}
.coupon-chip span { color: var(--color-text-muted); }
.coupon-chip__del { background: none; border: none; cursor: pointer; color: var(--color-danger); display: flex; padding: 4px; }
.coupon-chip__del .material-icons { font-size: 1.1rem; }
.coupon-form { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.coupon-form input, .coupon-form select { padding: 9px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg); color: var(--color-text); }
.coupon-form button[type="submit"] { flex-shrink: 0; white-space: nowrap; }
.coupon-form input[type="color"] {
  padding: 3px; width: 44px; height: 38px; flex-shrink: 0; cursor: pointer;
}
.coupon-form input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.coupon-form input[type="color"]::-webkit-color-swatch { border: none; border-radius: var(--radius-sm); }
.coupon-form input[type="color"]::-moz-color-swatch { border: none; border-radius: var(--radius-sm); }
.coupon-form input[type="text"] { flex: 1; min-width: 100px; }

.kml-current-row {
  display: flex; align-items: center; gap: var(--space-2); background: var(--color-surface-2);
  padding: 8px 8px 8px 12px; border-radius: var(--radius-md); font-size: .85rem; margin-bottom: var(--space-2);
}
.kml-current-row span:not(.material-icons) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kml-current-row .icon-btn { width: 32px; height: 32px; flex-shrink: 0; }
.kml-current-row .icon-btn .material-icons { font-size: 1.1rem; }

.kml-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-3); }
.kml-row { display: flex; flex-direction: column; gap: 6px; background: var(--color-surface-2); padding: 8px 8px 8px 12px; border-radius: var(--radius-md); font-size: .85rem; }
.kml-row__main { display: flex; align-items: center; gap: var(--space-2); }
.kml-row__main span { flex: 1; }
.kml-row__source { width: 100%; padding: 5px 8px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-bg); color: var(--color-text); font-size: .78rem; box-sizing: border-box; }
.kml-row__swatch {
  width: 26px; height: 26px; flex-shrink: 0; padding: 2px; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); background: var(--color-bg); cursor: pointer;
}
.kml-row__swatch::-webkit-color-swatch-wrapper { padding: 0; }
.kml-row__swatch::-webkit-color-swatch { border: none; border-radius: 2px; }
.kml-row__swatch::-moz-color-swatch { border: none; border-radius: 2px; }
.kml-row__dash { flex-shrink: 0; padding: 4px 6px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-bg); color: var(--color-text); font-size: .78rem; max-width: 110px; }
.kml-row__del { background: none; border: none; cursor: pointer; color: var(--color-danger); display: flex; padding: 4px; }
.kml-row__del .material-icons { font-size: 1.1rem; }

/* --- Modais: novo anúncio / renovar --- */
.new-card-modal, .buy-years-modal { max-width: 480px; max-height: 90vh; overflow-y: auto; text-align: left; position: relative; }
.new-card-close { position: absolute; top: var(--space-3); right: var(--space-3); }
.new-card-hint { color: var(--color-text-muted); font-size: .9rem; margin-top: -8px; }

.field { display: block; margin-bottom: var(--space-4); }
.field__label { display: flex; justify-content: space-between; font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
.field__label small { font-weight: 400; color: var(--color-text-muted); }
.field input[type="text"], .field input[type="url"], .field input[type="number"], .field select, .field textarea {
  width: 100%; padding: 11px; border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-bg); color: var(--color-text); font-family: inherit; font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 20%, transparent); }
.field textarea { resize: vertical; }
.field-row { display: flex; gap: var(--space-3); }
.field-row .field { flex: 1; }

.char-count { font-weight: 400; color: var(--color-text-muted); font-size: .78rem; transition: color .2s; }
.char-count--near { color: var(--color-danger); font-weight: 700; }

.coupon-check { display: block; margin-top: 6px; font-size: .82rem; font-weight: 600; min-height: 1.2em; }
.coupon-check--valid { color: var(--color-success); }
.coupon-check--invalid { color: var(--color-danger); }
.coupon-check--checking { color: var(--color-text-muted); font-weight: 400; }

.slug-field { display: flex; align-items: center; gap: 0; }
.slug-field__prefix { flex-shrink: 0; padding: 9px 0 9px 12px; color: var(--color-text-muted); font-size: .95rem; background: var(--color-surface-2); border: 1px solid var(--color-border); border-right: none; border-radius: var(--radius-md) 0 0 var(--radius-md); }
.slug-field input[type="text"] { border-radius: 0 var(--radius-md) var(--radius-md) 0; }

.photo-picker {
  display: flex; align-items: center; justify-content: center; height: 140px; border-radius: var(--radius-lg);
  border: 2px dashed var(--color-border); cursor: pointer; overflow: hidden; background: var(--color-surface-2);
  transition: border-color .2s;
}
.photo-picker:hover { border-color: var(--color-accent); }
.photo-picker input[type="file"] { display: none; }
.photo-picker img { width: 100%; height: 100%; object-fit: cover; }
.photo-picker span#photo-picker-placeholder { display: flex; align-items: center; gap: var(--space-2); color: var(--color-text-muted); }

.hours-grid { display: flex; flex-direction: column; gap: var(--space-2); }
.hours-row { display: flex; flex-direction: column; gap: var(--space-2); padding: 8px 12px; background: var(--color-surface-2); border-radius: var(--radius-md); }
.hours-row__toggle { display: flex; align-items: center; gap: var(--space-2); font-size: .9rem; cursor: pointer; }
.hours-row__body { flex-direction: column; gap: var(--space-2); padding-left: calc(18px + var(--space-2)); }
.hours-24h-toggle { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--color-text-muted); cursor: pointer; width: fit-content; }
.hours-ranges { display: flex; flex-direction: column; gap: 6px; }
.hours-range { display: flex; align-items: center; gap: var(--space-2); font-size: .85rem; }
.hours-range input[type="time"] { padding: 5px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-bg); color: var(--color-text); }
.hours-range-remove { background: none; border: none; cursor: pointer; color: var(--color-text-muted); display: flex; padding: 2px; }
.hours-range-remove .material-icons { font-size: 1.1rem; }
.hours-range-add {
  display: flex; align-items: center; gap: 4px; background: none; border: none; cursor: pointer;
  color: var(--color-accent); font-weight: 600; font-size: .82rem; padding: 4px 0; width: fit-content;
}
.hours-range-add .material-icons { font-size: 1.1rem; }

.links-list { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-2); }
.link-row { display: flex; gap: var(--space-2); align-items: center; }
.link-row input { flex: 1; min-width: 0; }
.link-row-remove { background: none; border: none; cursor: pointer; color: var(--color-text-muted); display: flex; padding: 4px; flex-shrink: 0; }
.link-row-remove .material-icons { font-size: 1.2rem; }

.pin-map-wrap { position: relative; height: 220px; border-radius: var(--radius-lg); overflow: hidden; transition: height .25s var(--ease-out); }
.pin-map-wrap.is-expanded { height: 65vh; }
#pin-map { width: 100%; height: 100%; }
.pin-locate-btn { position: absolute; bottom: var(--space-2); right: var(--space-2); z-index: 500; }
.pin-expand-btn { position: absolute; top: var(--space-2); right: var(--space-2); z-index: 500; }

.new-card-error { color: var(--color-danger); font-size: .85rem; min-height: 1.2em; margin-bottom: var(--space-2); }

.new-card-success { text-align: center; padding: var(--space-6) var(--space-3); }
@keyframes success-pop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); }
}
.success-check { font-size: 4.5rem; color: var(--color-success); display: block; margin: 0 auto var(--space-3); animation: success-pop .5s var(--ease-out) both; }

.years-picker { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.year-option {
  padding: 10px 16px; border-radius: var(--radius-full); border: 2px solid var(--color-border);
  background: var(--color-surface); color: var(--color-text); font-weight: 600; cursor: pointer;
  transition: all .2s var(--ease-out);
}
.year-option.is-selected { border-color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 15%, transparent); transform: scale(1.05); }
.buy-total { text-align: center; font-size: 1.1rem; margin-bottom: var(--space-4); }

/* ===== Slots de mídia (foto/vídeo) + câmera embutida ===== */
.media-slots-btn { margin-bottom: var(--space-3); display: none; }
@media (max-width: 767.98px) { .media-slots-btn { display: flex; } }

.media-slots { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-2); margin-bottom: var(--space-2); }
.media-slot {
  position: relative; height: 100px; border-radius: var(--radius-lg);
  border: 2px dashed var(--color-border); cursor: pointer; overflow: hidden; background: var(--color-surface-2);
  display: flex; align-items: center; justify-content: center; transition: border-color .2s;
}
.media-slot:hover { border-color: var(--color-accent); }
.media-slot input[type="file"] { display: none; }
.media-slot img, .media-slot video { width: 100%; height: 100%; object-fit: cover; display: none; }
.media-slot__placeholder { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--color-text-muted); font-size: .72rem; text-align: center; padding: 4px; }
.media-slot__placeholder .material-icons { font-size: 1.4rem; }
.media-slot.has-media { border-style: solid; padding: 0; cursor: grab; touch-action: none; }
.media-slot.is-dragging { opacity: .4; position: relative; z-index: 5; transition: none; }
.media-slot.is-drag-over { outline: 2.5px dashed var(--color-accent); outline-offset: -2.5px; }
.media-slot__remove {
  position: absolute; top: 4px; right: 4px; z-index: 2; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; border: none; display: none; align-items: center; justify-content: center; padding: 0;
}
.media-slot.has-media .media-slot__remove { display: flex; }
.media-slot__remove .material-icons { font-size: 1rem; }

/* ---------- Câmera embutida (captura de foto/vídeo pro anúncio) ---------- */
/* Layout em flex-flow normal (topbar → espaçador flexível → previewbar →
   hint → bottombar, um embaixo do outro na ordem do documento) — não posições
   absolutas com número mágico de "bottom: 130px" feito no chute. Isso é
   proposital: a versão antiga com posição absoluta podia sobrepor a barra de
   preview em cima da bottombar dependendo da altura de cada uma (variável
   por causa do safe-area-inset de cada aparelho), fazendo o toque no botão
   "Usar" cair por cima do botão de captura por baixo — dava a impressão de
   "preciso clicar várias vezes". Flex-flow elimina essa sobreposição de vez. */
.pm-camera-overlay { position: fixed; inset: 0; background: #000; z-index: 20000; display: none; flex-direction: column; touch-action: none; }
.pm-camera-overlay.open { display: flex; }
.pm-camera-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.pm-camera-video.mirror { transform: scaleX(-1); }
.pm-camera-canvas { display: none; }
.pm-camera-topbar { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: calc(14px + var(--safe-top)) 16px 14px; gap: 8px; }
.pm-camera-roundbtn { width: 42px; height: 42px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; border: none; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pm-camera-status { flex: 1; text-align: center; color: #fff; font-size: 13px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.pm-camera-actions { display: flex; gap: 8px; }
.pm-camera-spacer { flex: 1; position: relative; z-index: 1; }
.pm-camera-previewbar { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 6px 16px; min-height: 84px; }
.pm-camera-previewlist { display: flex; gap: 8px; flex: 1; overflow-x: auto; }
.pm-camera-thumb { position: relative; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; flex-shrink: 0; border: 2px solid #fff; cursor: pointer; }
.pm-camera-thumb img, .pm-camera-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.pm-camera-thumb__play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.pm-camera-thumb__play .material-icons { font-size: 26px; color: rgba(255,255,255,.9); text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.pm-camera-hint { position: relative; z-index: 2; color: rgba(255,255,255,.75); font-size: 12.5px; text-align: center; padding: 0 16px 6px; }
.pm-camera-bottombar {
  position: relative; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 10px 20px calc(24px + var(--safe-bottom));
}
.pm-camera-capturewrap { grid-column: 2; justify-self: center; position: relative; width: 92px; height: 92px; }
.pm-camera-progress { position: absolute; inset: 0; width: 92px; height: 92px; transform: rotate(-90deg); }
.pm-camera-progress-track, .pm-camera-progress-value { fill: none; stroke-width: 7; }
.pm-camera-progress-track { stroke: rgba(255,255,255,.3); }
.pm-camera-progress-value { stroke: var(--color-danger); stroke-linecap: round; transition: stroke-dashoffset .05s linear; }
.pm-camera-capturebtn {
  width: 78px; height: 78px; border-radius: 50%; background: #fff; border: none;
  position: absolute; top: 7px; left: 7px; display: flex; align-items: center; justify-content: center; padding: 0;
  touch-action: none;
}
.pm-camera-capturecore { width: 64px; height: 64px; border-radius: 50%; background: #fff; border: 2px solid #000; transition: all .15s ease; display: block; }
.pm-camera-overlay.recording .pm-camera-capturecore { border-radius: 10px; background: var(--color-danger); width: 32px; height: 32px; border-color: var(--color-danger); }
.pm-camera-confirm { grid-column: 3; justify-self: end; }
.pm-camera-confirm:disabled { opacity: .4; pointer-events: none; }
.pm-camera-zoom-label {
  position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 3; pointer-events: none;
  background: rgba(0,0,0,.55); color: #fff; font-size: 14px; font-weight: 700;
  padding: 5px 14px; border-radius: var(--radius-full); backdrop-filter: blur(4px);
}
body.pm-camera-open { overflow: hidden; }

/* Preview de uma mídia já capturada (toque na miniatura) — tela cheia dentro
   do overlay da câmera, com um botão de excluir de tamanho normal em vez do
   "x" minúsculo em cima da miniatura que ninguém conseguia tocar. */
.pm-camera-mediapreview { position: absolute; inset: 0; z-index: 10; background: #000; display: none; flex-direction: column; }
.pm-camera-mediapreview.open { display: flex; }
.pm-camera-mp-topbar { display: flex; align-items: center; padding: calc(14px + var(--safe-top)) 16px 14px; gap: 8px; }
.pm-camera-mp-body { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0 12px calc(16px + var(--safe-bottom)); }
.pm-camera-mp-body video, .pm-camera-mp-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pm-camera-del-btn { background: var(--color-danger); }

/* Mesmo padrão de preview em tela cheia acima, só que fora do overlay da
   câmera (usado pelos slots de mídia do formulário de anúncio — ver
   openSlotPreview em painel.js) — por isso position:fixed em vez de
   absolute, já que aqui não tem um ancestral fixed cobrindo a tela. */
.media-fullscreen-preview { position: fixed; inset: 0; z-index: 25000; background: #000; display: none; flex-direction: column; }
.media-fullscreen-preview.open { display: flex; }

/* ===== Preview de anúncio pro admin (moderação + busca) ===== */
.admin-search-row { display: flex; gap: var(--space-2); margin-bottom: var(--space-3); }
.search-input-wrap { position: relative; flex: 1; min-width: 0; }
.search-input-wrap input { width: 100%; padding: 9px 34px 9px 9px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg); color: var(--color-text); }
.search-input-clear {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 26px; height: 26px; border: none; background: transparent; color: var(--color-text-muted);
  display: none; align-items: center; justify-content: center; padding: 0; border-radius: 50%; cursor: pointer;
}
.search-input-clear:hover { background: var(--color-surface-2); }
.search-input-clear .material-icons { font-size: 1.1rem; }
.search-input-wrap.has-value .search-input-clear { display: flex; }
.mod-row, .my-card-row { cursor: pointer; }

.admin-card-preview {
  position: fixed; inset: 0; z-index: 26000; background: var(--color-bg); display: none; flex-direction: column;
}
.admin-card-preview.open { display: flex; }
.admin-card-preview .pm-camera-mp-topbar { background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.admin-card-preview .pm-camera-roundbtn { background: var(--color-surface-2); color: var(--color-text); }
.admin-card-preview__body { flex: 1; overflow-y: auto; padding: var(--space-4) var(--space-5) var(--space-4); }
.admin-card-preview__body h2 { margin-bottom: var(--space-3); }
.admin-preview-media { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-3); }
.admin-preview-media img, .admin-preview-media video { width: 100%; max-height: 320px; object-fit: cover; border-radius: var(--radius-md); display: block; }
.admin-preview-text { line-height: 1.5; margin-bottom: var(--space-3); }
.admin-preview-meta { display: flex; flex-direction: column; gap: var(--space-2); color: var(--color-text-muted); font-size: .9rem; margin-bottom: var(--space-3); }
.admin-preview-meta > div { display: flex; align-items: center; gap: 6px; }
.admin-preview-meta .material-icons { font-size: 1.1rem; flex-shrink: 0; }
.admin-preview-hours { position: static; box-shadow: none; padding: 0; margin-bottom: var(--space-3); background: none; display: flex; }
.admin-preview-rejection { background: color-mix(in srgb, var(--color-danger) 12%, transparent); color: var(--color-danger); padding: var(--space-3); border-radius: var(--radius-md); font-size: .9rem; margin-bottom: var(--space-3); }
.admin-card-preview__actions { display: flex; gap: var(--space-2); padding: var(--space-3) var(--space-5) calc(var(--space-4) + var(--safe-bottom)); border-top: 1px solid var(--color-border); background: var(--color-surface); }
.admin-card-preview__actions .btn { flex: 1; }

/* ===== Pix (QR + slide pra confirmar) ===== */
.pix-qr-img { display: block; width: 220px; height: 220px; margin: 0 auto var(--space-3); box-shadow: var(--shadow-md); }
.pix-copy-row { display: flex; gap: var(--space-2); margin-bottom: var(--space-2); }
.pix-copy-row input { flex: 1; min-width: 0; font-size: .75rem; font-family: monospace; }

.slide-confirm__track {
  position: relative; height: 52px; border-radius: var(--radius-full); background: var(--color-surface-2);
  display: flex; align-items: center; overflow: hidden; user-select: none;
}
.slide-confirm__label { flex: 1; text-align: center; font-size: .82rem; font-weight: 600; color: var(--color-text-muted); pointer-events: none; padding: 0 var(--space-6); }
.slide-confirm__handle {
  position: absolute; left: 4px; top: 4px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--color-accent); color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: grab; touch-action: none; transition: background .2s;
}
.slide-confirm.is-confirmed .slide-confirm__track { background: color-mix(in srgb, var(--color-success) 25%, transparent); }
.slide-confirm.is-confirmed .slide-confirm__handle { background: var(--color-success); cursor: default; }

/* ===== Transações do card (status, thread de mensagens, resposta) ===== */
.tx-status-pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: var(--radius-full); margin-top: 4px; }
.tx-status-pending, .tx-status-awaiting_confirmation { background: color-mix(in srgb, #f4a300 20%, transparent); color: #b06d00; }
.tx-status-rejected { background: color-mix(in srgb, var(--color-danger) 20%, transparent); color: var(--color-danger); }
.tx-thread { margin-top: var(--space-2); display: flex; flex-direction: column; gap: 6px; }
.tx-message { padding: 8px 10px; border-radius: var(--radius-md); font-size: .82rem; max-width: 90%; }
.tx-message--admin { background: var(--color-surface-2); align-self: flex-start; }
.tx-message--user { background: color-mix(in srgb, var(--color-accent) 15%, transparent); align-self: flex-end; }
.tx-message a { color: var(--color-accent); font-weight: 600; }
.tx-reply-form { display: flex; flex-direction: column; gap: 6px; margin-top: var(--space-2); }
.tx-reply-form textarea { width: 100%; padding: 8px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg); color: var(--color-text); font-family: inherit; font-size: .85rem; resize: vertical; }
.tx-reply-form .field-row { display: flex; gap: 6px; align-items: center; }

.pending-payments-list { display: flex; flex-direction: column; gap: var(--space-3); }
.payment-row { background: var(--color-surface-2); border-radius: var(--radius-lg); padding: var(--space-3); }
.payment-row__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); margin-bottom: 4px; }
.payment-row__title { font-weight: 700; }
.payment-row__amount { font-weight: 700; color: var(--color-accent); }
.payment-row__meta { font-size: .78rem; color: var(--color-text-muted); margin-bottom: 6px; }
.payment-row__actions { display: flex; flex-direction: column; gap: 6px; margin-top: var(--space-2); }
.payment-row__actions .field-row { display: flex; gap: 6px; }
.payment-row__actions input { flex: 1; padding: 8px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg); color: var(--color-text); font-size: .82rem; }

/* Legenda de nome sobre KML (ponto/polígono — trilha usa leaflet-textpath, sem tooltip) */
.kml-label {
  background: rgba(255,255,255,.92); color: #222; font-weight: 700; font-size: 12px;
  padding: 2px 8px; border: none; border-radius: 3px; box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.kml-label::before { display: none; }

/* ===== Termos de Uso / Política de Privacidade (markdown renderizado) ===== */
.legal-page { max-width: 720px; margin: 0 auto; padding: calc(var(--space-8) + var(--safe-top)) var(--space-5) calc(var(--space-8) + var(--safe-bottom)); }
.legal-content h1 { font-family: 'Lexend Deca', sans-serif; font-size: 1.6rem; margin-bottom: var(--space-5); }
.legal-content h2 { font-family: 'Lexend Deca', sans-serif; font-size: 1.15rem; margin: var(--space-7) 0 var(--space-3); border-top: 1px solid var(--color-border); padding-top: var(--space-5); }
.legal-content h2:first-of-type { border-top: none; padding-top: 0; }
.legal-content p, .legal-content li { line-height: 1.65; color: var(--color-text); }
.legal-content p { margin: 0 0 var(--space-3); }
.legal-content ul, .legal-content ol { margin: 0 0 var(--space-3); padding-left: 1.4em; }
.legal-content li { margin-bottom: 6px; }
.legal-content a { color: var(--color-accent); font-weight: 600; }
.legal-content strong { font-weight: 700; }
.legal-content hr { border: none; border-top: 1px solid var(--color-border); margin: var(--space-6) 0; }
.legal-content table { width: 100%; border-collapse: collapse; margin: 0 0 var(--space-4); font-size: .88rem; }
.legal-content th, .legal-content td { border: 1px solid var(--color-border); padding: 8px 10px; text-align: left; }
.legal-content th { background: var(--color-surface-2); font-weight: 700; }
.legal-content > p:first-of-type { color: var(--color-text-muted); font-size: .88rem; font-style: italic; }

.legal-links { font-size: .8rem; color: var(--color-text-muted); text-align: center; margin-top: var(--space-3); }
.legal-links a { color: var(--color-text-muted); text-decoration: underline; }
