/* ACE cascade: ace-responsive. Prioridade definida em ace-fonts.css. */
@layer ace-responsive {
/*
 * ACE Campo - camada final exclusiva para Samsung 8,7" em retrato.
 * Carregar depois de ace-theme.css, ace-ui-standard.css e do estilo inline do index.
 * Escopo intencional: viewport de tablet ate 900px, somente portrait.
 * O limite inferior fica aberto porque a escala de exibicao do Android pode
 * reduzir a largura CSS do Galaxy Tab A11 mesmo mantendo a tela de 8,7".
 */

/*
 * A fonte operacional e aplicada apenas depois do login. O acesso do agente
 * continua com sua composicao atual, enquanto toda a rotina de campo usa a
 * mesma tipografia dos paineis administrativos.
 */
html body.field-page #appShell,
html body.field-page #appShell :where(button, input, select, textarea, table),
html body.field-page #syncStatus {
  font-family: var(--ace-font-interface, "Sora", "Segoe UI", Arial, sans-serif);
}

html body.field-page #appShell :where(
  #syncChip,
  .operation-mode-badge,
  .screen-badge,
  .visit-step-chip__number,
  .visit-step-progress,
  .property-card-badges .badge,
  .offline-ready-badge,
  .hero-card strong,
  .metric-card strong,
  .panel-offline-stat b
) {
  font-family: var(--ace-font-technical, "DM Mono", Consolas, monospace);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

@media (max-width: 900px) and (orientation: portrait) {
  :root {
    --ace-field-header-h: calc(125px + env(safe-area-inset-top, 0px));
    --ace-field-wizard-h: 56px;
    --ace-field-sticky-gap: 8px;
    --ace-field-touch: 44px;
    --ace-field-action: 48px;
    --ace-field-keyboard-fallback: env(keyboard-inset-height, 0px);
    --ace-field-topbar-effective: max(
      var(--ace-field-topbar-height, 0px),
      var(--ace-field-header-h)
    );
    --ace-field-keyboard-effective: max(
      var(--ace-field-keyboard-inset, 0px),
      var(--ace-field-keyboard-fallback)
    );
    --ace-field-cta-clearance: 82px;
    --ace-field-bg-final: #f2f6f3;
    --ace-field-surface-final: #ffffff;
    --ace-field-surface-soft-final: #f7faf8;
    --ace-field-line-final: #d3ded7;
    --ace-field-line-strong-final: #aebfb5;
    --ace-field-ink-final: #172b21;
    --ace-field-muted-final: #4c6156;
    --ace-field-green-final: #0c6838;
    --ace-field-green-dark-final: #073b24;
    --ace-field-warn-final: #934b00;
    --ace-field-danger-final: #b4232a;
  }

  html body.field-page {
    min-height: 100dvh;
    overflow-x: hidden;
    overscroll-behavior-y: auto;
    color: var(--ace-field-ink-final);
    background: var(--ace-field-bg-final);
    font-size: 16px;
    touch-action: pan-x pan-y pinch-zoom;
  }

  html body.field-page .selected-card,
  html body.field-page .property-list,
  html body.field-page .property-list-body,
  html body.field-page #fieldMap,
  html body.field-page #fieldMap.leaflet-container {
    touch-action: pan-x pan-y pinch-zoom;
  }

  html,
  html body.field-page,
  html body.field-page main {
    scroll-padding-top: calc(
      var(--ace-field-topbar-effective) +
      var(--ace-field-wizard-h) +
      var(--ace-field-sticky-gap) +
      var(--ace-field-sticky-gap)
    );
    scroll-padding-bottom: calc(
      88px +
      env(safe-area-inset-bottom, 0px) +
      var(--ace-field-keyboard-effective)
    );
  }

  /* Cabecalho: uma altura previsivel para todas as barras subordinadas. */
  html body.field-page .topbar.topbar-v43,
  html body.field-page header.topbar.topbar-v43,
  html body.field-page .ace-topbar {
    position: sticky;
    inset: 0 0 auto;
    z-index: 1000;
    width: 100%;
    min-height: var(--ace-field-header-h);
    margin: 0;
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
    border-radius: 0;
    background: var(--ace-field-green-dark-final);
    box-shadow: 0 5px 14px rgba(7, 59, 36, .18);
  }

  html body.field-page .topbar-v43 .topbar-row {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(210px, .7fr) minmax(0, 1.3fr);
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: none;
    height: calc(64px + env(safe-area-inset-top, 0px));
    min-height: calc(64px + env(safe-area-inset-top, 0px));
    margin: 0;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
    background: var(--ace-field-green-dark-final);
  }

  html body.field-page .topbar-v43 .topbar-main,
  html body.field-page .topbar-v43 .brand-copy {
    display: block;
    min-width: 0;
  }

  html body.field-page .topbar-v43 .brand-copy h1 {
    max-width: none;
    margin: 0;
    overflow: hidden;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html body.field-page .topbar-v43 .brand-copy p,
  html body.field-page .topbar-v43 .brand-copy span {
    display: block;
    max-width: none;
    margin: 3px 0 0;
    overflow: hidden;
    color: rgba(255, 255, 255, .86);
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html body.field-page .topbar-v43 .chip-row,
  html body.field-page .topbar-v43 .topbar-actions {
    display: grid;
    grid-auto-flow: initial;
    grid-auto-columns: initial;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    align-items: stretch;
    gap: 6px;
    width: 100%;
    min-width: 0;
    margin: 0;
  }

  html body.field-page .topbar-v43 .topbar-actions > *,
  html body.field-page .topbar-v43 .chip,
  html body.field-page .topbar-v43 .operation-mode-badge,
  html body.field-page .topbar-v43 #syncChip,
  html body.field-page .topbar-v43 #headerSyncBtn,
  html body.field-page .topbar-v43 #logoutBtn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    height: var(--ace-field-action);
    min-height: var(--ace-field-action);
    max-height: var(--ace-field-action);
    padding: 0 7px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .54);
    border-radius: 9px;
    background: #ffffff;
    color: #29483a;
    box-shadow: none;
    font-size: .875rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html body.field-page .topbar-v43 .topbar-actions > * *,
  html body.field-page .topbar-v43 .chip *,
  html body.field-page .topbar-v43 .operation-mode-badge * {
    min-width: 0;
    overflow: hidden;
    color: inherit;
    font-size: inherit;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html body.field-page .topbar-v43 #syncChip.is-ok,
  html body.field-page .topbar-v43 .chip.is-ok,
  html body.field-page .topbar-v43 #headerSyncBtn,
  html body.field-page .topbar-v43 .header-sync-btn {
    border-color: var(--ace-field-green-final);
    background: var(--ace-field-green-final);
    color: #ffffff;
  }

  html body.field-page .topbar-v43 #syncChip.is-warn,
  html body.field-page .topbar-v43 .chip.is-warn {
    border-color: var(--ace-field-warn-final);
    background: var(--ace-field-warn-final);
    color: #ffffff;
  }

  html body.field-page .topbar-v43 #syncChip.is-danger,
  html body.field-page .topbar-v43 .chip.is-danger,
  html body.field-page .topbar-v43 #logoutBtn,
  html body.field-page .topbar-v43 .chip-logout {
    border-color: #961f25;
    background: var(--ace-field-danger-final);
    color: #ffffff;
  }

  /* Grid automatico: tres ou quatro abas sempre ocupam uma unica linha. */
  html body.field-page .nav-tabs.nav-tabs-v43 {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 7px;
    width: 100%;
    max-width: none;
    height: 60px;
    min-height: 60px;
    margin: 0;
    padding: 4px 12px 8px;
    overflow: hidden;
    border: 0;
    background: var(--ace-field-green-dark-final);
    box-shadow: none;
    clip-path: none;
  }

  html body.field-page .nav-tabs-v43 .tab-btn,
  html body.field-page .nav-tabs-v43 button.tab-btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    height: var(--ace-field-action);
    min-height: var(--ace-field-action);
    padding: 0 10px;
    overflow: hidden;
    border: 1px solid #cbd8d0;
    border-radius: 9px;
    background: #ffffff;
    color: #29483a;
    box-shadow: none;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html body.field-page .nav-tabs-v43 .tab-btn *,
  html body.field-page .nav-tabs-v43 .tab-btn .tab-btn__label {
    min-width: 0;
    overflow: hidden;
    color: inherit;
    font-size: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html body.field-page .nav-tabs-v43 .tab-btn.active,
  html body.field-page .nav-tabs-v43 .tab-btn.is-active,
  html body.field-page .nav-tabs-v43 .tab-btn[aria-selected="true"] {
    border-color: var(--ace-field-green-final);
    background: var(--ace-field-green-final);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  }

  html body.field-page #tabLiraaBtn[hidden],
  html body.field-page .nav-tabs-v43 .tab-btn[hidden] {
    display: none;
  }

  /* Aviso da segunda aba: fica acima da barra de CTA e acompanha o teclado. */
  html body.field-page .ace-secondary-tab-warning {
    box-sizing: border-box;
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(
      var(--ace-field-cta-clearance) +
      72px +
      env(safe-area-inset-bottom, 0px) +
      var(--ace-field-keyboard-effective)
    );
    z-index: 1300;
    width: auto;
    max-width: 760px;
    max-height: min(180px, 24dvh);
    min-height: var(--ace-field-touch);
    margin: 0 auto;
    padding: 11px 14px;
    overflow: auto;
    border: 1px solid #c8790b;
    border-left: 5px solid var(--ace-field-warn-final);
    border-radius: 10px;
    background: #fff6df;
    color: #5c3300;
    box-shadow: 0 5px 16px rgba(78, 43, 0, .16);
    font-size: .875rem;
    font-weight: 750;
    line-height: 1.35;
    text-align: left;
    overscroll-behavior: contain;
  }

  html body.field-page .ace-secondary-tab-warning strong,
  html body.field-page .ace-secondary-tab-warning span {
    display: block;
    color: inherit;
    font-size: .875rem;
    line-height: 1.35;
  }

  html body.field-page .ace-secondary-tab-warning strong {
    margin-bottom: 2px;
    font-size: 1rem;
    font-weight: 900;
  }

  html body.field-page .ace-secondary-tab-warning button,
  html body.field-page .ace-secondary-tab-warning a {
    min-height: var(--ace-field-touch);
  }

  html body.field-page .ace-secondary-tab-warning[hidden],
  html body.field-page .ace-secondary-tab-warning.is-hidden {
    display: none;
  }

  /* Conteudo e hierarquia tipografica operacional. */
  html body.field-page main {
    box-sizing: border-box;
    width: 100%;
    max-width: 900px;
    min-height: calc(
      100dvh - var(--ace-field-topbar-effective)
    );
    margin: 0 auto;
    padding: 12px 14px calc(32px + env(safe-area-inset-bottom, 0px));
  }

  html body.field-page main label,
  html body.field-page main small,
  html body.field-page main .field-help,
  html body.field-page main .muted,
  html body.field-page main .panel-card-note,
  html body.field-page main .property-card-secretaria-line,
  html body.field-page main .property-card-address,
  html body.field-page main .visit-step-hint {
    color: var(--ace-field-muted-final);
    font-size: .875rem;
    line-height: 1.35;
  }

  html body.field-page main label {
    display: block;
    margin-bottom: 6px;
    color: var(--ace-field-ink-final);
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
  }

  html body.field-page main .section-title,
  html body.field-page main .ace-section-title {
    margin: 0 0 10px;
    color: var(--ace-field-ink-final);
    font-size: 1.125rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.01em;
    text-transform: none;
  }

  html body.field-page main input:not([type="hidden"]),
  html body.field-page main select,
  html body.field-page main textarea {
    box-sizing: border-box;
    width: 100%;
    height: auto;
    min-height: var(--ace-field-action);
    padding: 11px 13px;
    border: 1px solid var(--ace-field-line-strong-final);
    border-radius: 9px;
    background: #ffffff;
    color: var(--ace-field-ink-final);
    box-shadow: none;
    font-size: 1rem;
    line-height: 1.3;
  }

  html body.field-page main textarea {
    min-height: 104px;
    resize: vertical;
  }

  html body.field-page main input:focus,
  html body.field-page main select:focus,
  html body.field-page main textarea:focus {
    border-color: var(--ace-field-green-final);
    outline: 3px solid rgba(12, 104, 56, .18);
    outline-offset: 1px;
    box-shadow: none;
    scroll-margin-top: calc(
      var(--ace-field-topbar-effective) +
      var(--ace-field-wizard-h) +
      var(--ace-field-sticky-gap) +
      var(--ace-field-sticky-gap)
    );
    scroll-margin-bottom: calc(
      96px +
      env(safe-area-inset-bottom, 0px) +
      var(--ace-field-keyboard-effective)
    );
  }

  /* Superficies mais planas: borda clara, raio contido e sombra curta. */
  html body.field-page #appShell .card,
  html body.field-page #appShell .ace-card,
  html body.field-page #appShell .hero-card,
  html body.field-page #appShell .metric-card,
  html body.field-page #appShell .property-form-section,
  html body.field-page #appShell .offline-ready-card,
  html body.field-page #appShell .selected-card,
  html body.field-page #appShell .deposit-card,
  html body.field-page #appShell .table-wrap {
    border: 1px solid var(--ace-field-line-final);
    border-radius: 12px;
    background: var(--ace-field-surface-final);
    box-shadow: 0 2px 7px rgba(18, 50, 34, .06);
    backdrop-filter: none;
  }

  html body.field-page #appShell .card::before,
  html body.field-page #appShell .ace-card::before,
  html body.field-page #appShell .hero-card::before,
  html body.field-page #appShell .metric-card::before,
  html body.field-page #appShell .property-form-section::before {
    content: none;
    display: none;
  }

  html body.field-page #appShell .btn,
  html body.field-page #appShell .ace-btn,
  html body.field-page #appShell button {
    touch-action: manipulation;
  }

  html body.field-page #appShell .btn,
  html body.field-page #appShell .ace-btn {
    box-sizing: border-box;
    min-height: var(--ace-field-action);
    padding: 10px 14px;
    border-radius: 9px;
    box-shadow: none;
    font-size: .875rem;
    font-weight: 800;
    line-height: 1.15;
  }

  html body.field-page #appShell .btn-primary,
  html body.field-page #appShell .ace-btn--primary {
    border-color: var(--ace-field-green-final);
    background: var(--ace-field-green-final);
    color: #ffffff;
  }

  html body.field-page #appShell .btn-secondary,
  html body.field-page #appShell .btn-soft,
  html body.field-page #appShell .ace-btn--soft {
    border: 1px solid var(--ace-field-line-strong-final);
    background: #ffffff;
    color: #234735;
  }

  html body.field-page #appShell .btn-danger {
    border-color: #961f25;
    background: var(--ace-field-danger-final);
    color: #ffffff;
  }

  html body.field-page #screen-visita.visit-screen label,
  html body.field-page #screen-visita.visit-screen small,
  html body.field-page #screen-visita.visit-screen span,
  html body.field-page #screen-visita.visit-screen p,
  html body.field-page #screen-visita.visit-screen .field-help,
  html body.field-page #screen-visita.visit-screen .muted,
  html body.field-page #screen-visita.visit-screen .selected-card-item small,
  html body.field-page #screen-visita.visit-screen .selected-card-top span,
  html body.field-page #screen-visita.visit-screen .deposit-top span,
  html body.field-page #screen-visita.visit-screen .visit-summary-mini-card span {
    color: var(--ace-field-muted-final);
    font-size: .875rem;
    line-height: 1.35;
  }

  html body.field-page #screen-visita.visit-screen strong {
    font-size: 1rem;
    line-height: 1.2;
  }

  html body.field-page #screen-visita.visit-screen .section-title,
  html body.field-page #screen-visita.visit-screen .ace-section-title {
    color: var(--ace-field-ink-final);
    font-size: 1.125rem;
    line-height: 1.2;
  }

  html body.field-page #screen-visita.visit-screen .selected-card-item strong,
  html body.field-page #screen-visita.visit-screen .selected-card-top strong,
  html body.field-page #screen-visita.visit-screen .deposit-top strong,
  html body.field-page #screen-visita.visit-screen .visit-summary-mini-card strong {
    color: var(--ace-field-ink-final);
    font-size: 1rem;
    line-height: 1.2;
  }

  html body.field-page #screen-visita.visit-screen input:not([type="hidden"]),
  html body.field-page #screen-visita.visit-screen select,
  html body.field-page #screen-visita.visit-screen textarea {
    height: auto;
    min-height: var(--ace-field-action);
    padding: 11px 13px;
    border-radius: 9px;
    font-size: 1rem;
    line-height: 1.3;
  }

  html body.field-page #screen-visita.visit-screen textarea {
    min-height: 104px;
  }

  /* Visita: wizard abaixo do cabecalho, sem colisao e com cinco etapas legiveis. */
  html body.field-page #screen-visita .visit-wizard,
  html body.field-page .visit-screen .visit-wizard {
    box-sizing: border-box;
    position: sticky;
    top: calc(
      var(--ace-field-topbar-effective) +
      var(--ace-field-sticky-gap)
    );
    z-index: 900;
    width: 100%;
    height: var(--ace-field-wizard-h);
    min-height: var(--ace-field-wizard-h);
    margin: 0 0 10px;
    padding: 6px;
    overflow: hidden;
    border: 1px solid var(--ace-field-line-final);
    border-radius: 11px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 3px 9px rgba(18, 50, 34, .08);
    backdrop-filter: none;
  }

  html body.field-page #screen-visita .visit-wizard-steps,
  html body.field-page .visit-screen .visit-wizard-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    min-width: 0;
    height: var(--ace-field-touch);
    padding: 0;
    overflow: hidden;
    scroll-snap-type: none;
  }

  html body.field-page #screen-visita .visit-step-chip,
  html body.field-page .visit-screen .visit-step-chip {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
    height: var(--ace-field-touch);
    min-height: var(--ace-field-touch);
    max-height: var(--ace-field-touch);
    padding: 5px 7px;
    border: 1px solid var(--ace-field-line-strong-final);
    border-radius: 8px;
    background: #ffffff;
    color: #29483a;
    box-shadow: none;
    font-size: .875rem;
    line-height: 1.1;
    transform: none;
  }

  html body.field-page #screen-visita .visit-step-chip__number {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 7px;
    font-size: .875rem;
  }

  html body.field-page #screen-visita .visit-step-chip__body {
    display: block;
    min-width: 0;
  }

  html body.field-page #screen-visita .visit-step-chip__body small,
  html body.field-page #screen-visita .visit-step-chip__body > span,
  html body.field-page #screen-visita .visit-step-chip__mobile-label {
    display: none;
  }

  html body.field-page #screen-visita .visit-step-chip__body strong {
    display: block;
    margin: 0;
    overflow: hidden;
    color: inherit;
    font-size: .875rem;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html body.field-page #screen-visita .visit-step-chip.is-active {
    border-color: var(--ace-field-green-final);
    background: var(--ace-field-green-final);
    color: #ffffff;
  }

  html body.field-page #screen-visita .visit-step-chip.is-done {
    border-color: #85ad94;
    background: #eaf5ee;
    color: #174c2f;
  }

  html body.field-page #screen-visita .visit-card,
  html body.field-page #screen-visita .visit-step-panel,
  html body.field-page #screen-visita .selected-card {
    scroll-margin-top: calc(
      var(--ace-field-topbar-effective) +
      var(--ace-field-wizard-h) +
      var(--ace-field-sticky-gap) +
      var(--ace-field-sticky-gap)
    );
  }

  html body.field-page #screen-visita .choice-btn,
  html body.field-page #screen-visita .quick-btn,
  html body.field-page #screen-visita .selected-card-start-btn,
  html body.field-page #screen-visita .property-query-actions .btn,
  html body.field-page #screen-visita .visit-final-actions .btn,
  html body.field-page #screen-visita .stepper button {
    min-height: var(--ace-field-action);
    height: auto;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: .875rem;
    line-height: 1.15;
  }

  html body.field-page #screen-visita .choice-btn span,
  html body.field-page #screen-visita .quick-btn span {
    color: var(--ace-field-muted-final);
    font-size: .875rem;
    line-height: 1.25;
  }

  html body.field-page #screen-visita .choice-btn.active,
  html body.field-page #screen-visita .choice-btn.active span {
    color: #ffffff;
  }

  html body.field-page #screen-visita .choice-grid {
    gap: 8px;
  }

  html body.field-page #screen-visita #situacaoChoices.choice-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  html body.field-page #screen-visita .deposit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  html body.field-page #screen-visita .visit-final-actions {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 8px;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  html body.field-page #screen-visita.visit-screen {
    padding-bottom: calc(
      var(--ace-field-cta-clearance) +
      20px +
      env(safe-area-inset-bottom, 0px)
    );
  }

  html body.field-page #visitNavigationBar.visit-navigation-bar {
    box-sizing: border-box;
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(
      10px +
      env(safe-area-inset-bottom, 0px) +
      var(--ace-field-keyboard-effective)
    );
    z-index: 1150;
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr) 180px;
    align-items: center;
    gap: 10px;
    width: auto;
    max-width: 760px;
    min-height: 64px;
    margin: 0 auto;
    padding: 8px;
    border: 1px solid var(--ace-field-line-strong-final);
    border-radius: 12px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 6px 18px rgba(18, 50, 34, .14);
    backdrop-filter: none;
  }

  html body.field-page #visitNavigationBar .btn {
    width: 100%;
    min-width: 0;
    min-height: var(--ace-field-action);
    height: var(--ace-field-action);
    padding: 8px 12px;
    font-size: 1rem;
  }

  html body.field-page #visitNavigationBar .visit-step-progress {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: var(--ace-field-ink-final);
    font-size: .875rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Consulta: controles confortaveis e lista alta sem desperdiçar o viewport. */
  html body.field-page #screen-visita .property-query-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(220px, .55fr);
    gap: 10px;
    align-items: end;
  }

  html body.field-page #screen-visita .property-query-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 128px 96px;
    align-items: stretch;
    gap: 8px;
    margin-top: 10px;
  }

  html body.field-page #screen-visita .property-query-summary {
    box-sizing: border-box;
    min-height: var(--ace-field-action);
    padding: 7px 10px;
    border: 1px solid var(--ace-field-line-final);
    border-radius: 9px;
    background: var(--ace-field-surface-soft-final);
  }

  html body.field-page #screen-visita .property-query-summary strong,
  html body.field-page #screen-visita .property-query-summary span {
    color: var(--ace-field-ink-final);
    font-size: .875rem;
    line-height: 1.2;
  }

  html body.field-page #screen-visita .visit-property-browser-card .property-list {
    height: clamp(
      360px,
      calc(
        100dvh -
        var(--ace-field-topbar-effective) -
        var(--ace-field-wizard-h) -
        230px
      ),
      760px
    );
    min-height: 360px;
    max-height: 760px;
    margin-top: 12px;
    overflow: auto;
    border: 1px solid var(--ace-field-line-final);
    border-radius: 10px;
    background: #ffffff;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  html body.field-page #screen-visita .property-list-head {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 8px;
    border-bottom: 1px solid var(--ace-field-line-final);
    background: rgba(255, 255, 255, .98);
    box-shadow: none;
    backdrop-filter: none;
  }

  html body.field-page #screen-visita .property-list-filters {
    display: flex;
    gap: 6px;
    padding: 0 0 3px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
  }

  html body.field-page #screen-visita .property-filter-btn {
    box-sizing: border-box;
    flex: 0 0 auto;
    min-width: 104px;
    min-height: var(--ace-field-touch);
    padding: 8px 10px;
    border: 1px solid var(--ace-field-line-strong-final);
    border-radius: 9px;
    background: #ffffff;
    color: #29483a;
    font-size: .875rem;
    font-weight: 800;
    line-height: 1.1;
    scroll-snap-align: start;
  }

  html body.field-page #screen-visita .property-filter-btn.is-active {
    border-color: var(--ace-field-green-final);
    background: var(--ace-field-green-final);
    color: #ffffff;
  }

  html body.field-page #screen-visita .property-filter-btn span {
    color: inherit;
    font-size: .875rem;
  }

  html body.field-page.ace-page--field #screen-visita .property-result-card.secretaria-style-card {
    padding: 13px 14px;
    border: 1px solid var(--ace-field-line-final);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 1px 5px rgba(18, 50, 34, .05);
  }

  html body.field-page.ace-page--field #screen-visita .property-card-row-secretaria {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 268px;
    align-items: center;
    gap: 12px;
  }

  html body.field-page.ace-page--field #screen-visita .secretaria-style-card .property-card-title {
    margin: 0 0 4px;
    color: var(--ace-field-ink-final);
    font-size: 1rem;
    line-height: 1.2;
  }

  html body.field-page.ace-page--field #screen-visita .secretaria-style-card .property-card-badges {
    gap: 5px;
    margin-top: 7px;
  }

  html body.field-page.ace-page--field #screen-visita .secretaria-style-card .badge {
    min-height: 26px;
    padding: 4px 8px;
    border-radius: 999px;
    color: #29483a;
    font-size: .875rem;
    line-height: 1.2;
  }

  html body.field-page.ace-page--field #screen-visita .secretaria-style-card .property-card-actions-bottom {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
    margin: 0;
  }

  html body.field-page.ace-page--field #screen-visita .secretaria-style-card .property-card-actions-bottom .btn {
    width: 100%;
    min-width: 0;
    min-height: var(--ace-field-action);
    padding: 9px 10px;
    border-radius: 9px;
    font-size: .875rem;
  }

  html body.field-page.ace-page--field #screen-visita .secretaria-style-card .property-card-start {
    grid-column: 1 / -1;
  }

  /* Cadastro: campos de 48px e acoes estaveis, sem cobrir o teclado. */
  html body.field-page #screen-imoveis.properties-screen label,
  html body.field-page #screen-imoveis.properties-screen small,
  html body.field-page #screen-imoveis.properties-screen span,
  html body.field-page #screen-imoveis.properties-screen p,
  html body.field-page #screen-imoveis.properties-screen .field-help {
    color: var(--ace-field-muted-final);
    font-size: .875rem;
    line-height: 1.35;
  }

  html body.field-page #screen-imoveis.properties-screen strong {
    font-size: 1rem;
    line-height: 1.2;
  }

  html body.field-page #screen-imoveis.properties-screen input:not([type="hidden"]),
  html body.field-page #screen-imoveis.properties-screen select,
  html body.field-page #screen-imoveis.properties-screen textarea {
    height: auto;
    min-height: var(--ace-field-action);
    padding: 11px 13px;
    border-radius: 9px;
    font-size: 1rem;
    line-height: 1.3;
  }

  html body.field-page #screen-imoveis.properties-screen textarea {
    min-height: 104px;
  }

  html body.field-page #screen-imoveis .property-form-section__heading h3 {
    color: var(--ace-field-ink-final);
    font-size: 1rem;
    line-height: 1.2;
  }

  html body.field-page #screen-imoveis .property-form-card--solo {
    padding: 14px;
    border-radius: 12px;
  }

  html body.field-page #screen-imoveis .property-form-section {
    margin-top: 10px;
    padding: 11px;
  }

  html body.field-page #screen-imoveis .property-form-grid {
    gap: 10px;
  }

  html body.field-page #screen-imoveis .property-form-grid--top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html body.field-page #screen-imoveis .property-form-grid--address {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.65fr) minmax(120px, .75fr);
  }

  html body.field-page #screen-imoveis .property-form-grid--territory-top {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  html body.field-page #screen-imoveis .property-form-actions--refined {
    position: sticky;
    bottom: calc(
      8px +
      env(safe-area-inset-bottom, 0px) +
      var(--ace-field-keyboard-effective)
    );
    z-index: 400;
    display: grid;
    grid-template-columns: .72fr 1.15fr .82fr .78fr;
    gap: 8px;
    margin-top: 12px;
    padding: 8px;
    border: 1px solid var(--ace-field-line-final);
    border-radius: 11px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 3px 10px rgba(18, 50, 34, .10);
    backdrop-filter: none;
  }

  html body.field-page #screen-imoveis .property-form-actions--refined .btn {
    min-width: 0;
    min-height: var(--ace-field-action);
    height: auto;
    padding: 9px 8px;
    font-size: .875rem;
  }

  html body.field-page #screen-imoveis .property-form-card:focus-within .property-form-actions--refined {
    position: static;
    bottom: auto;
  }

  /* Painel: duas colunas reais e comando offline abaixo do cabecalho. */
  html body.field-page #screen-painel {
    width: 100%;
    max-width: none;
  }

  html body.field-page #screen-painel .screen-head {
    padding: 13px 15px;
    border-radius: 11px;
    box-shadow: 0 2px 7px rgba(18, 50, 34, .06);
  }

  html body.field-page #screen-painel .screen-head-copy strong {
    color: var(--ace-field-ink-final);
    font-size: 1.125rem;
    line-height: 1.2;
  }

  html body.field-page #screen-painel .screen-head-copy span {
    color: var(--ace-field-muted-final);
    font-size: .875rem;
    line-height: 1.3;
  }

  html body.field-page #screen-painel .section-title,
  html body.field-page #screen-painel .ace-section-title {
    color: var(--ace-field-ink-final);
    font-size: 1.125rem;
    line-height: 1.2;
  }

  html body.field-page #screen-painel small,
  html body.field-page #screen-painel span,
  html body.field-page #screen-painel p,
  html body.field-page #screen-painel .panel-next-check,
  html body.field-page #screen-painel .offline-ready-check,
  html body.field-page #screen-painel .offline-ready-meta,
  html body.field-page #screen-painel .offline-ready-warning {
    font-size: .875rem;
    line-height: 1.3;
  }

  html body.field-page #screen-painel strong {
    font-size: 1rem;
    line-height: 1.2;
  }

  html body.field-page #screen-painel .panel-offline-command {
    position: sticky;
    top: calc(
      var(--ace-field-topbar-effective) +
      var(--ace-field-sticky-gap)
    );
    z-index: 800;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
    gap: 10px;
    margin: 0 0 10px;
    padding: 10px;
    border: 1px solid var(--ace-field-line-final);
    border-left: 5px solid var(--ace-field-green-final);
    border-radius: 10px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 3px 9px rgba(18, 50, 34, .08);
  }

  html body.field-page #screen-painel .panel-offline-main small,
  html body.field-page #screen-painel .panel-offline-main span,
  html body.field-page #screen-painel .panel-offline-stat small,
  html body.field-page #screen-painel .panel-next-kicker,
  html body.field-page #screen-painel .panel-section-kicker {
    color: var(--ace-field-muted-final);
    font-size: .875rem;
    line-height: 1.25;
    letter-spacing: 0;
  }

  html body.field-page #screen-painel .panel-offline-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  html body.field-page #screen-painel .panel-offline-stat {
    min-height: 58px;
    padding: 6px;
    border-radius: 8px;
  }

  html body.field-page #screen-painel .panel-next-action-card {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(230px, .8fr);
    gap: 12px;
  }

  html body.field-page #screen-painel .hero-grid,
  html body.field-page #screen-painel .metric-grid,
  html body.field-page #syncCenterGrid,
  html body.field-page #screen-painel .grid.two,
  html body.field-page #screen-painel .panel-card-list,
  html body.field-page #screen-painel .offline-ready-checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  html body.field-page #screen-painel .hero-card,
  html body.field-page #screen-painel .metric-card,
  html body.field-page #syncCenterGrid .metric-card {
    min-height: 92px;
    padding: 12px;
    text-align: left;
  }

  html body.field-page #screen-painel .hero-card small,
  html body.field-page #screen-painel .metric-card small,
  html body.field-page #syncCenterGrid .metric-card small,
  html body.field-page #screen-painel .hero-card span,
  html body.field-page #screen-painel .metric-card span,
  html body.field-page #syncCenterGrid .metric-card span {
    color: var(--ace-field-muted-final);
    font-size: .875rem;
    line-height: 1.25;
    letter-spacing: 0;
  }

  html body.field-page #screen-painel .hero-card strong,
  html body.field-page #screen-painel .metric-card strong,
  html body.field-page #syncCenterGrid .metric-card strong {
    margin: 5px 0 3px;
    color: var(--ace-field-ink-final);
    font-size: 1.5rem;
    line-height: 1;
  }

  html body.field-page #screen-painel .offline-ready-actions,
  html body.field-page #screen-painel .dashboard-day-actions,
  html body.field-page #screen-painel .panel-next-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  html body.field-page #screen-painel .offline-ready-actions .btn,
  html body.field-page #screen-painel .dashboard-day-actions .btn,
  html body.field-page #screen-painel .panel-next-actions .btn,
  html body.field-page #screen-painel .panel-list-card-actions .btn,
  html body.field-page #screen-painel .sync-export-btn {
    min-height: var(--ace-field-action);
    font-size: .875rem;
  }

  html body.field-page #screen-painel .panel-list-card {
    min-height: 110px;
    padding: 11px;
    border: 1px solid var(--ace-field-line-final);
    border-radius: 10px;
    box-shadow: none;
  }

  html body.field-page #screen-painel .panel-list-card strong {
    color: var(--ace-field-ink-final);
    font-size: 1rem;
    line-height: 1.2;
  }

  html body.field-page #screen-painel .panel-list-card span,
  html body.field-page #screen-painel .panel-list-card small {
    color: var(--ace-field-muted-final);
    font-size: .875rem;
    line-height: 1.3;
  }

  /* Telas injetadas depois do CSS estatico. */
  html body.field-page #screen-liraa small,
  html body.field-page #screen-liraa span,
  html body.field-page #screen-liraa p,
  html body.field-page #screen-liraa label {
    font-size: .875rem;
    line-height: 1.35;
  }

  html body.field-page #screen-liraa strong {
    font-size: 1rem;
    line-height: 1.2;
  }

  html body.field-page #screen-liraa .liraa-field-hero > strong,
  html body.field-page #screen-liraa .liraa-field-hero > div > strong {
    font-size: 1.35rem;
    line-height: 1.1;
  }

  html body.field-page #screen-liraa .liraa-field-count strong {
    font-size: 2rem;
    line-height: 1;
  }

  html body.field-page .liraa-screen .liraa-field-progress,
  html body.field-page .liraa-screen .liraa-field-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  html body.field-page .liraa-screen .liraa-field-selector .btn,
  html body.field-page .liraa-screen .liraa-field-selector select,
  html body.field-page .liraa-screen .liraa-field-property .btn,
  html body.field-page .liraa-screen .liraa-main-action {
    min-height: var(--ace-field-action);
    border-radius: 9px;
    font-size: 1rem;
  }

  html body.field-page .pe-visit-panel,
  html body.field-page .liraa-screen .card,
  html body.field-page .liraa-field-hero,
  html body.field-page .liraa-field-property {
    border-radius: 12px;
    box-shadow: 0 2px 7px rgba(18, 50, 34, .06);
  }

  /* Toast e modal acompanham o viewport visual/teclado quando o navegador expoe o inset. */
  html body.field-page .sync-banner {
    right: 12px;
    bottom: calc(
      var(--ace-field-cta-clearance) +
      12px +
      env(safe-area-inset-bottom, 0px) +
      var(--ace-field-keyboard-effective)
    );
    z-index: 1200;
    max-width: calc(100vw - 24px);
    min-height: var(--ace-field-touch);
    border-radius: 10px;
    font-size: .875rem;
  }

  html body.field-page .lgpd-modal-card,
  html body.field-page .modal-card {
    max-height: calc(100dvh - 24px);
    padding: 18px;
    border-radius: 14px;
    overscroll-behavior: contain;
  }

  html body.field-page .lgpd-actions .btn,
  html body.field-page .lgpd-consent-actions .btn,
  html body.field-page .modal-card .btn {
    min-height: var(--ace-field-action);
    font-size: .875rem;
  }

  html body.field-page .login-shell {
    min-height: 100dvh;
    padding: calc(20px + env(safe-area-inset-top, 0px)) 16px
      calc(20px + env(safe-area-inset-bottom, 0px));
  }

  html body.field-page .login-card {
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(7, 39, 24, .16);
  }

  html body.field-page .login-card input,
  html body.field-page .login-card select,
  html body.field-page .login-actions .btn {
    min-height: var(--ace-field-action);
    border-radius: 9px;
    font-size: 1rem;
  }

}

/*
 * A escala de exibicao do Android pode entregar cerca de 533 px CSS no
 * Galaxy de 8,7". Nesta largura o conteudo passa a priorizar leitura e toque,
 * sem transformar o fluxo de campo em uma coluna excessivamente longa.
 */
@media (max-width: 620px) and (orientation: portrait) {
  html body.field-page .topbar-v43 .topbar-row {
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 8px;
  }

  html body.field-page .topbar-v43 .brand-copy p,
  html body.field-page .topbar-v43 .brand-copy span {
    display: none;
  }

  html body.field-page .topbar-v43 .topbar-actions {
    grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
    gap: 5px;
  }

  html body.field-page .topbar-v43 .topbar-actions > *,
  html body.field-page .topbar-v43 .operation-mode-badge,
  html body.field-page .topbar-v43 #syncChip,
  html body.field-page .topbar-v43 #headerSyncBtn,
  html body.field-page .topbar-v43 #logoutBtn {
    padding-inline: 5px;
  }

  html body.field-page #visitNavigationBar {
    grid-template-columns: 112px minmax(0, 1fr) 136px;
    gap: 7px;
  }

  html body.field-page #screen-visita .property-query-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  html body.field-page #screen-visita .property-query-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html body.field-page #screen-visita .property-query-summary {
    grid-column: 1 / -1;
  }

  html body.field-page.ace-page--field #screen-visita .property-card-row-secretaria {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  html body.field-page.ace-page--field #screen-visita .secretaria-style-card .property-card-actions-bottom {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html body.field-page.ace-page--field #screen-visita .secretaria-style-card .property-card-start {
    grid-column: 1 / -1;
  }

  html body.field-page #screen-imoveis .property-form-grid--address {
    grid-template-columns: minmax(0, 1fr) 120px;
  }

  html body.field-page #screen-imoveis .property-form-grid--address .property-field-bairro {
    grid-column: 1 / -1;
  }

  html body.field-page #screen-imoveis .property-form-grid--address .property-field-logradouro {
    grid-column: 1;
  }

  html body.field-page #screen-imoveis .property-form-grid--address .property-field-numero {
    grid-column: 2;
  }

  html body.field-page #screen-imoveis .property-form-grid--territory-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html body.field-page #screen-imoveis .property-form-grid--territory-top .property-field-tipo,
  html body.field-page #screen-imoveis .property-form-grid--territory-top .property-field-complemento,
  html body.field-page #screen-imoveis .property-form-grid--territory-top .property-field-microarea,
  html body.field-page #screen-imoveis .property-form-grid--territory-top .property-field-quarteirao {
    grid-column: span 1;
  }

  html body.field-page #screen-imoveis .property-form-grid--territory-top .property-field-referencia {
    grid-column: 1 / -1;
  }

  html body.field-page #screen-imoveis .property-form-actions--refined {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html body.field-page #screen-painel .panel-next-action-card {
    grid-template-columns: minmax(0, 1fr);
  }

  html body.field-page #screen-painel .panel-offline-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) and (orientation: portrait) and (prefers-reduced-motion: reduce) {
  html body.field-page *,
  html body.field-page *::before,
  html body.field-page *::after {
    scroll-behavior: auto;
    transition-duration: .01ms;
    animation-duration: .01ms;
    animation-iteration-count: 1;
  }
}

/* Espaçamentos declarativos substituem atributos style sem alterar o fluxo do agente. */
html body.field-page #loginMessage.ace-login-status {
  margin-top: 14px;
  text-align: center;
}

html body.field-page .ace-space-top-16 {
  margin-top: 16px;
}

html body.field-page .ace-space-top-18 {
  margin-top: 18px;
}
}
