:root {
  /* === Cores Base e Tema (LabQ Claro Otimizado) === */
  --bg: #f7f9fc; /* Fundo principal da página (Feed) */
  --card: #ffffff; /* Fundo do card/container (Branco puro) */
  --card-alt: #f1f4f8; /* Fundo alternativo/hover/drawer (Quase branco) */
  --card-alt-escuro: #d1d4d8; /* Fundo alternativo/drawer (Mais escuro) */
  --border: #e0e4e9; /* Borda/Divisor (Cinza claro sutil) */
  --accent: #3b82f6; /* Cor primária de destaque (Azul LabQ) */
  --text: #1f2937; /* Cor principal do texto (Cinza escuro) */
  --muted: #6b7280; /* Cor de texto secundário/muted */
  --error: #c62828;
  --link: #1d4ed8;

  --cor_caption_filtro: black;
  --chip: #eef1f5; /* Fundo do chip (Muito claro) */

  --header-bg-top: rgba(247, 249, 252, 0.95);
  --header-bg-bottom: rgba(247, 249, 252, 0.85);
  --shadow-color: rgba(0, 0, 0, 0.1);

  /* Botões e FAB */
  --button-text-light: #ffffff;
  --button-primary-top: #4e9afc;
  --button-primary-bottom: #3b82f6;
  --fab-primary-top: #509699;
  --fab-primary-bottom: #00000a;
  --fab-shadow: rgba(59, 130, 246, 0.35);

  /* Card Flip & Cores Victoria */
  --face-front-primary: #ffffff; /* Frente branca desde o primeiro desenho do pool. */
  --primary: #155f7d;
  --white: var(--button-text-light); /* Alias */
  --radius-lg: 3.75rem;
  --shadow-soft: 0 20px 60px rgba(28, 36, 58, 0.2);

  /* Layout, Tamanhos e Gaps */
  --radius: 18px;
  --gap: 12px;
  --gap1: 6px;
  --gap2: 6px;
  --gap-v: 4px;
  --header-padding-x: 12px;
  --app-header-h: clamp(24px, 5svh, 44px); /* truque para reduzir reflow */
  --slot-h: 380px;
  --logo-h: max(calc(var(--slot-h) * 0.17), 64px);
  --actions-bottom-gap: 8px;
  --chip-h-px: 24px;
  --fab-size: 58px;
  --fab-scale: 0.7;
  --fab-d: calc(var(--fab-size) * var(--fab-scale));
  --hero-aspect: 800 / 340;

  /* Banner */
  --banner-bg-light: var(--card);
  --banner-border-color: var(--border);
  --banner-internal-margin: 20px;
  --banner-internal-margin-first: 42px;
  --banner-internal-margin-last: 10px;
  --shadow-dark-low: 0 4px 10px 0 rgba(0, 0, 0, 0.08);
  --shadow-dark-medium: 0 10px 20px 0 rgba(0, 0, 0, 0.12);

  /* Fontes */
  --fs-base: 14px;
  --title-fs: 15px;
  --sigla-fs: 10px;
  --meta-fs: 12px;
  --chip-fs: 12px;
  --title-pad-x: 6px;

  /* Verso do Card (Back) - Consolidado */
  --back-gap-v: 6px;
  --back-line-h: 1.2;
  --back-logo-frac: 0.16;
  --back-btn-fs: 12px;
  --back-caption-fs: 13px;
  --back-value-fs: 13px;
  --back-inst-fs: 14px;
  --back-title-fs: 13px;
  --back-body-max-h: auto;

  /* Virtualização e Scroll */
  --scroll-damping: 0.07;
  --scroll-duration: 8000ms;
}

/* === Reset / Globais === */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial,
    "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  overscroll-behavior: none;
  overflow: hidden;
}

#app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

main#mainScroll {
  height: 100dvh; /* em vez de min-height */
  min-height: 0;
  box-sizing: border-box;

  /* NÃO use padding:12px aqui (isso cria a sobra) */
  padding-left: 12px;
  padding-right: 12px;
  padding-top: var(--app-header-h);
  padding-bottom: 0;

  overflow: hidden; /* garante que main não vira scroller */
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 900px;
  margin: 0 auto;
}

/* === Header === */
header {
  flex: 0 0 auto;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--app-header-h);
  z-index: 900;
  overflow: hidden;

  backdrop-filter: blur(8px);
  background: linear-gradient(180deg, var(--header-bg-top), var(--header-bg-bottom));
  border-bottom: 1px solid var(--border);
}

.app-header__inner {
  height: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0;

  display: flex;
  align-items: center;
  gap: 10px;

  container-type: inline-size;
  container-name: header-content;
}

.app-logo {
  height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  image-rendering: -webkit-optimize-contrast;
  margin-left: var(--header-padding-x);
  visibility: hidden;
}

.brand {
  padding-left: 0;
  padding-right: var(--header-padding-x);
  font-size: 14px;
  line-height: 1.25;
  font-weight: 550;
  letter-spacing: 0.3px;

  flex: 1 1 auto;
  min-width: 0;

  display: block;
  text-align: center;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  background: transparent;
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

/* === Feed/Scroller (Viewport) === */
#feedViewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;

  overflow-y: auto;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;

  scrollbar-width: none;
  -ms-overflow-style: none;

  transform: translateZ(0);
  will-change: scroll-position;
}

#feedViewport::-webkit-scrollbar {
  display: none;
}

/* Scrollbar Suave (JS-injetado) */
.has-smooth-scrollbar #feedViewport {
  overflow: hidden !important;
  position: relative;
}
.has-smooth-scrollbar #feedViewport .scrollbar-track {
  display: none !important;
}
.has-smooth-scrollbar main,
.has-smooth-scrollbar #mainScroll {
  overflow: visible !important;
  height: auto !important;
  min-height: 0 !important;
}

/* Scrollbar Nativa (Padrão) */
:root:not(.has-smooth-scrollbar) #feedViewport {
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
}
:root:not(.has-smooth-scrollbar) #feedViewport::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* === Virtualização === */
#spacer {
  position: relative;
  min-height: 1px;
}
#pool {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  overflow: visible;
  will-change: transform;
  transform: translateZ(0);
}

.card {
  min-height: var(--slot-h);
}
#pool,
#pool > article,
.card {
  content-visibility: visible !important;
  contain-intrinsic-size: auto !important;
}
html.card-calibrating #pool {
  visibility: hidden;
}

/* === Card (Base) === */
.card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  padding-bottom: var(--actions-bottom-gap) !important;
  margin: 0 0 var(--gap) 0;
  box-shadow: var(--shadow-dark-medium);
  box-sizing: border-box;

  height: var(--slot-h);
  min-height: var(--slot-h);
  max-height: var(--slot-h);

  display: block;
  overflow: visible; /* valor efetivo do seu CSS original */
}

/* Card de Curso (com Flip) */
.card.eh_curso {
  position: relative;
  overflow: hidden;
  padding-top: 8px;
  padding-bottom: 8px;
}

/* Card com flip: cor/borda do curso (via :has) */
.card:has(.flip) {
  background: #fff;
  border: 4px solid #000;
}

/* Alinha alturas internas (curso) */
.card.eh_curso .flip,
.card.eh_curso .flip-inner,
.card.eh_curso .face {
  height: 100%;
  box-sizing: border-box;
}

/* Card de Banner */
.card:has(.contem_banner),
article.card.eh_banner {
  background: var(--banner-bg-light) !important;
  border-color: var(--banner-border-color) !important;
  box-shadow: var(--shadow-dark-low);
  padding: 0 !important;
  position: relative;
  overflow: hidden;
}

/* Container Interno do Banner */
.card .contem_banner,
article.card.eh_banner > .contem_banner {
  padding: var(--banner-internal-margin) !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 100% !important;

  background: transparent !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* Sobrescritas de Margem do Banner (primeiro/último) */
#pool > .card:first-child:has(.contem_banner) .contem_banner {
  padding: var(--banner-internal-margin-first) !important;
}
#pool > .card:last-child:has(.contem_banner) .contem_banner {
  padding: var(--banner-internal-margin-last) !important;
}

/* Banner Iframe / img */
.card .contem_banner .banner-img,
article.card.eh_banner > .contem_banner > .banner-iframe {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border: 0;
  z-index: 0;
  pointer-events: none; /* Essencial para o scroll do feed */
}

/* Encerramento ocupa o mesmo slot; somente o botão abre os filtros. */
.card .contem_banner.banner-end { flex-direction:column; gap:8px; text-align:center; }
.card .banner-end .banner-img { flex:1 1 0; min-height:0; }
.card .banner-end h2 { flex:none; margin:0; color:var(--text); font-size:20px; line-height:1.2; }
.card .banner-search-button {
  flex:none; position:relative; z-index:1; min-width:44px; min-height:44px;
  max-width:100%; margin:0; padding:8px 14px; border:1px solid #155f7d; border-radius:8px;
  background:#fff; color:#155f7d; box-shadow:none; font:inherit; cursor:pointer; touch-action:manipulation;
}
.card .banner-search-button:hover { background:#155f7d12; }
.card .banner-search-button:focus-visible { outline:3px solid #155f7d; outline-offset:2px; }

/* A gaveta/aviso preserva a posição do feed e interrompe sua rolagem nativa. */
body.feed-interaction-locked #feedViewport { overflow:hidden!important; touch-action:none; }

article.card.eh_banner > .flip {
  display: none !important;
} /* Segurança */

/* === Estilos Padrão do Card de Conteúdo === */
.card .topline {
  display: grid;
  grid-template-columns: auto;
  align-items: start;
  gap: 10px;
  margin-bottom: 2px;
}

/* Logo/Avatar */
img.logo.hero-avatar {
  position: absolute;
  inset: clamp(2px, 2vw, 4px) auto auto clamp(2px, 2vw, 4px);
  /* Acréscimo de 10% sobre o tamanho anterior; inset superior/esquerdo preservado. */
  width: clamp(79.2px, 19.8%, 132px);
  aspect-ratio: 1;
  height: auto;

  border-radius: 50%;
  border: clamp(0.15rem, 1.5vw, 0.2rem) solid var(--border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);

  min-width: 60px;
  min-height: 60px;

  object-fit: contain;
  padding: clamp(2px, 0.8vw, 6px);
  /* Apenas o fundo branco: 25% transparente; para reverter: background: #fff. */
  background: rgba(255, 255, 255, 0.75);

  z-index: 3;
}

.card .head-text {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
  overflow: hidden;
}

/* Sigla / Título / Meta: espaçamentos controlados por variáveis (consolidado) */
.card .topline .head-text .sigla {
  margin-top: var(--sigla-mt, 0px);
  margin-bottom: var(--sigla-mb, 4px);
}

.card .topline .head-text .title-wrap {
  margin-top: var(--title-mt, 2px);
}

.card .meta.hero-header {
  margin-top: var(--meta-mt, 4px);
  padding-bottom: var(--meta-extra, 0px);
}

/* === Título === */
.card .title-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  padding-inline: var(--title-pad-x);
  overflow: hidden;
  width: 100%;

  font-size: var(--title-fs);
  line-height: 1.15;

  --title-line-h: 1.15;
  --title-rows: 1;

  /* 2 linhas * 1.15 + folguinha */
  max-height: calc(2.4em);
}

.card .title-scroll {
  font-weight: 800;
  margin: 0;
  width: 100%;

  hyphens: auto;
  -webkit-hyphens: auto;

  overflow-wrap: normal;
  word-wrap: normal;
}

.card .title-scroll.brand_vic {
  font-size: var(--title-fs);
}

/* Títulos Normais (<= 2 linhas) – apenas fora dos .eh_curso */
.card:not(.eh_curso).title-normal .title-scroll,
.card:not(.eh_curso):not(.title-long) .title-scroll {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Títulos Longos (1 linha, ellipsis) – apenas fora dos .eh_curso */
.card:not(.eh_curso).title-long .title-scroll {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === Hero === */
.card .hero {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: var(--hero-aspect);

  border-radius: 12px;
  border: 1px solid var(--border);

  object-fit: cover;
  background: var(--bg);
  margin: 0;

  min-height: calc(100% / var(--hero-aspect));
}

.card .face.front .hero,
.card .face.front .topline {
  flex: 0 0 auto;
}

/* === Meta (Chips + ações) === */
.face.front .meta {
  display: flex;
  flex-direction: column;
  padding-top: 2px;

  margin-top: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

.card.eh_curso .meta.hero-header {
  margin-bottom: 28px; /* faixa reservada pro botão */
  position: relative;
}

/* Fluxo dos Chips (meta-flow) */
.face.front .meta-flow,
.card.eh_curso .meta-flow.hero-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gap1) var(--gap2);

  flex: 1 1 auto;
  padding-right: 52px; /* reserva pro botão fixo */
}

/* Reserva de altura por linhas (quando JS mandar) */
.card .meta.hero-header .meta-flow.hero-info {
  min-height: calc(var(--meta-rows, 0) * var(--chip-h-px, 20px));
}

/* Chip (padrão) */
.card .meta .chip {
  display: inline-flex;
  align-items: center;

  background: linear-gradient(180deg, rgba(255,255,255,.23), rgba(255,255,255,.07) 52%, rgba(26,39,90,.08));
  border: .5px solid rgba(255,255,255,.12);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), inset 0 -1px 0 rgba(27,38,86,.08), 0 1px 2px rgba(24,34,77,.16);

  font-size: var(--chip-fs, 14px);
  color: var(--white);

  height: var(--chip-h-px);
  line-height: 1;
  padding: 0 8px;
  box-sizing: border-box;

  white-space: nowrap;
  flex: 0 0 auto;
}

/* Modo Compacto (front-tight-actions) */
.card.eh_curso.front-tight-actions .face.front {
  overflow: hidden;
}
.card.eh_curso.front-tight-actions .face.front .meta-flow {
  row-gap: 2px;
}

/* Modo chips: ajustes por classe */
.card.eh_curso .meta-flow.hero-info.chips-one-line {
  flex-wrap: nowrap;
}
.card.eh_curso .meta-flow.hero-info.chips-two-lines {
  flex-wrap: wrap;
}
.card.eh_curso .meta-flow.hero-info.chips-one-line-force {
  flex-wrap: nowrap;
  white-space: nowrap;
}
.card.eh_curso.front-tight-actions .meta-flow.hero-info.chips-one-line-force {
  row-gap: 0;
}

/* === Links e utilitários === */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0.75rem clamp(1.5rem, 4vw, 3rem);
  border-radius: 999px;

  border: 2px solid var(--white);
  color: var(--white);
  text-decoration: none;

  font-size: clamp(1rem, 2.4vw, 1.5rem);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.link {
  color: var(--link);
  text-decoration: underline;
  word-break: break-word;
}

.hidden {
  display: none !important;
}
.error {
  outline: 2px solid var(--error);
  outline-offset: 1px;
}

/* === Estilos Victoria (Consolidados) === */
.card * {
  box-sizing: border-box;
} /* redundância mantida por segurança no contexto .card */

.hero-visual {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  isolation: isolate;
}

.hero-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;

  /* no seu original era "gap: 0.1" (inválido). Mantemos sem forçar gap. */
  margin-top: clamp(0.5rem, 2vw, 1rem);
}

.brand_vic {
  margin: 0;
  font-family: "Jeju Gothic", "Josefin Sans", sans-serif;
  letter-spacing: 0.03em;
}

.hero-body {
  display: flex;
  flex-direction: row;
  gap: clamp(1.5rem, 4vw, 3rem);
}
.hero-info {
  display: flex;
  flex-direction: row;
  max-width: 32rem;
}
.hero-subtitle {
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}
.hero-address {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 400;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.75rem, 2vw, 1.5rem);
}

.btn_vic {
  border-radius: 999px;
  text-align: center;
  font-family: "Jeju Gothic", "Josefin Sans", sans-serif;
  font-size: clamp(0.8rem, 2vw, 1rem);
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn_vic:hover,
.btn_vic:focus {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.btn-outline {
  color: var(--white);
  border: 3px solid var(--white);
  background: transparent;
}
.btn-outline:hover,
.btn-outline:focus {
  background: rgba(255, 255, 255, 0.15);
}

.btn-solid {
  background: var(--white);
  color: var(--primary);
  border: 3px solid var(--white);
}
.btn-solid:hover,
.btn-solid:focus {
  background: #f4f4ff;
}

/* =======================================================================
   === FLIP (Frente/Verso) — Consolidado e "hardened" para Safari iOS ===
   Objetivos:
   - evitar "bleed-through" (front aparecendo no back)
   - garantir clique no back (z-index + pointer-events + camadas)
   - manter animação 3D (sem fallback que desliga transform)
   ======================================================================= */

/* Container de perspectiva */
.flip {
  position: relative;
  perspective: 1200px;
  -webkit-perspective: 1200px;

  height: calc(100% - 16px);
  padding: 0;
  box-sizing: border-box;

  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Inner que gira */
.flip-inner {
  position: relative;
  width: 100%;
  height: calc(100% - 16px);
  box-sizing: border-box;

  display: block;

  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;

  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;

  transform: rotateY(0deg) translateZ(0);
  -webkit-transform: rotateY(0deg) translateZ(0);
}

/* estado virado */
.flip-inner.flipped {
  transform: rotateY(180deg) translateZ(0);
  -webkit-transform: rotateY(180deg) translateZ(0);
}

/* Faces: agora ABSOLUTAS (mais estável no iOS do que front "relative") */
.face {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;
  min-height: 100%;

  display: flex;
  flex-direction: column;

  overflow: hidden;
  border-radius: 0px;

  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;

  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;

  /* força camada composta */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);

  /* por segurança: só uma face recebe eventos por vez */
  pointer-events: none;
}

/* Frente */
.face.front {
  position: absolute;
  inset: 0;

  background-color: var(--face-front-primary);
  padding-bottom: 0;

  /* micro Z p/ evitar z-fighting e flicker */
  transform: rotateY(0deg) translateZ(0.1px);
  -webkit-transform: rotateY(0deg) translateZ(0.1px);

  z-index: 2;
}

/* Verso */
.face.back {
  position: absolute;
  inset: 0;

  background: var(--card);
  padding: 4px 5px;

  gap: 0;
  border-radius: 12px;
  align-items: stretch;

  /* micro Z p/ evitar z-fighting e flicker */
  transform: rotateY(180deg) translateZ(0.1px);
  -webkit-transform: rotateY(180deg) translateZ(0.1px);

  z-index: 1;
}

/* Habilita clique apenas na face visível */
.flip-inner:not(.flipped) > .face.front {
  pointer-events: auto;
}
.flip-inner.flipped > .face.back {
  pointer-events: auto;
}

/* Quando flipped: garante back acima (alguns Safari precisam disso) */
.flip-inner.flipped > .face.back {
  z-index: 3;
}
.flip-inner.flipped > .face.front {
  z-index: 1;
}

/* Esconde barra de ações da frente quando virado */
.flip-inner.flipped .actions-inline {
  visibility: hidden;
  pointer-events: none;
}

/* Backface-visibility extra (mantido) */
.card.eh_curso .face.front,
.card.eh_curso .face.back,
.card.eh_curso .face.front *,
.card.eh_curso .face.back * {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* --- iOS Safari hardening (reaproveita sua classe, mas NÃO desliga o flip) --- */
html.ios-flip-bugfix .card.eh_curso .flip {
  -webkit-perspective: 1200px;
  perspective: 1200px;
}

html.ios-flip-bugfix .card.eh_curso .flip-inner {
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;

  /* força camada no iOS */
  -webkit-transform: translateZ(0) rotateY(0deg);
  transform: translateZ(0) rotateY(0deg);
}

html.ios-flip-bugfix .card.eh_curso .flip-inner.flipped {
  -webkit-transform: translateZ(0) rotateY(180deg);
  transform: translateZ(0) rotateY(180deg);
}

/* Truque extra:
   no iOS, após completar o flip, escondemos a face.front de verdade
   (resolve o “front vazando” e também o clique do back em Safaris teimosos),
   mas com DELAY igual à duração do flip, pra não matar a animação. */
html.ios-flip-bugfix .card.eh_curso .face.front {
  transition: opacity 0s linear 0s, visibility 0s linear 0s;
  opacity: 1;
  visibility: visible;
}

html.ios-flip-bugfix .card.eh_curso .flip-inner.flipped > .face.front {
  pointer-events: none;

  /* some de verdade após o flip terminar */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0s linear 0.6s, visibility 0s linear 0.6s;
}

/* No retorno (unflip), volta imediatamente */
html.ios-flip-bugfix .card.eh_curso .flip-inner:not(.flipped) > .face.front {
  opacity: 1;
  visibility: visible;
  transition: opacity 0s linear 0s, visibility 0s linear 0s;
}

/* =======================================================================
   === AÇÕES / BOTÕES ===
   ======================================================================= */

select,
button,
input {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 4px 7px;
  font-size: 14px;
}

button.primary,
button.ghost {
  background: linear-gradient(180deg, var(--button-primary-top), var(--button-primary-bottom));
  color: var(--button-text-light);
  border: none;
  font-weight: 700;
}

/* ações base (usadas no verso e drawer) */
.actions {
  display: flex;
  flex-direction: column;
  gap: 2px;

  margin-top: auto;
  margin-bottom: 0;

  padding: 2px 0 8px;
  width: 100%;
}

.face > .actions {
  margin-top: auto;
  flex-shrink: 0;
  padding-top: 6px;
  padding-bottom: var(--actions-bottom-gap);
  display: none; /* desabilitado na frente, usado no verso */
}

.actions .push {
  margin-left: auto;
}

/* Linhas dentro das ações */
.linha_em_actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  flex-wrap: nowrap;
  width: 100%;

  overflow: auto hidden;
  -webkit-overflow-scrolling: touch;
}

.linha_em_actions > * {
  flex: 0 0 auto;
  white-space: nowrap;
}

.actions a,
.actions button {
  padding: 2px 6px;
  line-height: 1.2;
}

/* Botões de Flip/Share/Guardar */
.btnFlip,
.btnUnflip,
.btnGuardar,
.btnShare {
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.1;
  border-radius: 10px;
  margin: 0;

  box-sizing: border-box;
  height: auto;

  white-space: nowrap;
  flex-shrink: 0;
  min-width: 0;
  max-width: 100%;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 24px;
  min-width: max-content;

  overflow: visible;
  text-overflow: clip;

  /* melhora tap/click no mobile */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}


/* Destaque reversível somente do botão "mais" na frente do curso. */
button.primary.btnFlip {
  color: #0b1d3a;
  background: linear-gradient(180deg, #b7d9fa 0%, #78afea 38%, #3977c8 100%);
  border: 1px solid #244e88;
  padding: 3px 9px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 1px 0 #d7eaff, inset 0 -1px 0 #2d64aa, 0 2px 0 #203d70, 0 3px 5px rgba(17, 32, 72, 0.4);
  transform: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

button.primary.btnFlip:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

button.primary.btnFlip:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 2px rgba(23, 43, 90, 0.2), 0 1px 0 #344b80;
}

.btnShare,
.btnGuardar {
  gap: 6px;
  background: none !important;
}

.btnShare svg {
  width: 24px;
  height: 24px;
  display: block;
  flex: 0 0 24px;
}

/* Botão de Flip Fixo no canto inferior direito (Front) */
.card.eh_curso .face.front .actions-inline {
  position: absolute;
  right: 3px;
  bottom: 3px;

  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;

  z-index: 5;

  width: auto;
  max-width: 60%;

  margin: 0 !important;

  flex-basis: auto !important;
  flex-shrink: 0 !important;
}

/* Desabilitado */
.btnGuardar:disabled,
.btnGuardar[aria-disabled="true"] {
  opacity: 1 !important;
  cursor: default;
  pointer-events: none;
}

/* =======================================================================
   === VERSO (BACK) — Layout + páginas + detalhes + ações ===
   ======================================================================= */

/* Topo do verso */
.face.back .top2 {
  flex: 0 0 15%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  min-height: 0;
}

.logo_back {
  height: 100%;
  width: auto;
  max-width: 40%;
  border-radius: 8px;
  object-fit: contain;
  background: var(--bg);
  border: 1px solid var(--border);
}

.inst_back {
  flex: 1 1 auto;
  font-weight: 700;
  font-size: var(--back-inst-fs);
  color: var(--text);
  line-height: 1.25;
  min-width: 0;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Caption/Value */
.face.back .caption {
  font-size: var(--back-caption-fs);
  color: var(--cor_caption_filtro);
  margin: 0;
  white-space: nowrap;
  font-weight: 500;
  opacity: 0.8;
}
.face.back .caption::after {
  content: ":";
  margin-right: 2px;
}

.face.back .value {
  font-size: var(--back-value-fs);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

/* Navegação do Verso (Pages) */
.back-pages {
  position: relative;
  overflow: hidden;
}

.back-page {
  display: none;
  flex-direction: column;
  row-gap: max(4px, var(--back-gap-v, 4px));
  padding-bottom: 4px;
}
.back-page.is-active {
  display: flex;
}
.back-page.back-page--spread {
  justify-content: space-between;
}

.back-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;

  font-size: 12px;
  margin-bottom: 4px;
}

.back-nav-inner {
  display: inline-flex;
  align-items: center;
  gap: 4px;

  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
}

.back-nav button {
  border: none;
  background: transparent;
  padding: 2px 4px;
  cursor: pointer;

  font-size: 16px;
  line-height: 1;

  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.back-nav button:disabled {
  opacity: 0.4;
  cursor: default;
}

.back-nav .nav-indicator {
  font-size: 11px;
  opacity: 0.9;
  min-width: 36px;
  text-align: center;
}

/* NOVO – bloco do título completo no verso */
.face.back .back-title {
  flex: 0 0 15%;
  padding: 4px 0;
  display: flex;
  align-items: center;
  min-height: 0;
}

.face.back .back-title .v_titulo {
  font-size: var(--back-title-fs);
  font-weight: 600;
  line-height: 1.18;
  color: var(--text);

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  text-overflow: ellipsis;

  white-space: normal;
}

/* === Área de chips no verso (carrossel por colunas) === */
.face.back .back-details {
  flex: 0 0 50%;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;

  border: 1px solid gray;
  border-radius: 5px;
  padding: 4px 0;
  min-height: 0;

  overflow-x: auto;
  overflow-y: hidden;

  scroll-snap-type: x mandatory;
  scroll-padding-inline: 10px;

  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.14), 0 3px 8px rgba(0, 0, 0, 0.1);
  -webkit-overflow-scrolling: touch;

  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
}

/* Coluna (se você usa colunas) */
.face.back .back-column {
  display: flex;
  flex-direction: column;
  gap: var(--back-gap-v, 6px);

  flex: 0 0 auto;
  scroll-snap-align: start;
}

/* Wrap (Chip) – verso do card */
.face.back .wrap_caption {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;

  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-alt);

  white-space: nowrap;

  flex: 0 0 auto;
  max-width: 100%;

  scroll-snap-align: start;
}

/* Fallback: se wrap_caption estiver direto em back-details */
.face.back .back-details > .wrap_caption {
  scroll-snap-align: start;
}

/* Ações do verso (novo layout ~16%) */
.face.back .actions {
  flex: 0 0 16%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;

  padding-top: 4px;
  padding-bottom: 4px;

  margin-top: 0 !important; /* neutraliza margin-top:auto antigo */
}

/* linhas internas do verso */
.face.back .linha_em_actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
}

.face.back .linha_em_actions.links_back,
.face.back .linha_em_actions.buttons_back {
  flex: 0 0 auto;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
}

/* links no verso */
.face.back .linha_em_actions.links_back .link {
  font-size: var(--back-btn-fs, 12px);
}

/* botões no verso */
.face.back .linha_em_actions.buttons_back button {
  font-size: var(--back-btn-fs, 12px);
}

/* Linha de links no verso: CBO + URL em 1/2 e 1/2 (como no seu original) */
.face.back .linha_em_actions.links_back {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 100%;
  column-gap: 0;
}

.face.back .linha_em_actions.links_back .btnCBO {
  grid-column: 1;
  justify-self: center;
}

.face.back .linha_em_actions.links_back .btnUrl {
  grid-column: 2;
  justify-self: center;
}

/* =======================================================================
   === Drawer (Filtros) ===
   ======================================================================= */

.drawer {
  background: var(--card-alt);
  position: fixed;
  top: 0;
  right: 0;

  height: 100vh;
  width: min(92vw, 420px);

  border-left: 1px solid var(--border);

  transform: translateX(100%);
  opacity: 0;

  transition: transform 0.4s ease-in-out, opacity 0.35s ease-in-out;
  z-index: 1000;

  will-change: transform, opacity;

  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.drawer.open {
  transform: translateX(0);
  opacity: 1;
  background: linear-gradient(0deg, var(--card) 0%, var(--card-alt-escuro) 100%);
}

.drawer header {
  position: sticky;
  top: 0;
  background: var(--card-alt) !important;
  color: black;

  padding: 2px;
  border-bottom: 1px solid var(--border);

  flex: 0 0 auto;
}

.drawer .content {
  padding: 2px;
  display: flex;
  flex-direction: column;
  gap: 6px;

  flex: 1;
  min-height: 0;
  overflow: auto;
}

.drawer .row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
}

.drawer .row.panel-row {
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 30px;
}

#drawerGpsBtn {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #5885ad;
  border-radius: 8px;
  background: #e6f1fb;
  color: #163d61;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
#drawerGpsBtn:disabled { opacity: .7; cursor: progress; }
#drawerGpsBtn[hidden] { display: none; }
#drawerGpsBtn:focus-visible { outline: 2px solid #163d61; outline-offset: 2px; }
#drawerGpsStatus {
  margin: 0;
  font-size: .85rem;
  line-height: 1.4;
  color: #163d61;
}

.dropdown-list {
  display: none;
  position: absolute;
  background: var(--card-alt);
  border: 1px solid #9a9a9a;
  border-radius: 10px;
  margin-top: 4px;
  width: calc(100% - 4px);
  z-index: 100;

  list-style: none;
  padding: 4px 0;

  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;

  max-height: 50vh;
  overflow-y: auto;

  touch-action: pan-y;
}

.dropdown-list li {
  padding: 6px 10px;
  cursor: pointer;
}
.dropdown-list li:hover {
  background: var(--card-alt);
}

.check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0px;
}

/* Painel interno do Drawer */
.drawer-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;

  width: 100%;
  padding: 10px 12px;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.drawer .content .row .caption {
  font-size: 0.7rem;
}

.drawer-hidden-theme,
.drawer .contem-city-state.drawer-hidden-row {
  display: none !important;
}

.contem-city-state.drawer-hidden-row {
  display: none;
}

.theme-empty-row {
  font-size: 0.78rem;
  color: #c62828;
  margin-top: 4px;
}

/* =======================================================================
   === FAB ===
   ======================================================================= */

.fab {
  position: fixed;
  right: env(safe-area-inset-right, 12px);
  bottom: env(safe-area-inset-bottom, 12px);
  top: auto;
  left: auto;
  z-index: 2147483647;

  width: var(--fab-d);
  height: var(--fab-d);
  border-radius: 9999px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font: 900 18px/1 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  background: linear-gradient(180deg, var(--fab-primary-top), var(--fab-primary-bottom));
  color: var(--button-text-light);
  border: 0;
  cursor: pointer;

  box-shadow: 0 10px 30px var(--fab-shadow);
}

/* =======================================================================
   === Mini-card (drawer) ajustes ===
   ======================================================================= */

.saved-card {
  --mini-h: 200px;
}

.saved-card .saved-head {
  display: grid;
  grid-template-rows: auto auto;
  gap: 6px;
}

.saved-card .brand {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-height: 0;
}

/* Logo mini-card (consolidado) */
.saved-card .brand .logo_mini_card,
.saved-card .logo_mini_card {
  display: block;

  width: var(--logo-mini-w, 20%);
  height: calc(var(--mini-h) * 0.35);

  object-fit: contain;

  background: #fff;
  border: 0;
  outline: 0;
  box-shadow: none;
  filter: none;

  border-radius: 6px;
  padding: 4px;
}

/* Coluna com SIGLA e CIDADE */
.saved-card .brand .brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  flex: 1 1 auto;
  min-width: 0;
}

.saved-card .sigla,
.saved-card .cidade {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  padding: 1px 1px;
  margin: 0;

  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.65);

  color: rgba(255, 255, 255, 0.94);
  line-height: 1.15;

  font-size: 0.7em;
}

.saved-card .sigla {
  line-height: 1;
}
.saved-card .cidade {
  opacity: 0.85;
  line-height: 0.9;
  text-transform: none;
}

.saved-card .title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Thumb */
.saved-card .saved-thumb {
  position: relative;
  overflow: hidden;
  border-radius: 8px;

  padding: 0 !important;
  background: transparent !important;

  min-height: 0;
  line-height: 0;

  aspect-ratio: 16 / 9;
}

.saved-card .saved-thumb img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.saved-card .saved-thumb > img {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  object-fit: cover;
  background: #0000;
}

/* Botões sobrepostos */
.saved-card .saved-thumb .overlay-btn {
  position: absolute;
  z-index: 3;
  bottom: 8px;

  width: 32px;
  height: 32px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;

  padding: 0;
  cursor: pointer;

  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.saved-card .saved-thumb .saved-del.overlay-btn.left {
  left: 8px !important;
  top: auto !important;
  right: auto !important;
}

/* A lixeira mantém o círculo de 32 px, com alvo retangular de 44 px.
   Cantos e bordas também excluem; não deixam o toque abrir o minicard. */
#drawerPanel .saved-card .saved-thumb .saved-del.overlay-btn.left {
  width: 44px;
  height: 44px;
  left: 2px !important;
  bottom: 2px;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: none;
}

#drawerPanel .saved-del::before {
  content: "";
  position: absolute;
  inset: 6px;
  z-index: -1;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.saved-card .saved-thumb .saved-view.overlay-btn.right {
  right: 8px !important;
  top: auto !important;
  left: auto !important;
}

.saved-card .saved-thumb .saved-view.overlay-btn.right svg {
  stroke: #ffd54a;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.6));
}

/* =======================================================================
   === Media Queries ===
   ======================================================================= */

@media (max-width: 640px) {
  .hero-visual {
    border-radius: clamp(2.5rem, 8vw, 3.5rem);
  }
  .hero-header {
    align-items: flex-start;
  }
  .hero-info {
    max-width: 100%;
  }
  .hero-actions {
    flex-direction: row;
  }
  .btn_vic {
    width: 100%;
    min-width: 0;
  }
  .hero-avatar {
    inset: clamp(2px, 2vw, 4px) auto auto clamp(2px, 2vw, 4px);
    width: clamp(5.25rem, 30vw, 7.5rem);
    border-width: clamp(0.3rem, 1.2vw, 0.45rem);
    aspect-ratio: 1;
    height: auto;
  }
}

@media (max-width: 900px) {
  .hero-avatar {
    inset: clamp(2px, 2vw, 4px) auto auto clamp(2px, 2vw, 4px);
    width: clamp(60px, 15%, 80px);
    aspect-ratio: 1;
    height: auto;
  }
}

/* Snap Scroll APENAS em Mobile (ou touch) e com 'snap-ready' */
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
  :root.snap-ready:not(.has-smooth-scrollbar) #feedViewport {
    scroll-snap-type: y mandatory;
    scroll-padding-top: 1px;
    overscroll-behavior-y: contain;
  }

  :root.snap-ready:not(.has-smooth-scrollbar) #feedViewport article.card {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
}

/* =======================================================================
   === Chips: fallback extremo / clamps / hidden markers ===
   ======================================================================= */

.chip.chip--clamped {
  white-space: normal !important;
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  word-break: break-word;
}

/* chips muito apertados: diminui gap vertical */
.contem_chips_front.chips--clamped {
  row-gap: 2px;
}

.chip--hidden-by-btn,
.chip--fora-do-container {
  visibility: hidden;
  pointer-events: none;
}

/* =======================================================================
   === Overlays / Modais ===
   ======================================================================= */

/* Overlay de confirmação: remover dos favoritos */
.fav-confirm-overlay {
  position: fixed;
  inset: 0;

  display: none;
  align-items: center;
  justify-content: center;

  z-index: 9999;
}

.fav-confirm-overlay.is-open {
  display: flex;
}

.fav-confirm-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);

  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);

  z-index: 0;
  pointer-events: none;
}

.fav-confirm-dialog {
  position: relative;
  z-index: 1;

  width: min(92vw, 360px);
  max-width: 360px;

  pointer-events: auto;
}

.fav-confirm-dialog.saved-card {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
}

.fav-confirm-text {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;

  transform: translateY(-50%);
  padding: 8px 12px;

  text-align: center;
  font-weight: 800;
  font-size: 13px;

  text-transform: uppercase;
  letter-spacing: 0.06em;

  color: #ffe9b8;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.8), 0 2px 4px rgba(0, 0, 0, 0.85);
}

.fav-confirm-actions {
  position: relative;
  z-index: 2; /* Acima do cabeçalho sobreposto do minicard. */
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.fav-confirm-actions button {
  min-height: 44px;
  border-radius: 999px;
  padding: 6px 14px;

  font-size: 13px;
  font-weight: 600;

  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.55);
  color: #f5f7fa;

  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.fav-confirm-actions button.fav-confirm-main {
  background: #ff6b5e;
  border-color: rgba(0, 0, 0, 0.4);
  color: #1b0503;
}

.fav-confirm-actions button:active {
  transform: scale(0.97);
}

/* Backdrop do modal de saída do app */
#url-overlay-backdrop {
  position: fixed;
  inset: 0;

  background: rgba(0, 0, 0, 0.55);
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;
}

/* Caixa do modal */
#url-overlay-modal {
  max-width: 420px;
  width: 90vw;

  background: var(--card-bg, #ffffff);
  border-radius: 16px;

  padding: 1.5rem;

  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  font-size: 0.95rem;
}

#url-overlay-modal .url-head {
  margin-bottom: 0.75rem;
}

#url-overlay-modal h2 {
  margin: 0;
  font-size: 1.1rem;
}

#url-overlay-modal .url-body p {
  margin: 0.3rem 0;
}

#url-overlay-modal .url-host {
  font-weight: 600;
  word-break: break-all;
}

#url-overlay-modal .url-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

/* =======================================================================
   === Orientation lock overlay ===
   ======================================================================= */

#orientationLockOverlay {
  position: fixed;
  inset: 0;

  background: rgba(0, 0, 0, 0.9);
  color: #fff;

  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;

  z-index: 999999;
  padding: 16px;
}

#orientationLockOverlay .orientation-inner {
  max-width: 320px;
  margin: 0 auto;

  font-size: 16px;
  line-height: 1.4;
}

@media (orientation: landscape) and (max-width: 900px) {
  #orientationLockOverlay {
    display: flex;
  }
}

/* =======================================================================
   === Modo curso (pills) ===
   ======================================================================= */

.check--modo-curso {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.check--modo-curso .modo-pill {
  border-radius: 999px;
  padding: 4px 10px;

  font-size: 13px;
  border: 1px solid rgba(0, 0, 0, 0.22);

  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;

  line-height: 1.3;
  white-space: nowrap;

  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;

  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.check--modo-curso .modo-pill.is-active {
  background: var(--accent, #1565c0);
  color: #fff;
  border-color: var(--accent, #1565c0);
}

.check--modo-curso .modo-pill:not(.is-active):hover {
  background: rgba(0, 0, 0, 0.06);
}

/* =======================================================================
   === City/State drawer (gaveta) ===
   ======================================================================= */

#city-state {
  width: 100%;
  padding: 0;
  display: flex;
  gap: 3px;
  flex-wrap: nowrap;
  align-items: flex-start;

  max-height: 80px;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

#city-state .field {
  display: flex;
  flex-direction: column;
}

#city-state .field-state {
  flex: 0 0 auto;
  min-width: 3.5ch;
  max-width: 6ch;
}

#city-state .field-city {
  flex: 1 1 auto;
}

#city-state input[type="text"],
#city-state .dropdown-list {
  width: 100%;
  box-sizing: border-box;
}

#city-state .field-state input {
  text-align: center;
}

#city-state.drawer-collapsed {
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);

  overflow: hidden;
  pointer-events: none;
}

/* =======================================================================
   === Frente do card de curso: estrutura nova (título/chips/hero) ===
   ======================================================================= */

.card.eh_curso .face.front {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* blocos abaixo do hero */
.card.eh_curso .face.front .contem_titulo,
.card.eh_curso .face.front .contem_chips_front {
  width: 100%;
  box-sizing: border-box;
}

/* Bloco de título: altura pelo JS via --title-block-h */
.card.eh_curso .face.front .contem_titulo {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  box-sizing: border-box;
  height: var(--title-block-h, 64px);
}

/* No curso, o bloco manda na altura */
.card.eh_curso .face.front .contem_titulo .title-wrap {
  max-height: 100%;
}

/* Frente nova: exatamente 4 linhas de título */
.card.eh_curso .face.front .contem_titulo .title-scroll {
  font-size: var(--title-fs);
  line-height: var(--title-line-h, 1.15);

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;

  white-space: normal !important;
  overflow: hidden;
  text-overflow: ellipsis;

  max-height: var(--title-block-h);
}

/* Bloco de chips: altura pelo JS via --chips-block-h */
.card.eh_curso .face.front .contem_chips_front {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;

  gap: var(--gap1, 4px) var(--gap2, 6px);
  font-size: var(--chip-fs, 13px);
  line-height: 1.1;

  padding: 4px 8px;
  box-sizing: border-box;

  height: var(--chips-block-h, 54px);
  overflow: hidden;
}

/* Chip de curso na frente do card (não força height fixa) */
.card.eh_curso .face.front .contem_chips_front .chip {
  display: inline-flex;
  align-items: center;

  background: linear-gradient(180deg, rgba(255,255,255,.23), rgba(255,255,255,.07) 52%, rgba(26,39,90,.08));
  border: .5px solid rgba(255,255,255,.12);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), inset 0 -1px 0 rgba(27,38,86,.08), 0 1px 2px rgba(24,34,77,.16);

  font-size: var(--chip-fs, 13px);
  color: var(--white);

  height: auto;
  min-height: calc(var(--chip-fs, 13px) * 1.25);
  line-height: 1.1;

  padding: 0 8px;
  box-sizing: border-box;

  white-space: nowrap;
  flex: 0 0 auto;
}

/* Hero shell + geo badge */
.card.eh_curso .face.front .hero-shell {
  position: relative;
  flex: 0 0 auto;
}

.geo-badge {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  object-fit: cover;
  pointer-events: none;

  z-index: 2;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.55));
}

.geo-badge.hidden {
  display: none;
}

.card.eh_curso .face.front .hero-shell .hero.hero-cover {
  display: block;
  width: 100%;
  height: auto;
}

/* Selo de sigla sobre o hero */
.card.eh_curso .face.front .hero-shell .contem_sigla {
  position: absolute;
  right: 0;
  bottom: 0;

  z-index: 3;

  padding: 4px 10px;

  border-radius: 999px;
  border: 1px solid var(--border);
  background: white;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: auto;
  max-width: 70%;
  box-sizing: border-box;

  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.card.eh_curso .face.front .hero-shell .contem_sigla .sigla {
  font-weight: 800;
  font-size: var(--sigla-fs, 12px);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgb(31, 41, 55);
}

/* Quando flipped, some com elementos “front-only” */
.card.eh_curso .flip-inner.flipped .face.front .contem_sigla,
.card.eh_curso .flip-inner.flipped .face.front .hero-avatar,
.card.eh_curso .flip-inner.flipped .face.front .actions-inline {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* =======================================================================
   === SVG sombra ===
   ======================================================================= */

.svg_sombra {
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.14)) drop-shadow(0 3px 8px rgba(0, 0, 0, 0.1));
  -webkit-filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.14))
    drop-shadow(0 3px 8px rgba(0, 0, 0, 0.1));
}

/* =======================================================================
   === Snap off / overflow-anchor ===
   ======================================================================= */

html.snap-off #feedViewport {
  scroll-snap-type: none !important;
}

#feedViewport,
#pool,
#pool > article,
.card,
#spacer,
#pool > article.card {
  overflow-anchor: none;
}

.card {
  scroll-snap-stop: always;
}



/* Confirmação da cidade sugerida; modal nativo mantém foco e teclado acessíveis. */
#cityUpdateDialog {
  box-sizing: border-box;
  width: min(90vw, 420px);
  max-height: 85dvh;
  padding: 22px;
  border: 1px solid #9bb6cc;
  border-radius: 18px;
  background: #f6faff;
  color: #19374e;
  box-shadow: 0 14px 45px #001b3c66;
  font: inherit;
}
#cityUpdateDialog::backdrop { background: #071a2b80; }
#cityUpdateDialog h2 { margin: 0 0 12px; font-size: 1.15rem; }
#cityUpdateDialog p { line-height: 1.5; }
.city-update-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.city-update-actions button {
  flex: 1 1 140px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid #52799b;
  border-radius: 10px;
  background: #fff;
  color: #19374e;
  font: inherit;
}
.city-update-actions [data-city-change] { background: #17598a; color: #fff; }
.btnFlip[aria-busy="true"] { cursor: progress; filter: brightness(.85); }

/* Um único snap vertical, ao fim da inércia. O snap horizontal do verso permanece. */
:root.feed-inertia #feedViewport {
  scroll-snap-type: none !important;
  scroll-behavior: auto;
}
:root.feed-inertia #feedViewport > #pool > article.card {
  scroll-snap-stop: normal;
}

#favoriteFeedContext { padding: 8px 0; }
#favoriteFeedContext[hidden] { display: none; }
#favoriteFeedDescription { margin: 0 0 8px; font-size: 0.85rem; line-height: 1.4; }
#returnGeneralFeed { font-size: 0.85rem; }
#institutionStatus { display: block; font-size: 0.8rem; }
#institutionStatus:empty { display: none; }
#institutionOptions li {
  white-space: normal;
  overflow-wrap: anywhere;
  padding: 4px 8px;
  font-size: 0.9rem;
  line-height: 1.25;
}
#institutionOptions .institution-abbreviation { font-size: 0.9rem; font-weight: 700; }
#institutionOptions .institution-full-name { font-size: 0.75rem; }

/* Território explícito; controles com área de toque e resultados sem ambiguidade. */
body.scope-ui { --app-header-h:44px; }
.scope-ui .app-header__inner { gap:5px; padding-right:4px; }
.scope-ui .app-logo { max-width:78px; height:36px!important; }
.scope-ui #headerSummary { background:none; border:0; font-size:clamp(15px,4.3vw,19px)!important; font-weight:600; padding:0 4px; height:44px; min-width:0; text-align:center; white-space:normal; line-height:1.1; overflow:hidden; color:inherit; }
#headerLocation { flex:0 0 44px; width:44px; height:44px; padding:10px; background:transparent; border:0; border-radius:50%; color:#174f6a; }
#headerLocation svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.8; }
#headerLocation.locating svg { animation:scope-pulse .9s ease-in-out infinite alternate; }
@keyframes scope-pulse { to { opacity:.3; transform:scale(.85); } }
.scope-ui .drawer { width:min(94vw,390px); right:-410px; background:#f7f9fc; color:#172e43; padding:0; }
.scope-ui .drawer.open { right:0; }
.scope-ui .drawer .content { padding:12px; gap:10px; color:inherit; }
.scope-title { display:flex; align-items:center; justify-content:space-between; font-size:18px; font-weight:650; }
.scope-title button { min-height:40px; min-width:40px; border:0; background:transparent; font-size:26px; color:inherit; }
.scope-scroll { overflow:auto; flex:1; min-height:0; padding:0 3px 12px; overscroll-behavior:contain; }
.scope-field { margin:12px 0; }
.scope-field label { display:block; font-size:13px; font-weight:650; margin-bottom:5px; }
.scope-field input,.scope-field select { width:100%; min-height:44px; border:1px solid #b9c9d6; border-radius:9px; background:#fff; color:#17334a; padding:9px 11px; font-size:15px; }
.scope-input { display:flex; position:relative; align-items:center; }
.scope-input input { padding-right:40px; text-overflow:ellipsis; }
.scope-input button { position:absolute; right:0; height:44px; width:38px; border:0; background:transparent; color:#526b7f; font-size:24px; }
.scope-field input:focus,.scope-field select:focus { outline:2px solid #207d98; outline-offset:1px; }
.scope-field small,#scopeInstruction,#searchStatus { font-size:12px; color:#526777; line-height:1.4; }
#scopeInstruction { margin:12px 0; }
#searchStatus:empty { display:none; }
#drawerGpsBtn,#retryFacets { min-height:42px; color:#125e7f; background:#e9f3f8; border:1px solid #b8d8e6; border-radius:8px; padding:8px 12px; }
.scope-ui #applyBtn { min-height:46px; flex-shrink:0; width:100%; background:#155f7d; color:white; border:0; border-radius:9px; font-size:16px; }
.scope-ui #applyBtn:disabled { opacity:.48; }
.scope-ui .scope-scroll .modo-pill { min-height:42px; border-radius:8px; }
.scope-options { z-index:100010!important; background:#fff!important; border:1px solid #b9c9d6!important; border-radius:8px!important; overflow:auto!important; list-style:none!important; padding:4px!important; margin:0!important; box-shadow:0 6px 22px #172e4330; }
.scope-options li { padding:0!important; margin:0!important; border:0!important; }
.scope-options button { width:100%; text-align:left; min-height:44px; padding:10px; background:white; color:#16364d; border:0; font-size:14px; }
.scope-options button:focus,.scope-options button:hover { background:#e7f2f8; }
.scope-options[hidden],.scope-ui [hidden],#queryHint[hidden],#filterTip[hidden] { display:none!important; }
#queryHint { position:fixed; top:calc(var(--app-header-h) + 9px); left:50%; transform:translateX(-50%); max-width:calc(100vw - 28px); width:max-content; z-index:100020; padding:10px 14px; border-radius:10px; color:white; background:#183f50f5; box-shadow:0 4px 16px #0002; font-size:13px; pointer-events:auto; }
#queryHint button { display:block; margin-top:7px; min-height:38px; width:100%; background:#fff; color:#155f7d; border:0; border-radius:6px; padding:6px 10px; }
#filterTip { position:fixed; width:60px; z-index:901; color:#973c3c; font-size:14px; font-weight:700; text-align:center; pointer-events:none; animation:filter-arrow-pulse 1s ease-in-out infinite alternate; }
#filterTip span { display:block; padding:3px 0; background:#fffef6ed; border-radius:5px; }
#filterTip svg { display:block; width:60px; height:64px; fill:#ff9696; stroke:#b94747; stroke-width:1; filter:drop-shadow(0 2px 2px #fff9); }
@keyframes filter-arrow-pulse { from { transform:translateY(-4px); opacity:.75; } to { transform:translateY(3px); opacity:1; } }
@media(prefers-reduced-motion:reduce) { #filterTip { animation:none; } }
.scope-saved-label { font-size:13px; font-weight:650; margin-top:18px; }
.scope-ui #drawerPanel { min-height:100px; max-height:none; padding:4px; overflow:visible; }
.scope-ui #favoriteFeedContext { padding:8px; border-radius:8px; background:#e9f3f8; font-size:12px; }
@media(prefers-reduced-motion:reduce) { #headerLocation.locating svg { animation:none; opacity:.6; } }
.scope-ui .drawer.open ~ #fab { visibility:hidden; }

/* A barra do Chrome e o teclado não podem esconder o botão Aplicar. */
.scope-ui .drawer { height:var(--scope-viewport-height,100dvh); top:var(--scope-viewport-top,0px); bottom:auto; }

/* Escopo v4: filtros compactos e favoritos sempre descobertos na área visível. */
.scope-ui .drawer .content { gap:6px; padding:10px; overflow:hidden; }
.scope-ui .scope-title { flex:0 0 40px; font-size:17px; }
.scope-title-actions { display:flex; align-items:center; }
.scope-ui .scope-scroll { flex:0 1 auto; min-height:0; max-height:calc(var(--scope-viewport-height,100dvh) - 228px); padding:0 2px 4px; }
.scope-ui .scope-field { margin:5px 0; min-width:0; }
.scope-ui .scope-field label { font-size:12px; margin-bottom:3px; }
.scope-ui .scope-field input { min-height:42px; padding-top:8px; padding-bottom:8px; font-size:15px; }
.scope-ui .scope-refinements,.scope-ui #city-state { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px; }
.scope-ui #city-state:has(#cityRow[hidden]) { grid-template-columns:minmax(0,1fr); }
.scope-ui #scopeInstruction,.scope-ui #searchStatus { margin:4px 0; font-size:11px; }
.scope-ui #scopeInstruction:empty { display:none; }
.scope-ui .scope-scroll .check--modo-curso { margin:2px 0 6px; gap:6px; }
.scope-ui .scope-scroll .modo-pill { min-height:40px; padding:7px 10px; font-size:14px; }
.scope-ui #applyBtn { flex:0 0 44px; min-height:44px; }
.scope-favorites { display:flex; flex-direction:column; flex:1 1 130px; min-height:108px; border-top:1px solid #c9d7e1; padding-top:6px; overflow:hidden; }
.scope-favorites h2 { font-size:14px; margin:0 0 6px; color:#17334a; }
#scopeSavedSlot { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; }
.scope-ui #drawerPanel { min-height:0; margin:0; padding:0 2px 4px; overflow:visible; }
.scope-ui .saved-empty { padding:8px; font-size:13px; line-height:1.4; }
@media(max-height:360px) { .scope-favorites { min-height:86px; } .scope-ui .scope-scroll { max-height:calc(var(--scope-viewport-height,100dvh) - 202px); } }

/* Escopo v5: escolhas diretas; a faixa de favoritos mantém a reserva mínima. */
.scope-sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.scope-ui .scope-areas { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; border:0; margin:2px 0; padding:0; min-width:0; }
.scope-ui .scope-area { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; min-width:0; height:68px; padding:5px 2px; border:1px solid #afc1ce; border-radius:8px; background:#fff; color:#17334a; font-size:13px; font-weight:600; line-height:1.1; text-align:center; cursor:pointer; }
.scope-ui .scope-area input { appearance:auto; width:16px; height:16px; min-height:0; margin:0; accent-color:#155f7d; }
.scope-ui .scope-area:has(input:checked) { border:2px solid #155f7d; background:#e7f2f8; }
.scope-ui .scope-area:focus-within,.scope-ui .scope-area:focus-visible,.scope-ui .saved-card:focus-visible { outline:2px solid #155f7d; outline-offset:2px; }
.scope-ui #drawerGpsBtn { width:auto; height:68px; padding:5px 2px; font-size:clamp(10.5px,3.1vw,12px); }
.scope-ui #drawerGpsBtn svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; }
.scope-ui #drawerGpsBtn[aria-busy="true"] svg { animation:scope-pulse .9s ease-in-out infinite alternate; }
.scope-ui #stateRow label { font-size:14px; }
.scope-ui #stateSel { font-size:17px; }
#stateOptions button { font-size:17px; }
/* Resultado vazio: contraste com o feed claro, sem aparência de erro. */
#feedEmpty {
  position:fixed; top:calc(var(--app-header-h) + 80px); left:16px; right:16px;
  max-width:460px; max-height:calc(100dvh - var(--app-header-h) - 112px);
  margin:auto; padding:24px; overflow:auto;
  border:1px solid #31556f; border-top:4px solid #8ed7ed; border-radius:14px;
  background:#17334a; color:#fff; line-height:1.5;
  box-shadow:0 12px 32px #102a4340,0 2px 8px #102a4326; z-index:50;
}
#feedEmpty strong { display:block; font-size:20px; line-height:1.35; color:#fff; }
#feedEmpty p { margin:14px 0 20px; font-size:16px; color:#e0eaf2; }
#feedEmpty button,#retryBaseOptions { min-height:44px; padding:10px 16px; border:0; border-radius:8px; font-size:16px; color:#fff; background:#155f7d; }
#feedEmpty button { width:100%; min-height:48px; background:#fff; color:#17334a; font-weight:700; }
#feedEmpty button:hover { background:#e0eaf2; }
#feedEmpty button:active { background:#c5dce9; }
#feedEmpty button:focus-visible { outline:3px solid #8ed7ed; outline-offset:3px; }
#retryBaseOptions { background:#fff; color:#17334a; }
.scope-ui #drawerPanel .saved-card { cursor:pointer; }
@media(prefers-reduced-motion:reduce) { .scope-ui #drawerGpsBtn[aria-busy="true"] svg { animation:none; } }

/* Quantidade do recorte solicitado, sempre visível ao lado do resumo dos filtros. */
.scope-ui #headerSummary { display:flex; align-items:center; gap:6px; }
#headerScopeText { flex:1; min-width:0; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; text-align:center; }
#headerCount { flex:0 0 auto; min-width:42px; display:flex; flex-direction:column; justify-content:center; gap:1px; padding:2px 5px; border-radius:7px; background:#e7f0f5; color:#174f6a; line-height:1.05; }
#headerCountValue { font-size:16px; font-weight:700; font-variant-numeric:tabular-nums; }
#headerCountCaption { font-size:10px; font-weight:600; white-space:nowrap; }

/* Nome inicial integral numa linha, na altura existente do cabeçalho. */
.scope-ui #headerSummary.brand-heading { white-space:nowrap; gap:0; padding:0 2px; }
.scope-ui .brand-heading #headerScopeText { display:block; white-space:nowrap; -webkit-line-clamp:unset; overflow:visible; line-height:1.1; }

/* Antes de montar a interface, o nome também cabe sem reticências. */
.app-header__inner > span.brand { font-size:clamp(10px,3.1vw,19px)!important; text-overflow:clip; }

/* Marca Ramp4: o quatro fechado tem ápice e travessa de um A. */
.app-header .brand { position:relative; height:100%; align-content:center; color:#000; }
.ramp4-wordmark { display:inline-flex; align-items:baseline; justify-content:center; font-family:"Arial Black",system-ui,sans-serif; font-size:30px; font-weight:900; font-style:italic; line-height:1; letter-spacing:-1.3px; white-space:nowrap; }
.ramp4-four { width:29px; height:31px; margin-left:1px; align-self:center; fill:none; stroke:currentColor; stroke-width:4; stroke-linejoin:miter; stroke-linecap:square; }
.scope-ui #headerSummary.brand-heading { color:#000; }

/* Arte institucional do primeiro card em preto e branco. */
.eh_banner .banner-img[src*="/icons/banner_vhpm_2.svg"] { filter:grayscale(1); }

/* Snap nativo card a card; mesmo passo da virtualização e dois slots. */
:root.feed-card-snap.snap-ready:not(.has-smooth-scrollbar) #feedViewport { scroll-snap-type:y mandatory; scroll-padding-top:0; overscroll-behavior-y:contain; }
:root.feed-card-snap #feedViewport > #pool > article.card { scroll-snap-align:none; scroll-snap-stop:normal; }
:root.feed-card-snap .ramp4-snap-anchor { position:absolute; left:0; width:100%; pointer-events:none; scroll-snap-align:start; scroll-snap-stop:always; }

.interaction-totals{margin-top:1rem;padding:.8rem;border:1px solid currentColor;border-radius:.6rem;font-size:.85rem}.interaction-totals h3{font-size:1rem;margin:0 0 .6rem}.interaction-totals dl{display:grid;grid-template-columns:1fr auto;gap:.3rem 1rem;margin:0}.interaction-totals dd{margin:0;font-weight:700}.interaction-status{font-size:.8rem;margin:.6rem 0}.interaction-totals button{padding:.45rem .7rem;cursor:pointer}
