/* =====================================================================
   HIG — acabamento no padrão das Apple Human Interface Guidelines
   (developer.apple.com/design). Camada final: carrega depois do
   estilo.css e só ajusta; para desfazer, basta tirar o <link>.
   ===================================================================== */
:root { --ease-apple: cubic-bezier(.25,.1,.25,1); --ease-sai: cubic-bezier(.16,1,.3,1); }

/* Texto: renderização igual à do macOS/iOS e sem o "flash" cinza no toque */
html { -webkit-tap-highlight-color: transparent; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; font-kerning: normal; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

/* Áreas seguras: iPhone com notch/ilha em paisagem (precisa de viewport-fit=cover) */
.wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* Alvos de toque de 44 pt sem mudar o visual (área invisível em volta) */
.giro-seta, .giro-ponto { position: relative; }
.giro-seta::after { content: ''; position: absolute; inset: -8px; }
.giro-ponto::after { content: ''; position: absolute; inset: -8px 0; }
.marca { min-height: 44px; }
@media (pointer: coarse) {
  .rodape-links { gap: 0 18px; }
  .rodape-links a, .rodape-atalhos { display: inline-flex; align-items: center; min-height: 44px; padding: 0; }
  /* campo com fonte < 16px faz o iPhone dar zoom ao tocar */
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), textarea, select { font-size: max(16px, 1em); }
}

/* Movimento: curvas da Apple (resposta rápida, assentamento suave) */
.bt, .ic-bt, .chip, .seg button, .sel-bt, .aba, .visao button, .seta, .topo-bt, .fechar, .link-av, .giro-seta {
  transition-timing-function: var(--ease-apple); transition-duration: .2s, .2s, .2s, .12s; }
.bt:active, .ic-bt:active, .chip:active, .seg button:active, .aba:active, .seta:active, .topo-bt:active, .giro-seta:active { transform: scale(.96); }

/* Foco visível no estilo do sistema (anel macio, sem cortar cantos) */
:focus-visible { outline: 3px solid color-mix(in srgb, var(--azul) 55%, transparent); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 0; }

@media (prefers-reduced-motion: reduce) {
  .bt:active, .ic-bt:active, .chip:active, .seg button:active, .aba:active, .seta:active, .topo-bt:active, .giro-seta:active { transform: none; }
}

/* Contraste mínimo 4,5:1 no tema claro (selo verde pequeno sobre fundo claro) */
:root[data-tema="claro"] .atalho-tag:not(.giro-ferr .atalho-tag) { color: var(--bom); border-color: var(--bom-borda); }
