/* Halaman ambulans: peta live (index.html) dan pelacak HP (lacak.html) */
:root { --brand: #0f766e; --brand-dark: #0b4f4a; --ink: #12302b; --muted: #5b716c; --line: #dfe8e5; --bg: #f6f9f8;
  --live: #16a34a; --lama: #d97706; --mati: #8aa39e; --merah: #c81e1e; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 system-ui, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
.logo { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: #fff; color: var(--merah); font-weight: 800; font-size: 1.3rem; flex: none; }
.btn { font: inherit; font-weight: 600; border: 0; border-radius: 8px; padding: 9px 16px; cursor: pointer; background: var(--brand); color: #fff; }
.btn.abu { background: #e8efed; color: var(--ink); }
.tt { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--mati); flex: none; }
.tt.live { background: var(--live); box-shadow: 0 0 0 3px rgba(22,163,74,.25); } .tt.lama { background: var(--lama); }

/* ---------- peta live ---------- */
.peta-live { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.atas { display: flex; align-items: center; gap: 16px; padding: 10px 18px; background: var(--brand-dark); color: #fff; flex: none; }
.merek { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; line-height: 1.15; }
.merek small { display: block; color: #bfe3dd; font-size: .78rem; }
.ringkas { margin-left: auto; font-size: .92rem; } .ringkas b { font-size: 1.05rem; }
.kembali { color: #cdeee8; white-space: nowrap; font-size: .9rem; }
.tata { flex: 1; display: grid; grid-template-columns: 1fr 340px; min-height: 0; }
#peta { min-height: 0; background: #dfe8e5; }
.samping { border-left: 1px solid var(--line); background: #fff; overflow-y: auto; padding: 14px; }
.samping-kepala { display: flex; justify-content: space-between; align-items: center; }
.samping h1 { font-size: 1.1rem; margin: 0; }
.cek { font-size: .85rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.legenda { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; color: var(--muted); margin: 8px 0 10px; }
.legenda span { display: flex; align-items: center; gap: 5px; }
.daftar { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.daftar button { width: 100%; display: flex; gap: 10px; align-items: flex-start; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.daftar button:hover:not(:disabled), .daftar button.pilih { border-color: var(--brand); background: #eef8f6; }
.daftar button:disabled { cursor: default; opacity: .75; }
.daftar .tt { margin-top: 5px; }
.daftar b { display: block; } .daftar small { display: block; color: var(--muted); font-size: .8rem; }
.daftar .st { display: inline-block; margin: 3px 0 1px; padding: 1px 8px; border-radius: 99px; background: #e8efed; color: var(--ink); font-weight: 600; }
.st-menuju, .st-membawa { background: #fde2e2 !important; color: #991b1b !important; } .st-perawatan { background: #eee !important; color: #555 !important; }
.daftar .kosong { color: var(--muted); font-size: .9rem; }
.catatan { font-size: .8rem; color: var(--muted); margin: 14px 0 0; }
.amb { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 3px solid var(--mati);
  box-shadow: 0 2px 8px rgba(0,0,0,.35); font-size: 20px; }
.amb.live { border-color: var(--live); } .amb.lama { border-color: var(--lama); } .amb.mati { filter: grayscale(1); opacity: .8; }
.amb.pilih { outline: 3px solid #f5b83d; outline-offset: 2px; }
.amb span { line-height: 1; }
.amb .panah { position: absolute; inset: -12px; pointer-events: none; }
.amb .panah::before { content: ""; position: absolute; left: 50%; top: 0; transform: translateX(-50%); border: 7px solid transparent; border-bottom: 10px solid var(--live); border-top: 0; }
.pop { font-size: 13px; } .pop b { font-size: 14px; }
.pop dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0 8px; } .pop dt { color: var(--muted); } .pop dd { margin: 0; font-weight: 600; }
.pop .tombol { display: block; text-align: center; background: var(--brand); color: #fff !important; text-decoration: none; border-radius: 8px; padding: 7px; font-weight: 600; margin-bottom: 6px; }
.pop .tautan { font-size: 12px; }
@media (max-width: 860px) {
  .peta-live { height: auto; display: block; }
  .tata { display: block; }
  #peta { height: 62vh; }
  .samping { border-left: 0; }
  .atas { flex-wrap: wrap; gap: 6px 14px; }
  .ringkas { order: 3; margin-left: 0; width: 100%; }
}

/* ---------- pelacak HP ---------- */
.lacak-atas { display: flex; align-items: center; gap: 12px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); background: var(--brand-dark); color: #fff; }
.lacak-atas small { display: block; color: #bfe3dd; font-size: .8rem; }
.jaringan { margin-left: auto; font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: #64748b; }
.jaringan.on { background: var(--live); } .jaringan.off { background: var(--merah); }
.lacak-isi { max-width: 520px; margin: 0 auto; padding: 16px; }
.lacak h1 { font-size: 1.15rem; margin: 0 0 8px; } .lacak h2 { font-size: 1rem; margin: 20px 0 8px; }
.kartu { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
#form-token { display: flex; gap: 8px; } #form-token input { flex: 1; font: inherit; padding: 9px 10px; border: 1px solid #c4d3cf; border-radius: 8px; min-width: 0; }
.besar { width: 100%; font: inherit; font-size: 1.3rem; font-weight: 800; padding: 22px; border: 0; border-radius: 16px; cursor: pointer; background: var(--brand); color: #fff;
  box-shadow: 0 4px 14px rgba(15,118,110,.35); }
.besar.aktif { background: var(--merah); box-shadow: 0 4px 14px rgba(200,30,30,.35); }
.pesan { min-height: 1.5em; margin: 10px 2px; font-weight: 600; color: var(--brand-dark); } .pesan.salah { color: var(--merah); }
.angka { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.angka div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.angka b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; } .angka span { font-size: .8rem; color: var(--muted); }
.status { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.status button { font: inherit; font-weight: 600; padding: 14px 8px; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.status button.pilih { border-color: var(--brand); background: #e3f3f0; color: var(--brand-dark); }
.status button:last-child { grid-column: 1 / -1; }
.bantu { margin-top: 20px; } .bantu summary { font-weight: 700; cursor: pointer; } .bantu li { margin: 6px 0; }
