/* Web-only discovery: a side workspace on desktop, search + sheet on mobile. */
.map-discovery { color: var(--text-main); }
html:has(body.home-fixed .discovery-enabled), body.home-fixed:has(.discovery-enabled) { height: 100dvh; overflow: hidden; }
body.home-fixed:has(.discovery-enabled) #app > footer { display: none; }
.discovery-progress-content > footer { padding: 16px 0 0 !important; text-align: left !important; }
body.home-fixed:has(.discovery-enabled) .app-header { background: var(--surface); border-color: var(--border); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
.discovery-search-area { position: absolute; z-index: 680; top: 96px; left: 16px; right: 16px; }
.discovery-desktop-intro, .discovery-legal { display: none; }
.discovery-search { display: flex; align-items: center; gap: 10px; padding: 0 16px; min-height: 54px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; }
.discovery-search-icon { display: flex; color: var(--text-muted); flex: none; }
.discovery-search input { width: 100%; min-width: 0; min-height: 52px; border: 0; background: transparent; color: var(--text-main); font: inherit; font-size: 15px; outline: none; }
.discovery-search input::placeholder { color: var(--text-muted); opacity: 1; }
.discovery-search:focus-within { outline: 2px solid var(--teal); outline-offset: 3px; }
.discovery-results { margin-top: 8px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; max-height: min(42dvh, 340px); overflow-y: auto; box-shadow: 0 12px 32px rgba(33,32,28,.12); }
.discovery-results ul { padding: 0; margin: 0; list-style: none; }
.discovery-results button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 62px; border: 0; border-radius: 12px; padding: 10px; text-align: left; color: var(--text-main); background: transparent; cursor: pointer; }
.discovery-results button > span:first-child { font-size: 24px; }
.discovery-results button > span:nth-child(2) { display: grid; gap: 2px; flex: 1; }
.discovery-results strong { font-weight: 600; font-size: 15px; }
.discovery-results small { color: var(--text-muted); font-size: 13px; }
.discovery-results p { margin: 8px; font-size: 14px; line-height: 1.5; }
.discovery-search-status { background: var(--surface); border-radius: 10px; font-size: 12px; line-height: 1.4; margin: 6px 0 0; padding: 6px 10px; }
.discovery-search-status:empty { display: none; }
.discovery-sheet { position: absolute; z-index: 670; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); max-height: min(48dvh, 440px); overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: 0 8px 24px rgba(33,32,28,.08); animation: discovery-enter 240ms cubic-bezier(.23,1,.32,1); }
.discovery-sheet > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 16px 20px; list-style: none; font-family: var(--font-display); font-size: 16px; font-weight: 600; cursor: pointer; }
.discovery-sheet > summary::-webkit-details-marker { display: none; }
.discovery-chevron { transition: transform 180ms ease; }
.discovery-sheet:not([open]) .discovery-chevron { transform: rotate(180deg); }
.discovery-sheet-content { padding: 0 20px 18px; display: grid; gap: 18px; }
.discovery-welcome { padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.discovery-welcome p { color: var(--text-muted); font-size: 14px; line-height: 1.6; margin: 0; max-width: 46ch; text-wrap: pretty; }
.discovery-welcome p:first-child { color: var(--text-main); font-family: var(--font-display); font-size: 22px; letter-spacing: -.5px; line-height: 1.2; margin-bottom: 8px; }
.discovery-welcome button { display: inline-flex; align-items: center; gap: 12px; padding: 0; min-height: 44px; margin-top: 6px; color: var(--teal); font-size: 14px; font-weight: 600; border: 0; background: transparent; cursor: pointer; }
.discovery-welcome #discoveryWelcomeError { color: var(--text-main); font-size: 13px; }
.discovery-country { display: flex; gap: 16px; text-align: left; color: var(--text-main); border: 0; border-radius: 16px; padding: 0; background: var(--bg); cursor: pointer; overflow: hidden; }
.discovery-country-photo { width: 86px; height: 126px; flex: none; object-fit: cover; }
.discovery-country-flag { display: grid; place-items: center; font-size: 36px; background: var(--surface-light); }
.discovery-country-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding: 12px 12px 12px 0; min-width: 0; }
.discovery-eyebrow { font-size: 11px; letter-spacing: .04em; color: var(--text-muted); font-weight: 600; }
.discovery-country strong { font-family: var(--font-display); font-size: 23px; line-height: 1.1; letter-spacing: -.5px; }
.discovery-country-copy > span:not([class]) { font-size: 13px; color: var(--text-muted); }
.discovery-country-link { font-size: 13px; font-weight: 600; margin-top: 6px; color: var(--teal); }
.discovery-map-hint { margin: 0; font-size: 12px; line-height: 1.5; color: var(--text-muted); }
.discovery-progress { border-top: 1px solid var(--border); padding-top: 6px; }
.discovery-progress > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-muted); font-size: 13px; }
.discovery-progress > summary::before { content: '+'; font-size: 18px; }
.discovery-progress[open] > summary::before { content: '−'; }
#mapDiscovery .home-bottom-stack { position: static; padding: 0; gap: 0; }
#mapDiscovery #homePrayerTeaser { display: none; }
#mapDiscovery .map-impact-area .progress-card { width: 100%; margin: 0; padding: 12px 0; border: 0; border-radius: 0; background: var(--surface); backdrop-filter: none; box-shadow: none; }
#mapDiscovery .country-preview { left: 16px; right: 16px; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); max-width: none; max-height: min(48dvh, 440px); overflow-y: auto; border-radius: 24px; padding: 20px; background: var(--surface); backdrop-filter: none; }
#tabHome.preview-open .discovery-sheet { display: none; }
.map-discovery button:focus-visible, .map-discovery summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.map-discovery button { transition: background-color 180ms ease, transform 140ms ease; }
.map-discovery button:active { transform: scale(.98); }
@media (hover: hover) {
  .discovery-results button:hover { background: var(--bg); }
  .discovery-country:hover { background: var(--surface-light); }
}
@keyframes discovery-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 1023px) {
  #tabHome.discovery-enabled #map { min-height: 0; height: calc(100dvh - 160px); }
  #tabHome.discovery-enabled .map-controls { top: 170px; right: 16px; }
  .map-discovery:has(.discovery-search:focus-within) .discovery-sheet { display: none; }
  .discovery-welcome { display: flex; align-items: center; gap: 16px; padding-bottom: 12px; }
  .discovery-welcome p:first-child { display: none; }
  .discovery-welcome p:nth-child(2) { font-size: 13px; flex: 1; }
  .discovery-welcome button { flex: none; margin: 0; }
  .discovery-country-photo { height: 96px; }
  .discovery-map-hint { display: none; }
  /* Opção B (Ehnzo, 27/10): globo inteiro; busca e "ore hoje" embaixo; sem folha, sem zoom (pinça basta). */
  body.home-fixed:has(.discovery-enabled) .app-header-legal { display: none; }
  #tabHome.discovery-enabled #map { height: 100dvh; } /* globo centrado entre o topo e a busca */
  #tabHome.discovery-enabled .map-controls, .discovery-sheet { display: none; }
  /* +36px: a nav flutua 16px acima da borda e a linha do CNPJ fica entre ela e a busca/prévia. */
  .discovery-search-area, #mapDiscovery .country-preview { top: auto; bottom: calc(var(--nav-h) + 36px + env(safe-area-inset-bottom)); }
  /* Fora da área de busca: continua visível com a prévia do país aberta. */
  .discovery-legal { display: block; position: absolute; z-index: 680; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 19px + env(safe-area-inset-bottom)); margin: 0; text-align: center; font-size: 10px; color: var(--text-muted); }
  /* Resultados acima do campo: embaixo o teclado do celular os cobriria. */
  .discovery-search-area { display: flex; flex-direction: column; }
  #mapCountryResults, #mapSearchStatus { order: -1; margin: 0 0 8px; }
  #mapDiscovery #homePrayerTeaser:not(:empty) { display: flex; box-sizing: border-box; width: 100%; min-height: 54px; margin: 8px 0 0; border-radius: 18px; background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
  #mapDiscovery .discovery-search:focus-within ~ #homePrayerTeaser, #mapDiscovery #mapCountryResults:not([hidden]) ~ #homePrayerTeaser, #tabHome.preview-open .discovery-search-area { display: none; }
}
@media (min-width: 1024px) {
  /* Computador (Ehnzo, 2026-11-03): o azul do globo era um retângulo recuado sobre o
     body cinza (costura cinza/azul) e a coluna da esquerda era um card solto. Agora o
     fundo do globo cobre a tela toda (centro no globo) e a coluna é texto direto sobre
     ele, alinhada à margem do header, como o destaque de um catálogo de streaming. */
  #tabHome.discovery-enabled { --discovery-col: 340px; background: radial-gradient(75% 90% at calc(50% + (var(--page-gutter) + var(--discovery-col)) / 2) calc(50% + 40px), #ffffff 0%, #eaf3fb 62%, #dceaf6 100%); }
  #tabHome.discovery-enabled #map { margin-left: calc(var(--page-gutter) + var(--discovery-col)); width: calc(100% - var(--page-gutter) - var(--discovery-col)); height: calc(100dvh - 120px); min-height: 0; top: 100px; background: transparent; }
  #tabHome.discovery-enabled .map-controls { top: 20px; right: var(--page-gutter); }
  .map-discovery { position: absolute; z-index: 670; left: var(--page-gutter); top: 122px; width: var(--discovery-col); max-height: calc(100dvh - 146px); overflow-y: auto; padding: 24px 0; scrollbar-width: thin; }
  .discovery-country { background: var(--surface); border: 1px solid var(--border); }
  .discovery-search-area { position: relative; top: auto; left: auto; right: auto; }
  .discovery-desktop-intro { display: grid; gap: 12px; padding-bottom: 22px; }
  .discovery-desktop-intro .discovery-eyebrow { margin: 0; color: var(--teal); }
  .discovery-desktop-intro h1 { margin: 0; font-family: var(--font-display); font-size: 34px; line-height: 1.08; letter-spacing: -1.2px; font-weight: 600; }
  .discovery-desktop-intro > p:last-child { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-muted); text-wrap: pretty; }
  .discovery-search { padding-inline: 12px; border-radius: 14px; }
  .discovery-search input { font-size: 13px; }
  .discovery-sheet { position: relative; inset: auto; border: 0; border-radius: 0; box-shadow: none; background: transparent; margin-top: 8px; max-height: none; overflow: visible; animation: none; }
  .discovery-sheet > summary { padding: 14px 0; font-size: 14px; }
  .discovery-sheet-content { padding: 0; gap: 18px; }
  .discovery-country { gap: 12px; }
  .discovery-country-photo { width: 76px; height: 126px; }
  .discovery-country-copy { padding-right: 8px; }
  .discovery-country strong { font-size: 22px; }
  .discovery-country .discovery-eyebrow { font-size: 10px; }
  #mapDiscovery .country-preview { position: relative; inset: auto; padding: 20px 0 0; border: 0; background: transparent; border-radius: 0; margin: 0; box-shadow: none; max-height: none; overflow: visible; }
}
@media (prefers-reduced-motion: reduce) {
  .discovery-sheet { animation: none; }
  .map-discovery button, .discovery-chevron { transition: none; }
  .map-discovery button:active { transform: none; }
}
