/* Espaço Novo Tempo — refinamento móvel transversal.
   Isolado por página, sem esconder conteúdo e sem tocar na lógica de autenticação. */
@media (pointer: coarse) {
  :is(button, a, summary, label, input, select, textarea) { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
  /* Alvos de toque confortáveis em qualquer dispositivo touch, inclusive tablets (711–960px). */
  .app-root :is(.btn, .round, .nav-links button, .top-right .round, .top-right .nt-install-top,
    .toolbar .search, .list-row .btn) { min-height: 44px; }
}
@media (max-width: 850px) {
  /* Portal público: navegação, títulos e seções sem largura rígida. */
  .header .menu-toggle { min-height: 44px; }
  .header nav.open { max-height: calc(100dvh - 78px); overflow-y: auto; overscroll-behavior: contain; }
  .header nav a { min-height: 44px; }
  .hero-main, .hero-under, .intro-grid, .intro-right,
  .gallery-heading, .gallery-mosaic, .nuclei-header, .gather-head,
  .participate-head, .member-main, .visit-grid, .recent-gallery { min-width: 0; max-width: 100%; }
  .gallery-mosaic > *, .gather-head > *, .participate-cards > *,
  .visit-grid > * { min-width: 0; }
  .visit-map iframe { max-width: 100%; }
  .recent-gallery-grid { max-width: 100%; }
}
@media (max-width: 560px) {
  .hero h1 { font-size: clamp(43px, 11.8vw, 66px); max-width: 100%; }
  .hero h1 .hero-word-mask { max-width: 100%; }
  .hero-under { gap: 10px; }
  .hero-under p { min-width: 0; overflow-wrap: anywhere; }
  .intro h2, .gallery h2, .nuclei h2, .gather h2,
  .participate h2 { overflow-wrap: normal; max-width: 100%; }
  .panorama-copy p { font-size: clamp(45px, 10.7vw, 67px); }
  .nuclei .nucleus summary { min-width: 0; }
  .visit-actions a { min-height: 48px; }
  .visit-map-link { overflow-wrap: anywhere; }
}
/* Painel Meu Espaço: áreas flexíveis não devem aumentar a largura da viewport. */
@media (max-width: 960px) {
  .app-root .workspace, .app-root .main, .app-root .card,
  .app-root .content-head, .app-root .toolbar,
  .app-root .nt-control-row, .app-root .nt-grid,
  .app-root .vf-nucleus-dashboard, .app-root .vf-grid,
  .app-root .wm-layout, .app-root .wa-grid { min-width: 0; max-width: 100%; }
  .app-root :is(.content-head, .toolbar, .nt-actions, .vf-actions, .wm-header-actions) {
    flex-wrap: wrap;
  }
  .app-root :is(.list-row .grow, .nt-person-details, .vf-response,
    .vf-question-edit, .vf-card, .wm-conversation-pane, .wm-chat-body) {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}
@media (max-width: 710px) {
  .app-root .app { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .app-root .top { gap: 9px; padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px; min-height: 63px; }
  .app-root .top > div:first-child { min-width: 0; }
  .app-root .top .eyebrow { font-size: .59rem; letter-spacing: .09em; line-height: 1.5; overflow-wrap: anywhere; }
  .app-root .top-right { flex-shrink: 0; gap: 6px; }
  .app-root .top-right .round, .app-root .top-right .nt-install-top { min-width: 42px; min-height: 42px; }
  .app-root .main { padding: 16px 12px 24px; }
  .app-root .hero { padding: 23px 19px; min-height: 215px; }
  .app-root .hero h1 { font-size: clamp(1.9rem, 8.7vw, 2.6rem); overflow-wrap: anywhere; }
  .app-root .nt-hero { padding: 22px 18px; min-height: 0; }
  .app-root .nt-hero h1 { font-size: clamp(1.75rem, 7vw, 2.25rem); }
  .app-root .content-head { align-items: flex-start; gap: 12px; }
  .app-root .content-head > :first-child { min-width: 0; }
  .app-root .card { padding: 17px; }
  .app-root .stats, .app-root .grid3 { gap: 9px; }
  .app-root .stat { min-width: 0; padding: 13px; }
  .app-root .stat .number { overflow-wrap: anywhere; }
  .app-root :is(.field input, .field textarea, .field select, .search,
    .nt-control-row input, .nt-control-row select, .nt-reminder-form input,
    .vf-question-edit input, .vf-question-edit textarea, .vf-question-edit select,
    .wa-compose textarea, .wm-composer textarea) {
    width: 100%; min-width: 0; max-width: 100%; font-size: 16px;
  }
  .app-root :is(.btn, .round, .nt-mark, .nt-week-trigger, .nt-week-steppers button,
    .agenda-date-trigger, .agenda-calendar-arrows button, .agenda-calendar-day,
    .vf-actions button, .vf-response-header select) { min-height: 44px; }
  .app-root .mobile-menu {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: calc(66px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -6px 22px rgba(0,0,0,.09);
  }
  .app-root .mobile-menu > button, .app-root .mobile-menu .mobile-more > summary {
    min-width: 0; min-height: 58px; padding: 5px 2px;
  }
  .app-root .mobile-menu button { overflow-wrap: anywhere; line-height: 1.2; }
  .app-root .mobile-menu .mobile-more-list {
    width: min(300px, calc(100vw - 24px));
    max-height: min(420px, calc(100dvh - 115px));
    overflow-y: auto;
  }
  .app-root .vf-nucleus-entry, .app-root .vf-nucleus-dashboard { padding: 18px; }
  .app-root .vf-actions .btn { flex: 1 1 145px; white-space: normal; }
  .app-root .vf-question-edit { padding: 14px; }
  .app-root .vf-response { padding: 15px; }
  .app-root .vf-response-header { gap: 8px; }
  .app-root .vf-response-header select { width: 100%; max-width: 100%; }
  .app-root .wm-conversation-pane, .app-root .wm-chat-body { min-width: 0; }
  .app-root .wm-composer { min-width: 0; }
  .app-root .wm-composer textarea { min-height: 100px; }
  .app-root .nt-install-floating {
    bottom: calc(81px + env(safe-area-inset-bottom, 0px));
  }
  body > #modal { width: calc(100vw - 20px); max-width: 100%;
    max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    overflow-x: hidden; overflow-y: auto; }
  body > #modal #dialog-content, body > #modal form { min-width: 0; max-width: 100%; }
  .nt-install-dialog { max-height: calc(100dvh - 30px - env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 380px) {
  .app-root .main { padding-inline: 10px; }
  .app-root .card { padding: 14px; }
  .app-root .top .eyebrow { font-size: .56rem; }
  .app-root .vf-actions .btn { flex-basis: 100%; }
  .app-root .wm-summary-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
}
/* Formulário público: campos de leitura e botões confortáveis até 320 px. */
@media (max-width: 720px) {
  .vf-public-body .vf-public-wrap, .vf-public-body .vf-public-card,
  .vf-public-body .vf-public-form, .vf-public-body .vf-public-question { min-width: 0; max-width: 100%; }
  .vf-public-body :is(input[type="text"], input[type="email"], input[type="tel"],
    input[type="date"], textarea, select) { font-size: 16px; min-width: 0; max-width: 100%; }
  .vf-public-body :is(.vf-public-button, .vf-public-option,
    .vf-theme-toggle, .vf-public-back) { min-height: 44px; }
  .vf-public-body .vf-public-option span, .vf-public-body .vf-public-question-title {
    overflow-wrap: anywhere;
  }
}
@media (max-width: 380px) {
  .vf-public-body .vf-public-header { gap: 6px; padding-inline: 10px; }
  .vf-public-body .vf-public-brand { min-width: 0; font-size: .64rem; gap: 6px; }
  .vf-public-body .vf-public-brand img { flex: 0 0 35px; width: 35px; height: 35px; }
  .vf-public-body .vf-public-wrap { padding-inline: 10px; }
  .vf-public-body .vf-public-form { padding-inline: 15px; }
  .vf-public-body .vf-public-form-heading { padding-inline: 17px; }
  .vf-public-body .vf-public-contact { padding-inline: 13px; }
}

/* Mobile-first aprovado: página pública, sem interferir no painel ou nos formulários.
   Mantém identidade monocromática oficial, imagens reais e links existentes. */
@media (max-width: 710px) {
  body:has(> main .gallery) { width:100%; max-width:100%; overflow-x:clip; }
  body:has(> main .gallery) > main { width:100%; min-width:0; overflow-x:clip; }
  body:has(> main .gallery) .header-in { min-height:76px; padding:12px 18px; gap:10px; }
  body:has(> main .gallery) .header .brand { min-width:0; gap:9px; }
  body:has(> main .gallery) .header .brand img { width:104px; max-height:48px; object-fit:contain; }
  body:has(> main .gallery) .header .brand-txt { font-size:7px; padding-left:9px; }
  body:has(> main .gallery) .header .menu-toggle { flex-shrink:0; min-width:70px; min-height:44px; }
  body:has(> main .gallery) .hero { height:min(780px,100svh); min-height:580px; max-width:100%; }
  body:has(> main .gallery) .hero-top { padding:110px 18px 0; font-size:8px; }
  body:has(> main .gallery) .hero-top > :last-child { display:none; }
  body:has(> main .gallery) .hero-main { padding:18px 18px 34px; width:100%; }
  body:has(> main .gallery) .hero h1 { font-size:clamp(37px,10.6vw,70px); letter-spacing:-.08em; white-space:normal; line-height:.96; margin:20px 0 26px; }
  body:has(> main .gallery) .hero h1 .hero-word-mask { display:block; width:100%; max-width:100%; overflow:visible; }
  body:has(> main .gallery) .hero h1 .hero-word { display:inline-block; max-width:100%; letter-spacing:-.085em; }
  body:has(> main .gallery) .hero h1 .star { margin-left:5px; }
  body:has(> main .gallery) .hero .lightline { font-size:9px; gap:8px; }
  body:has(> main .gallery) .hero .lightline span { font-size:17px; }
  body:has(> main .gallery) .hero-under { align-items:center; gap:12px; }
  body:has(> main .gallery) .hero-under p { font-size:clamp(14px,4.2vw,20px); line-height:1.45; }
  body:has(> main .gallery) .round-arrow { flex:0 0 48px; width:48px; height:48px; }
  body:has(> main .gallery) .hero-bottom { padding:16px 18px; gap:10px; }
  body:has(> main .gallery) .hero-bottom > :last-child { display:none; }
  body:has(> main .gallery) .section { padding:65px 18px 75px; }
  body:has(> main .gallery) .section-meta { gap:10px; font-size:8px; letter-spacing:.08em; }
  body:has(> main .gallery) .gallery-heading { min-width:0; }
  body:has(> main .gallery) .gallery-heading h2 { font-size:clamp(40px,11vw,64px); overflow-wrap:anywhere; }
  body:has(> main .gallery) .gallery-mosaic { min-width:0; width:100%; }
  body:has(> main .gallery) .gallery-mosaic figure { min-width:0; max-width:100%; overflow:hidden; }
  body:has(> main .gallery) .gallery-mosaic img { width:100%; max-width:100%; height:100%; object-fit:cover; }
  body:has(> main .gallery) .recent-gallery-filters {
    display:flex; flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden;
    max-width:100%; padding:3px 1px 12px; margin-inline:0;
    scroll-snap-type:x proximity; overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch; scrollbar-width:none;
  }
  body:has(> main .gallery) .recent-gallery-filters::-webkit-scrollbar { display:none; }
  body:has(> main .gallery) .recent-gallery-filters button {
    flex:0 0 auto; white-space:nowrap; min-height:44px; scroll-snap-align:start;
    font-size:11px; padding:11px 16px;
  }
  body:has(> main .gallery) .recent-gallery-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  body:has(> main .gallery) .recent-gallery-grid .recent-gallery-card { min-width:0; overflow:hidden; }
  body:has(> main .gallery) .recent-gallery-grid .recent-gallery-card figcaption { overflow-wrap:anywhere; }
  body:has(> main .gallery) .recent-gallery-more { min-height:48px; }
  body:has(> main .gallery) :is(.visit-grid,.participate-cards,.intro-grid) > * { min-width:0; max-width:100%; }
}
@media (max-width: 380px) {
  body:has(> main .gallery) .header .brand-txt { display:none; }
  body:has(> main .gallery) .hero h1 { font-size:10.2vw; }
  body:has(> main .gallery) .recent-gallery-grid { gap:8px; }
}
@media (prefers-reduced-motion:reduce) {
  body:has(> main .gallery) .recent-gallery-filters { scroll-behavior:auto; }
}
