/* Aplicativo: barra superior, atalhos da seção e menu inferior (feito para o toque). */
html { -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }

.m-shell { min-height: 100vh; min-height: 100dvh; }

.m-top {
  position: sticky; top: 0; z-index: 12; display: flex; align-items: center; justify-content: space-between;
  min-height: calc(52px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0;
  color: #fff; background: var(--green-dark);
}
.m-brand { display: flex; align-items: center; gap: 8px; color: inherit; font-size: 15px; text-decoration: none; }
.m-brand span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: rgba(255, 255, 255, .14); }
.m-user { color: #d8dcd9; font-size: 12px; text-decoration: none; }

.m-subnav {
  position: sticky; top: calc(52px + env(safe-area-inset-top)); z-index: 11; display: flex; gap: 6px; padding: 8px 12px;
  overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--surface); scrollbar-width: none;
}
.m-subnav::-webkit-scrollbar { display: none; }
.m-subnav-link {
  flex: 0 0 auto; padding: 8px 14px; border-radius: 18px; color: #424a4b; background: var(--green-pale);
  font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.m-subnav-link.active { color: #fff; background: var(--green); }

.m-main { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.m-main .view { padding: 20px 14px 12px; }
.m-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
.m-hero .home-hero-copy { padding: 18px 20px; }
.m-hero .home-hero-copy h1 { font-size: 26px; }

.m-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; justify-content: space-around;
  height: calc(62px + env(safe-area-inset-bottom)); padding: 6px 6px env(safe-area-inset-bottom);
  border-top: 1px solid var(--line); background: var(--surface); box-shadow: 0 -4px 16px rgba(39, 44, 44, .06);
}
.m-tab {
  display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 10px;
  color: #6c7371; text-decoration: none;
}
.m-tab span { font-size: 20px; line-height: 1; }
.m-tab small { font-size: 11px; font-weight: 600; }
.m-tab.active { color: var(--green-dark); background: var(--green-pale); }

/* Alvos de toque confortáveis */
.button, .contact-action, .text-field, select.text-field, .filter-select select { min-height: 44px; }
.text-field { font-size: 16px; } /* 16px evita o zoom automático do iPhone ao tocar no campo */
.search-box input { font-size: 16px; }
.contact-actions { flex-wrap: wrap; }

/* Janelas (cadastro, confirmação) ocupam a tela inteira com rolagem */
.editor-backdrop { z-index: 30; align-items: end; padding: 0; }
.editor-backdrop .contact-dialog { width: 100%; max-width: 560px; max-height: 92dvh; border-radius: 16px 16px 0 0; padding-bottom: calc(23px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) {
  .editor-backdrop { align-items: center; padding: 14px; }
  .editor-backdrop .contact-dialog { border-radius: 12px; }
  .m-main .view { padding: 28px 5%; }
}
.confirm-backdrop { z-index: 40; }

/* Telas largas (tablet, navegador no computador): menu inferior centralizado */
@media (min-width: 900px) {
  .m-tabs { left: 50%; right: auto; width: 520px; transform: translateX(-50%); border-radius: 16px 16px 0 0; border: 1px solid var(--line); }
}

#blazor-error-ui { bottom: calc(70px + env(safe-area-inset-bottom)); }
.secretary-save-toast { bottom: calc(78px + env(safe-area-inset-bottom)); }

@media print {
  .m-top, .m-subnav, .m-tabs { display: none !important; }
  .m-main { padding: 0; }
}
