/* DGPS fly · visual de aviação agrícola, pensado primeiro para o celular */
:root {
  --verde: #2f7d32; --verde-esc: #1f5c25; --verde-txt: #1f5c25; --verde-claro: #e4f2e5;
  --ceu: #dff0fb; --bg: #f3f8f2; --card: #ffffff; --txt: #15261b; --sub: #566a5c;
  --line: #d5e2d6; --amarelo: #ffc61a; --amarelo-txt: #2b2100; --azul: #1b6fb0;
  --err: #b3261e; --ok: #1e6b2b; --barra: #1f5c25; --prev-bg: #eef6fb;
  --contorno: #1f5c25; --sombra: 0 2px 10px rgba(20, 60, 30, .10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --verde: #6cc276; --verde-esc: #12301a; --verde-txt: #6cc276; --verde-claro: #1a2d20;
    --ceu: #10232f; --bg: #0d1712; --card: #15221a; --txt: #e9f2ea; --sub: #9db3a2;
    --line: #27392b; --azul: #6db7ea; --err: #ff8a80; --ok: #7bd88a; --barra: #12301a;
    --prev-bg: #0f1c25; --contorno: #ffc61a; --sombra: none;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--txt); font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, var(--ceu) 0, var(--bg) 280px) no-repeat, var(--bg);
  min-height: 100vh;
}
body.sem-rolagem { overflow: hidden; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
      stroke-linecap: round; stroke-linejoin: round; }
a { color: var(--verde-txt); }

/* barra de cima */
.barra {
  position: sticky; top: 0; z-index: 20; background: var(--barra); color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
}
.marca { white-space: nowrap; flex: none; display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.logo { width: 30px; height: 30px; color: var(--amarelo); }
.badge {
  padding: 2px 9px; border-radius: 999px; background: var(--amarelo); color: var(--amarelo-txt);
  font-size: .75rem; font-weight: 800;
}
.conta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.login { font-size: .8rem; opacity: .9; max-width: 30vw; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sair {
  border: 0; border-radius: 999px; min-height: 40px; padding: 0 14px; font: inherit; font-size: .95rem;
  font-weight: 700; color: #fff; background: rgba(255, 255, 255, .16); cursor: pointer;
}

/* conteúdo */
.wrap { max-width: 600px; margin: 0 auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
.tit { font-size: 1.55rem; line-height: 1.2; margin: 8px 0 4px; }
.sub { color: var(--sub); margin: 2px 0 12px; font-size: .95rem; }
.ajuda { color: var(--sub); font-size: .88rem; margin: 6px 0 12px; }
.voltar {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-left: -6px;
  color: var(--verde-txt); text-decoration: none; font-weight: 700;
}
.versao { color: var(--sub); font-size: .8rem; text-align: center; margin: 22px 0 0; }
.rodape { color: var(--sub); font-size: .85rem; text-align: center; margin: 16px 0 0; }
.aviso { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.aviso.erro { color: var(--err); border-color: var(--err); }

/* cartões e passos */
.cartao {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px;
  margin: 14px 0; box-shadow: var(--sombra);
}
.passo { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; margin: 0 0 12px; }
.passo span {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--verde); color: #fff; font-size: .9rem; font-weight: 800; flex: none;
}
@media (prefers-color-scheme: dark) { .passo span { color: #0d1712; } }

/* opções da tela inicial */
.opcao {
  display: flex; align-items: center; gap: 14px; min-height: 104px; margin: 14px 0; padding: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; color: var(--txt);
  text-decoration: none; box-shadow: var(--sombra);
}
.opcao:active { transform: scale(.99); }
.oc-ic {
  display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; flex: none;
  border-radius: 50%; background: var(--verde-claro); color: var(--verde-txt);
}
.oc-ic .ic { width: 32px; height: 32px; }
.oc-tx { flex: 1; min-width: 0; }
.oc-tx strong { display: block; font-size: 1.2rem; margin-bottom: 2px; }
.oc-tx span { color: var(--sub); font-size: .95rem; display: block; }
.opcao .seta { color: var(--sub); }

/* formulário */
label { display: block; margin: 12px 0 6px; font-weight: 700; font-size: .98rem; }
input[type=text], input[type=number], input[type=email], input[type=password] {
  display: block; width: 100%; height: 52px; padding: 0 14px; border: 1.5px solid var(--line);
  border-radius: 12px; background: var(--bg); color: var(--txt); font: inherit; font-weight: 400;
}
input:focus-visible, button:focus-visible, a:focus-visible, .drop:focus-visible {
  outline: 3px solid var(--azul); outline-offset: 2px;
}
.obrig { color: var(--err); font-weight: 800; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px;
  margin-top: 10px; padding: 0 16px; border: 2px solid transparent; border-radius: 14px;
  font: inherit; font-size: 1.05rem; font-weight: 800; text-decoration: none; cursor: pointer;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-amarelo { background: var(--amarelo); color: var(--amarelo-txt); box-shadow: 0 3px 0 rgba(0, 0, 0, .2); }
.btn-sec { background: transparent; color: var(--verde-txt); border-color: var(--verde); }
.btn-verde { background: transparent; color: var(--verde-txt); border-color: var(--verde); }
.btn-perigo { background: transparent; color: var(--err); border-color: var(--err); }
.link { background: none; border: 0; color: var(--verde-txt); font: inherit; font-weight: 700; padding: 8px 4px; cursor: pointer; text-decoration: underline; }

.status { margin: 12px 0 0; min-height: 1.4em; font-size: .98rem; overflow-wrap: anywhere; }
.status.erro { color: var(--err); font-weight: 700; }
.status.ok { color: var(--ok); font-weight: 700; }
.status a { display: inline-block; margin: 6px 12px 0 0; }
.dica { color: var(--sub); font-size: .9rem; margin: 8px 0 0; }

/* escolha de arquivos */
.drop {
  border: 2px dashed var(--verde); background: var(--verde-claro); border-radius: 16px;
  padding: 22px 14px; text-align: center; cursor: pointer; min-height: 120px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.drop .ic { width: 36px; height: 36px; color: var(--verde-txt); }
.drop strong { font-size: 1.05rem; }
.drop .sub { margin: 0; }
.drop.sobre { border-style: solid; background: var(--card); }
.escolhido {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px;
  background: var(--verde-claro); color: var(--txt);
}
.escolhido strong { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lista { list-style: none; margin: 10px 0 0; padding: 0; }
.lista li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px;
  padding: 6px 0; border-bottom: 1px solid var(--line);
}
.lista .nome { overflow-wrap: anywhere; font-size: .95rem; }
.lista .tam { color: var(--sub); font-size: .8rem; margin-left: 6px; white-space: nowrap; }
.lista button {
  flex: none; width: 44px; height: 44px; border: 0; background: none; color: var(--err);
  font-size: 1.5rem; cursor: pointer;
}
.contagem { font-weight: 700; margin: 12px 0 0; }

/* prévia */
.modal {
  position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .55);
  display: flex; align-items: flex-end; justify-content: center;
}
.folha {
  background: var(--card); width: 100%; max-width: 640px; max-height: 94vh; overflow: auto;
  border-radius: 22px 22px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
}
@media (min-width: 700px) { .modal { align-items: center; } .folha { border-radius: 22px; } }
.folha-topo { display: flex; align-items: center; justify-content: space-between; }
.folha-topo h2 { margin: 0; font-size: 1.3rem; }
.fig { margin: 14px 0 0; }
.fig figcaption { font-weight: 800; margin-bottom: 6px; }
.fig figcaption span { font-weight: 400; color: var(--sub); font-size: .9rem; margin-left: 6px; }
.prev-svg { display: block; width: 100%; height: auto; background: var(--prev-bg); border: 1px solid var(--line); border-radius: 12px; }
.p-antes {
  fill: rgba(47, 125, 50, .18); stroke: var(--azul); stroke-width: 1.6px;
  stroke-linejoin: round; vector-effect: non-scaling-stroke;
}
.p-depois {
  fill: rgba(255, 198, 26, .5); stroke: var(--contorno); stroke-width: 2.6px;
  stroke-linejoin: round; vector-effect: non-scaling-stroke;
}
.p-ponte, .p-corte { fill: none; stroke-width: 3.2px; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.p-ponte { stroke: #3aa0ff; }
.p-corte { stroke: #ff4d4d; }
.leg-txt { fill: var(--txt); font-family: sans-serif; }
.leg-fundo { fill: var(--prev-bg); }
.leg-area { fill: rgba(255, 198, 26, .5); stroke: var(--contorno); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.nums { list-style: none; margin: 14px 0 4px; padding: 0; }
.nums li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.nums li span { color: var(--sub); }
.nums li strong { text-align: right; }
.alerta { background: var(--verde-claro); border-radius: 12px; padding: 10px 12px; margin: 10px 0 0; font-size: .95rem; }


/* entrar e cadastro */
.hero { text-align: center; padding: 18px 0 6px; }
.hero-ic { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.hero h1 { margin: 12px 0 2px; font-size: 1.9rem; }
.hero .sub { margin-bottom: 0; }
.entrada-rodape { text-align: center; margin-top: 14px; }

#modal-distantes .folha p { margin: 10px 0 6px; }

/* v13 */
.p-cheio { fill: rgba(255, 112, 40, .75); stroke: none; }
.m-c0 { fill: rgba(176, 92, 255, .6); stroke: #7a2fd0; }
.m-c1 { fill: rgba(0, 179, 164, .6); stroke: #007a70; }
.m-c2 { fill: rgba(255, 138, 31, .6); stroke: #b85f00; }
.m-c3 { fill: rgba(224, 63, 168, .6); stroke: #a0207a; }
.m-c4 { fill: rgba(122, 139, 0, .6); stroke: #566000; }
.m-c0, .m-c1, .m-c2, .m-c3, .m-c4 { stroke-width: 2.6px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.m-num { fill: #000; font-family: sans-serif; font-weight: 800; paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.toque { cursor: zoom-in; }
.leg-lista { list-style: none; margin: 10px 0 4px; padding: 0; }
.leg-lista li { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.sw { width: 22px; height: 14px; border-radius: 4px; border: 2px solid; flex: none; }
.sw-principal { background: rgba(255, 198, 26, .5); border-color: var(--contorno); }
.sw-c0 { background: rgba(176, 92, 255, .6); border-color: #7a2fd0; }
.sw-c1 { background: rgba(0, 179, 164, .6); border-color: #007a70; }
.sw-c2 { background: rgba(255, 138, 31, .6); border-color: #b85f00; }
.sw-c3 { background: rgba(224, 63, 168, .6); border-color: #a0207a; }
.sw-c4 { background: rgba(122, 139, 0, .6); border-color: #566000; }
.folha.cheia { max-height: 100vh; height: 100%; max-width: 100%; border-radius: 0; }
#modal-tela { align-items: stretch; }
#modal-tela .prev-svg { max-height: 70vh; }
.pasta strong { overflow-wrap: anywhere; }

/* v14 */
.p-cheio { fill: #7b2ff7; stroke: #fff; stroke-width: 1.4px; vector-effect: non-scaling-stroke; }
.leg-cheio { stroke-width: 1.5px; }
.m-c0 { fill: rgba(0, 179, 164, .6); stroke: #007a70; }
.m-c1 { fill: rgba(255, 138, 31, .6); stroke: #b85f00; }
.m-c2 { fill: rgba(224, 63, 168, .6); stroke: #a0207a; }
.m-c3 { fill: rgba(122, 139, 0, .6); stroke: #566000; }
.m-c4 { fill: rgba(141, 85, 36, .6); stroke: #5f3a14; }
.sw-c0 { background: rgba(0, 179, 164, .6); border-color: #007a70; }
.sw-c1 { background: rgba(255, 138, 31, .6); border-color: #b85f00; }
.sw-c2 { background: rgba(224, 63, 168, .6); border-color: #a0207a; }
.sw-c3 { background: rgba(122, 139, 0, .6); border-color: #566000; }
.sw-c4 { background: rgba(141, 85, 36, .6); border-color: #5f3a14; }
.p-ponte-opc { fill: none; stroke: #3aa0ff; stroke-width: 3.2px; stroke-dasharray: 10 8; stroke-linecap: butt; vector-effect: non-scaling-stroke; }
.sw-tracejado { width: 22px; height: 0; border-top: 3px dashed #3aa0ff; flex: none; }
.ctl { display: flex; align-items: center; gap: 10px; margin: 4px 0 6px; }
.ctl output { flex: 1; text-align: center; font-size: 1.5rem; font-weight: 800; }
.ctl-bt { width: 56px; height: 56px; border-radius: 14px; border: 2px solid var(--verde); background: transparent; color: var(--verde-txt); font: inherit; font-size: 1.9rem; font-weight: 800; cursor: pointer; }
.ctl-bt:active { background: var(--verde-claro); }
input[type=range] { width: 100%; height: 44px; accent-color: var(--verde); margin: 0; }
.zoom-area { width: 100%; height: 62vh; touch-action: none; background: var(--prev-bg); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; user-select: none; -webkit-user-select: none; }
.zoom-area .prev-svg { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; }
#modal-tela .zoom-area .prev-svg { max-height: none; }
.zoom-bt { display: flex; gap: 8px; margin-top: 10px; }
.btn-z { min-width: 52px; height: 48px; border-radius: 12px; border: 2px solid var(--verde); background: transparent; color: var(--verde-txt); font: inherit; font-size: 1.5rem; font-weight: 800; cursor: pointer; padding: 0 12px; }
.btn-z-tx { font-size: .95rem; flex: 1; }
.zoom-dica { margin: 6px 0 0; }

/* Dividir entre aviões */
.cor { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 8px; vertical-align: -2px; }
.cor-a, .sw-aviaoA { background: #2f7fd0; }
.cor-b, .sw-aviaoB { background: #f08a24; }
.sw-aviaoA, .sw-aviaoB { border-color: rgba(0, 0, 0, .35); }
.sw-divisa { background: #e53935; border-color: #e53935; height: 4px; align-self: center; }
.p-a { fill: rgba(47, 127, 208, .78); stroke: #1b4f8f; stroke-width: 1.2; }
.p-b { fill: rgba(240, 138, 36, .82); stroke: #a85a0c; stroke-width: 1.2; }
.divisa { stroke: #e53935; stroke-width: 4; fill: none; }
.rot-a { fill: #1b4f8f; } .rot-b { fill: #a85a0c; }
.rot-tx { fill: #fff; font-weight: 800; font-family: sans-serif; }
.placar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.placar > div { border-radius: 12px; padding: 10px 12px; border: 2px solid; display: flex; flex-direction: column; min-width: 0; }
.placar strong { font-size: 1.35rem; }
.pl-a { border-color: #2f7fd0; } .pl-b { border-color: #f08a24; }
.sub.ext { display: flex; justify-content: space-between; margin: 2px 0 10px; }
#d-img { margin-top: 4px; }

/* v17 · prévia do Juntar */
.j-c0 { fill: #2f7fd0b3; stroke: #1b4f8f; stroke-width: 1.6px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sw-j0 { background: #2f7fd0b3; border-color: #1b4f8f; }
.j-c1 { fill: #f08a24b3; stroke: #a85a0c; stroke-width: 1.6px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sw-j1 { background: #f08a24b3; border-color: #a85a0c; }
.j-c2 { fill: #2fa84fb3; stroke: #1b6b30; stroke-width: 1.6px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sw-j2 { background: #2fa84fb3; border-color: #1b6b30; }
.j-c3 { fill: #d0453fb3; stroke: #8f1f1a; stroke-width: 1.6px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sw-j3 { background: #d0453fb3; border-color: #8f1f1a; }
.j-c4 { fill: #8e5be0b3; stroke: #5a2fa8; stroke-width: 1.6px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sw-j4 { background: #8e5be0b3; border-color: #5a2fa8; }
.j-c5 { fill: #00a8b5b3; stroke: #006b74; stroke-width: 1.6px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sw-j5 { background: #00a8b5b3; border-color: #006b74; }
.j-c6 { fill: #e0b400b3; stroke: #8a6f00; stroke-width: 1.6px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sw-j6 { background: #e0b400b3; border-color: #8a6f00; }
.j-c7 { fill: #d6409fb3; stroke: #8f1f66; stroke-width: 1.6px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sw-j7 { background: #d6409fb3; border-color: #8f1f66; }
.leg-lista .sub { margin-left: auto; white-space: nowrap; }
.leg-lista li > span:nth-child(2) { overflow-wrap: anywhere; min-width: 0; }
#j-img { margin-top: 6px; }

/* v18 · PWA */
.faixa-aviso { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: var(--verde-esc); color: #fff; font-weight: 700; position: sticky; top: 0; z-index: 20; }
.faixa-aviso[hidden] { display: none; }
.btn-peq { border: 2px solid #fff; background: transparent; color: #fff; font: inherit; font-weight: 800; border-radius: 10px; padding: 8px 14px; min-height: 44px; cursor: pointer; }
