/* A ficha mantém o desenho A5 no computador/PDF e ganha fluxo vertical no celular. */
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
#toast { visibility: hidden; opacity: 0; pointer-events: none; }
#toast.show { visibility: visible; opacity: 1; }
.toolbar { flex-wrap: wrap; gap: 12px; }
.toolbar-actions { flex-wrap: wrap; }
.toolbar-actions > span { flex-basis: 100%; }
.print-hint { color: var(--muted); font-size: 12px; line-height: 1.5; margin: -5px 0 18px; }
.record > div, .locations-grid > *, .form-grid > *, .topbar > * { min-width: 0; }
.record h3, .record p { overflow-wrap: anywhere; }
.record input.select-dive { width: 22px; height: 22px; }
.record-actions button { width: 44px; height: 44px; }
@media screen and (max-width: 680px) {
  .sidebar { height: calc(72px + env(safe-area-inset-bottom)); padding: 5px 4px calc(5px + env(safe-area-inset-bottom)); }
  .sidebar nav { width: 100%; gap: 2px; }
  .sidebar .nav-item, .sidebar .nav-item:not(.active), .sidebar .nav-item:nth-child(n+6) {
    display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 3px;
    padding: 8px 0; font-size: 9px; text-align: center; line-height: 1.2;
  }
  .sidebar .nav-item span { font-size: 20px; }
  main { padding: 22px 14px calc(100px + env(safe-area-inset-bottom)); }
  .topbar { flex-wrap: wrap; gap: 14px; }
  .top-actions { margin-left: auto; }
  .icon-btn { display: inline-block; min-width: 44px; height: 44px; }
  .primary-btn, .secondary-btn, .close-btn, .round-btn, .text-btn { min-height: 44px; }
  .close-btn { min-width: 44px; }
  .toolbar-actions { gap: 8px; }
  .toolbar-actions button { flex: 1 1 130px; }
  .search input, .dialog-body input, .dialog-body select { font-size: 16px; min-height: 44px; }
  .record { gap: 9px; padding: 12px 10px; grid-template-columns: 24px 42px minmax(0,1fr); }
  .record-actions { grid-column: 3; justify-self: end; }
  .split-head { align-items: stretch; flex-direction: column; gap: 14px; }
  .split-head > button { align-self: flex-start; }
  .agency-strip { flex-wrap: wrap; gap: 7px; }
  .panel { padding: 16px; }
  .map-large { padding: 8px; }
  .hero-copy { padding: 28px 22px; }
  .event-row { gap: 12px; }
  .event-row h3, .event-row p, .location-row b { overflow-wrap: anywhere; }
  dialog { max-height: calc(100dvh - 16px); }
  .sheet-dialog, .standard-dialog { width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow-x: hidden; }
  .dialog-head { padding: 14px; gap: 10px; }
  .dialog-head h2 { font-size: 18px; }
  .dialog-head-actions { gap: 6px; }
  .sheet-dialog .dialog-head, .sheet-dialog .dialog-actions { width: auto; left: auto; }
  .sheet-dialog .dialog-head-actions .secondary-btn { display: inline-flex; align-items: center; padding: 8px; max-width: 100px; font-size: 10px; }
  .dialog-body { padding: 16px; max-height: 65dvh; }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .dialog-actions { flex-wrap: wrap; padding: 12px 14px; gap: 8px; }
  .dialog-actions > span { flex-basis: 100%; }
  .dialog-actions button { flex: 1; }
  .a5-sheet { width: auto; max-width: none; min-height: 0; margin: 12px; padding: 16px; }
  .a5-sheet .paper-title { font-size: 40px; }
  .a5-sheet label, .a5-sheet span, .a5-sheet legend { font-size: 13px; }
  .a5-sheet input, .a5-sheet select, .a5-sheet textarea { font-size: 16px; min-height: 38px; }
  .paper-heading, .paper-upper, .paper-methods, .paper-memories, .paper-bottom { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .paper-heading { gap: 8px; }
  .paper-upper { margin-top: 18px; }
  .a5-sheet .paper-inline { white-space: normal; }
  .profile-top-fields label:last-child { margin-left: 12px; }
  .a5-sheet .profile-stop-row input[type=number] { min-width: 48px; height: 38px; }
  .profile-values { grid-template-columns: 1fr 1fr; gap: 12px; }
  .profile-technical { grid-column: 1 / -1; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .a5-sheet .paper-check { min-height: 40px; margin: 3px 0; font-size: 12px; gap: 8px; }
  .a5-sheet .paper-check input { min-height: 20px; height: 20px; width: 20px; flex-basis: 20px; }
  .paper-methods > div { gap: 8px; }
  .paper-field-pair { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .a5-sheet .paper-methods .paper-inline { font-size: 12px; gap: 8px; }
  .paper-gas-row { grid-template-columns: minmax(0,1fr); gap: 5px; padding: 10px 0; border-top: 1px solid #dce7e6; }
  .a5-sheet .paper-gas-row > span, .a5-sheet .paper-gas-row label { font-size: 12px; }
  .paper-scrubber { flex-wrap: wrap; justify-content: flex-start; }
  .a5-sheet .paper-scrubber span, .a5-sheet .paper-scrubber label { font-size: 12px; }
  .paper-scrubber > span { flex-basis: 100%; }
  .paper-scrubber input { max-width: 60px; }
  .paper-stamp { min-height: 180px; }
  .original-reference { width: auto; margin: 12px; padding: 12px; }
  #toast { right: 12px; left: 12px; bottom: calc(88px + env(safe-area-inset-bottom)); }
}
