:root {
  --asphalt: #2B2E33;
  --asphalt-raised: #3A3E45;
  --asphalt-line: #50555D;
  --marking: #FFC20E;
  --paper: #F4F4EF;
  --signal: #E4312B;
  --go: #3FA34D;
  --dim: #A3A8AE;
  --ink: #1E2024;

  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --safe-t: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px));
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--asphalt);
  color: var(--paper);
  font: 400 16px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--marking); outline-offset: 2px; }
[hidden] { display: none !important; }

.screen { min-height: 100dvh; }

/* ---------------- Gabung ---------------- */
.join {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  padding: calc(28px + var(--safe-t)) 22px calc(28px + var(--safe-b));
}
.join-road {
  position: fixed;
  inset: 0 auto 0 50%;
  width: 6px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(to bottom, transparent 0 34px, rgba(255,194,14,.10) 34px 74px);
  pointer-events: none;
  z-index: 0;
}
.join > *:not(.join-road) { position: relative; z-index: 1; }

.brand { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 30px; }
.brand-mark { width: 64px; height: 64px; flex: none; margin-top: 2px; border-radius: 15px;
  box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.brand h1 {
  margin: 0;
  font: 700 64px/0.9 var(--display);
  letter-spacing: -0.01em;
}
.brand p { margin: 8px 0 0; color: var(--dim); max-width: 34ch; }

.join-form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; }
.field > span, .field legend { font: 600 19px/1.2 var(--display); color: var(--paper); padding: 0; }
.field small { font: 400 14px var(--body); color: var(--dim); }
.field-row { display: flex; gap: 8px; }
.field input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  background: var(--asphalt-raised);
  border: 2px solid var(--asphalt-line);
  border-radius: 10px;
  font-size: 19px;
}
#room { text-transform: uppercase; font-family: var(--display); font-weight: 600; font-size: 24px; letter-spacing: .06em; }
.field input:focus { border-color: var(--marking); outline: none; }

.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.role-grid label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--asphalt-raised);
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
}
.role-grid input { position: absolute; opacity: 0; pointer-events: none; }
.role-dot {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--role); color: var(--role-ink);
  font: 700 14px var(--display);
}
.role-text { display: grid; line-height: 1.1; }
.role-text span { font: 600 19px/1.1 var(--display); }
.role-text small { font-size: 12.5px; margin-top: 2px; }
.role-grid label:has(input:checked) { border-color: var(--role); background: #43474F; }
.role-grid label:has(input:focus-visible) { outline: 3px solid var(--marking); outline-offset: 2px; }
.build-info { color: var(--dim); font-size: 13px; text-align: center; margin-top: 24px; }

.btn-primary {
  min-height: 64px;
  border: 0;
  border-radius: 12px;
  background: var(--marking);
  color: var(--ink);
  font: 700 26px var(--display);
}
.btn-primary:disabled { opacity: .6; }
.btn-quiet {
  min-height: 54px;
  padding: 0 16px;
  background: transparent;
  border: 2px solid var(--asphalt-line);
  border-radius: 10px;
  font: 600 17px var(--display);
  white-space: nowrap;
}
.btn-danger {
  min-height: 54px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--signal);
  color: #fff;
  font: 600 18px var(--display);
}
.form-error { margin: 0; color: #FF8A80; font-weight: 500; }

.help { margin-top: 30px; border-top: 1px solid var(--asphalt-line); padding-top: 16px; color: var(--dim); }
.help summary { font: 600 19px var(--display); color: var(--paper); cursor: pointer; }
.help ol { padding-left: 20px; }
.help li { margin: 8px 0; }

/* ---------------- Jalan ---------------- */
.ride {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  overflow: hidden;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(8px + var(--safe-t)) 10px 8px;
  background: var(--asphalt);
  border-bottom: 1px solid var(--asphalt-line);
}
.room-chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px;
  background: var(--asphalt-raised); border: 0; border-radius: 22px;
  font: 700 22px var(--display); letter-spacing: .05em;
}
.conn { width: 11px; height: 11px; border-radius: 50%; background: var(--dim); }
.conn[data-s="online"] { background: var(--go); }
.conn[data-s="connecting"], .conn[data-s="offline"] { background: var(--marking); animation: blink 1s steps(2) infinite; }
.conn[data-s="error"] { background: var(--signal); }
.conn-text { flex: 1; min-width: 0; color: var(--dim); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  display: inline-flex; align-items: center; gap: 4px;
  min-width: 48px; min-height: 44px; padding: 0 10px;
  background: var(--asphalt-raised); border: 0; border-radius: 22px;
  font: 600 20px var(--display);
}
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  font: 600 19px/1.15 var(--display);
}
.alert p { margin: 0; flex: 1; }
.alert small { display: block; font: 400 14px var(--body); opacity: .9; }
.alert a, .alert button {
  min-height: 42px; padding: 0 12px; display: inline-flex; align-items: center;
  border-radius: 8px; border: 2px solid currentColor; background: transparent;
  color: inherit; text-decoration: none; font: 600 16px var(--display);
}
.alert-gap { background: var(--marking); color: var(--ink); }
.alert-sos { background: var(--signal); color: #fff; animation: flash 1s ease-in-out infinite alternate; }
.alert-info { background: var(--asphalt-raised); }

.map-wrap { position: relative; min-height: 0; }
.map { position: absolute; inset: 0; background: #1f2226; }
.map.hidden-map { display: grid; place-items: center; color: var(--dim); padding: 20px; text-align: center; }
.map-tools { position: absolute; right: 10px; top: 10px; z-index: 500; display: grid; gap: 8px; }
.map-btn {
  min-height: 42px; padding: 0 14px;
  background: rgba(43,46,51,.92); border: 2px solid var(--asphalt-line); border-radius: 21px;
  font: 600 17px var(--display);
}
.map-btn[aria-pressed="true"] { border-color: var(--marking); color: var(--marking); }

.toasts { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 600; display: grid; gap: 6px; pointer-events: none; }
.toast {
  justify-self: start;
  max-width: 100%;
  padding: 9px 14px;
  background: rgba(20,22,25,.92);
  border-left: 5px solid var(--marking);
  border-radius: 6px;
  font-size: 16px;
  animation: toastIn .18s ease-out;
}
.toast b { font-family: var(--display); font-size: 18px; font-weight: 600; margin-right: 4px; }

.talker {
  display: flex; align-items: center; gap: 10px;
  padding-right: 8px !important;
  min-height: 46px; padding: 0 14px;
  background: var(--asphalt-raised);
  font: 600 21px var(--display);
  color: var(--dim);
}
.talker[data-s="remote"] { color: var(--paper); }
.talker[data-s="me"] { color: var(--go); }
.talker-level { width: 6px; height: 26px; background: var(--asphalt-line); border-radius: 3px; display: flex; align-items: flex-end; overflow: hidden; }
.talker-level i { display: block; width: 100%; height: 0; background: var(--go); transition: height .08s linear; }

.controls {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 84px;
  gap: 10px;
  padding: 10px 10px calc(10px + var(--safe-b));
  background: var(--asphalt);
}
.side-btn {
  position: relative; overflow: hidden;
  display: grid; place-items: center; align-content: center; gap: 4px;
  min-height: 150px;
  background: var(--asphalt-raised); border: 0; border-radius: 14px;
  font: 600 19px var(--display);
  touch-action: manipulation;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.side-btn svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.side-btn span { position: relative; z-index: 1; }
.side-btn.sos { color: #FF8A80; }
.side-btn.sos svg { position: relative; z-index: 1; }
.sos-fill { position: absolute; inset: auto 0 0 0; height: 0; background: var(--signal); }
.side-btn.sos.arming .sos-fill { height: 100%; transition: height 1.5s linear; }
.side-btn.sos.arming, .side-btn.sos.active { color: #fff; }
.side-btn.sos.active { background: var(--signal); }

/* Tombol PTT — satu-satunya elemen yang berteriak */
.ptt {
  position: relative;
  min-height: 150px;
  border: 0;
  border-radius: 14px;
  display: grid; place-content: center; gap: 2px;
  text-align: center;
  touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  transition: background-color .12s, transform .08s;
}
.ptt-label { font: 700 clamp(22px, 7.4vw, 32px)/1 var(--display); letter-spacing: .01em; overflow-wrap: anywhere; }
.ptt-sub { font: 500 15px var(--body); opacity: .8; min-height: 1.2em; }

.ptt[data-state="idle"] {
  background:
    repeating-linear-gradient(-45deg, var(--ink) 0 10px, transparent 10px 20px) left / 14px 100% no-repeat,
    repeating-linear-gradient(-45deg, var(--ink) 0 10px, transparent 10px 20px) right / 14px 100% no-repeat,
    var(--marking);
  color: var(--ink);
}
.ptt[data-state="requesting"] { background: var(--marking); color: var(--ink); opacity: .75; }
.ptt[data-state="talking"] {
  background: var(--go);
  color: #fff;
  transform: scale(.985);
  box-shadow: 0 0 0 4px var(--asphalt), 0 0 0 8px var(--go);
}
.ptt[data-state="busy"] {
  background: repeating-linear-gradient(-45deg, var(--asphalt-raised) 0 14px, #33373D 14px 28px);
  color: var(--paper);
}
.ptt[data-state="offline"], .ptt[data-state="nomic"] { background: var(--asphalt-raised); color: var(--dim); }

/* Marker peta */
.pin-wrap { background: none; border: 0; }
.pin {
  position: relative;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--role, var(--paper)); color: var(--role-ink, var(--ink));
  border: 3px solid var(--asphalt);
  font: 700 15px var(--display);
  box-shadow: 0 1px 4px rgba(0,0,0,.45);
}
.pin b {
  position: absolute; top: 36px; left: 50%; transform: translateX(-50%);
  padding: 0 5px; border-radius: 4px;
  background: rgba(30,32,36,.88); color: var(--paper);
  font: 600 13px/1.4 var(--display); white-space: nowrap;
}
.pin.me { border-color: var(--go); box-shadow: 0 0 0 3px rgba(63,163,77,.45); }
.pin.stale { opacity: .45; }
.pin.talking { box-shadow: 0 0 0 5px var(--go); }
.pin.sos { background: var(--signal); color: #fff; animation: flash .6s infinite alternate; }

/* Sheet dialog */
.sheet {
  width: min(560px, 100vw);
  max-height: 86dvh;
  margin: auto auto 0;
  padding: 0 0 calc(16px + var(--safe-b));
  border: 0;
  border-radius: 18px 18px 0 0;
  background: var(--asphalt);
  color: var(--paper);
}
.sheet::backdrop { background: rgba(0,0,0,.55); }
.sheet header {
  position: sticky; top: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px;
  background: var(--asphalt);
  border-bottom: 1px solid var(--asphalt-line);
}
.sheet h2 { margin: 0; font: 700 30px var(--display); }
.sheet .close { min-height: 44px; padding: 0 14px; background: var(--asphalt-raised); border: 0; border-radius: 22px; font: 600 17px var(--display); }
.sheet-note { margin: 12px 18px 0; color: var(--dim); }

.rider-list { list-style: none; margin: 0; padding: 6px 0; }
.rider-list li button {
  width: 100%;
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 18px;
  background: none; border: 0; text-align: left;
}
.rider-list .pin { width: 36px; height: 36px; }
.rider-name { font: 600 21px/1.1 var(--display); }
.rider-meta { color: var(--dim); font-size: 14px; }
.rider-dist { font: 600 21px var(--display); text-align: right; }
.rider-empty { padding: 20px 18px; color: var(--dim); }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 18px 0; }
.quick-grid button {
  min-height: 78px; padding: 8px;
  background: var(--asphalt-raised); border: 0; border-radius: 12px;
  font: 600 22px/1.1 var(--display);
}
.quick-grid button:active { background: var(--marking); color: var(--ink); }

.settings { display: grid; gap: 18px; padding: 16px 18px; }
.seg { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.seg legend { font: 600 19px var(--display); margin-bottom: 8px; padding: 0; }
.seg label, .switch {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; background: var(--asphalt-raised); border-radius: 10px;
}
.seg input, .switch input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--marking); flex: none; }
.switch span { display: grid; gap: 2px; font-weight: 500; }
.switch small { color: var(--dim); font-size: 14px; }
.range { display: grid; gap: 8px; }
.range input { width: 100%; accent-color: var(--marking); }
.settings-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 18px; }
.settings-actions > * { flex: 1; }

.leaflet-container { font-family: var(--body); background: #1f2226; }
.leaflet-control-attribution { font-size: 10px; }

@keyframes blink { 50% { opacity: .25; } }
@keyframes flash { from { filter: brightness(1); } to { filter: brightness(1.25); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-height: 640px) {
  .ptt, .side-btn { min-height: 112px; }
  .ptt-label { font-size: 27px; }
}
@media (min-width: 720px) {
  .controls { grid-template-columns: 120px minmax(0, 1fr) 120px; max-width: 760px; width: 100%; margin: 0 auto; }
}

/* ---------- v2: mode bicara ---------- */
.talker-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mode-chip {
  flex: none;
  min-height: 36px; padding: 0 12px;
  border: 2px solid var(--asphalt-line); border-radius: 18px;
  background: var(--asphalt);
  font: 600 17px var(--display); color: var(--paper);
}
.mode-chip[data-mode="open"] { border-color: var(--go); color: #8FE39C; }
.mode-chip.locked { opacity: .55; }

.ptt[data-state="open"] {
  background: var(--asphalt-raised);
  color: var(--paper);
  box-shadow: inset 0 0 0 4px var(--go);
}
.ptt[data-state="open-voice"] {
  background: var(--go);
  color: #fff;
  box-shadow: 0 0 0 4px var(--asphalt), 0 0 0 8px var(--go);
}
.ptt[data-state="open-muted"] {
  background: repeating-linear-gradient(-45deg, #4A2B2B 0 14px, #3E2626 14px 28px);
  color: #FFB4AE;
}

/* ---------- v2: rute ---------- */
.route-strip {
  position: absolute; left: 10px; top: 10px; z-index: 550;
  max-width: calc(100% - 150px);
  display: grid; gap: 1px;
  padding: 8px 12px;
  background: rgba(30,111,217,.94); color: #fff;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.route-strip b { font: 600 19px/1.1 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-strip span { font-size: 13px; opacity: .9; }
.route-strip.off { background: rgba(255,194,14,.96); color: var(--ink); }

.edit-bar {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 650;
  padding: 10px;
  background: rgba(43,46,51,.96);
  border: 2px solid #1E6FD9; border-radius: 14px;
}
.edit-bar p { margin: 0 0 8px; font: 600 18px var(--display); }
.edit-actions { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; }
.edit-actions button { min-height: 48px; padding: 0 8px; }
body.route-editing .toasts { bottom: 120px; }
body.route-editing .map { cursor: crosshair; }

.btn-go {
  min-height: 54px; padding: 0 16px;
  border: 0; border-radius: 10px;
  background: #1E6FD9; color: #fff;
  font: 600 18px var(--display);
}
.btn-go:disabled { opacity: .5; }

.wp-wrap { background: none; border: 0; }
.wp {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  border-radius: 8px;
  background: #1E6FD9; color: #fff;
  border: 2px solid #fff;
  font: 700 14px var(--display);
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.wp-start { background: var(--go); }
.wp-finish { background: var(--ink); }
.wp-fuel { background: #E88B00; }
.wp-rest { background: #6B5BD6; }
.wp-meal { background: #C2410C; }
.wp-edit { border-radius: 50%; background: #1E6FD9; }

.route-view { padding-bottom: 8px; }
.route-head { padding: 14px 18px 4px; }
.route-head h3 { margin: 0; font: 700 26px/1.1 var(--display); }
.route-head p { margin: 4px 0 0; }
.route-progress { height: 8px; background: var(--asphalt-raised); border-radius: 4px; overflow: hidden; margin-top: 10px !important; }
.route-progress i { display: block; height: 100%; background: #1E6FD9; }
.warn { color: var(--marking); }
.nav-row { display: flex; gap: 8px; padding: 10px 18px 0; }
.nav-row > :first-child { flex: 1.6; }
.nav-row > * { flex: 1; min-width: 0; }
.stack { display: grid; gap: 8px; padding: 14px 18px 0; }
.sheet-empty { padding: 18px 18px 0; margin: 0; font: 600 20px var(--display); }
.rider-list li.passed { opacity: .5; }
.wp-name { font: 600 19px/1.1 var(--display); }
.switch.inline { margin: 10px 18px 0; }
.pad { padding: 14px 18px 0; }

.search { display: flex; gap: 8px; }
.search input {
  flex: 1; min-width: 0; min-height: 50px; padding: 0 14px;
  background: var(--asphalt-raised); border: 2px solid var(--asphalt-line); border-radius: 10px;
}
.search-results { list-style: none; margin: 0; padding: 4px 0 0; }
.search-results button { width: 100%; text-align: left; padding: 8px 18px; background: none; border: 0; }
.search-results b { font: 600 18px var(--display); }

.wp-list { list-style: none; margin: 0; padding: 8px 18px 0; display: grid; gap: 8px; }
.wp-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  grid-template-areas: "n name tools" "n type tools";
  gap: 6px 10px; align-items: center;
  padding: 10px; background: var(--asphalt-raised); border-radius: 10px;
}
.wp-row .wp { grid-area: n; }
.wp-row input { grid-area: name; min-width: 0; min-height: 40px; padding: 0 10px; background: var(--asphalt); border: 1px solid var(--asphalt-line); border-radius: 8px; }
.wp-row select { grid-area: type; min-height: 38px; padding: 0 8px; background: var(--asphalt); color: var(--paper); border: 1px solid var(--asphalt-line); border-radius: 8px; font: inherit; }
.wp-tools { grid-area: tools; display: grid; grid-template-columns: repeat(3, 38px); gap: 4px; }
.wp-tools button { height: 40px; background: var(--asphalt); border: 1px solid var(--asphalt-line); border-radius: 8px; font-size: 18px; }
.wp-tools button:disabled { opacity: .35; }

.captain-only { display: none; }
body.is-captain .captain-only { display: grid; }
body.native .web-only { display: none; }
.seg legend small, .range small { display: block; font: 400 14px var(--body); color: var(--dim); }
.leaflet-tooltip { font: 600 14px var(--display); }

.ride > * { min-width: 0; }
.topbar > * { flex-shrink: 0; }
.topbar > .conn-text { flex-shrink: 1; }
.nav-row button { white-space: normal; line-height: 1.1; padding: 6px 10px; }

/* ---------- v3: gaya tombol geser ---------- */
.controls { grid-template-areas: "quick ptt sos"; }
#quickBtn { grid-area: quick; }
#ptt { grid-area: ptt; }
#sosBtn { grid-area: sos; }
#sosSlider { grid-area: sos; display: none; }
.slide-thumb { display: none; }

body.ptt-slide .ptt-button-only { display: none; }
body.ptt-slide .controls { grid-template-columns: 1fr 1fr; grid-template-areas: "ptt ptt" "quick sos"; }
body.sos-slide .controls { grid-template-columns: 84px minmax(0, 1fr); grid-template-areas: "quick ptt" "sos sos"; }
body.ptt-slide.sos-slide .controls { grid-template-columns: 118px minmax(0, 1fr); grid-template-areas: "ptt ptt" "quick sos"; }
body.ptt-slide .side-btn { min-height: 64px; grid-auto-flow: column; gap: 8px; padding: 0 8px; }
body.sos-slide #sosBtn { display: none; }
body.sos-slide #sosSlider { display: flex; }
body.sos-slide:not(.ptt-slide) .side-btn { min-height: 150px; }

.slider { --tw: 76px; --p: 0; }
.slider.locked { --p: 1; }
body.ptt-slide #ptt, #sosSlider {
  position: relative; overflow: hidden;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
}
body.ptt-slide #ptt { min-height: 120px; padding-left: calc(var(--tw) + 16px); padding-right: 16px; transform: none; }
body.ptt-slide #ptt .slide-thumb, #sosSlider .slide-thumb {
  display: grid; place-items: center;
  position: absolute; top: 6px; bottom: 6px;
  left: calc(6px + var(--p) * (100% - var(--tw) - 12px));
  width: var(--tw);
  border-radius: 10px;
  background: var(--ink); color: var(--marking);
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  transition: left .22s cubic-bezier(.2,.8,.2,1);
  z-index: 2;
}
.slider.dragging .slide-thumb { transition: none !important; }
body.ptt-slide #ptt .slide-thumb svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
body.ptt-slide #ptt.locked { padding-left: 16px; padding-right: calc(var(--tw) + 16px); }
body.ptt-slide #ptt.locked .slide-thumb svg { transform: rotate(180deg); }
body.ptt-slide #ptt[data-state="talking"] .slide-thumb { color: var(--go); }
body.ptt-slide #ptt[data-state="offline"] .slide-thumb,
body.ptt-slide #ptt[data-state="nomic"] .slide-thumb { color: var(--dim); }

#sosSlider {
  align-items: center; justify-content: center;
  min-height: 64px;
  padding: 0 14px 0 calc(var(--tw) + 14px);
  border-radius: 14px;
  background: linear-gradient(90deg, var(--signal) 0 calc(var(--p) * 100%), var(--asphalt-raised) 0);
  color: #FF8A80;
  font: 600 20px var(--display);
}
#sosSlider .slide-thumb { background: var(--signal); color: #fff; font: 700 18px var(--display); }
#sosSlider .slide-text { position: relative; z-index: 1; text-align: center; }
#sosSlider.active { padding: 0 14px; background: var(--signal); color: #fff; animation: flash .6s infinite alternate; }
#sosSlider.active .slide-thumb { background: #fff; color: var(--signal); }
#sosSlider.active .slide-text { padding-right: calc(var(--tw) + 8px); }
@media (min-width: 720px) {
  body.ptt-slide .controls, body.sos-slide .controls { max-width: 760px; }
}
.seg label small { display: block; font: 400 14px var(--body); color: var(--dim); margin-top: 2px; }

/* ---------- v3: akun & riwayat ---------- */
.account { padding: 12px 14px; background: var(--asphalt-raised); border-radius: 12px; }
.account small { display: block; color: var(--dim); font-size: 13px; margin-top: 6px; }
/* Pilihan masuk: Google & Sign in with Apple (wajib ada untuk App Store) */
.login-row { display: grid; gap: 10px; }
.btn-login, .btn-google {
  width: 100%; min-height: 54px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: #fff; color: #1F1F1F; border: 0; border-radius: 10px;
  font: 600 18px var(--body); cursor: pointer;
}
.btn-login svg, .btn-google svg { width: 22px; height: 22px; flex: none; }
.btn-login--apple { background: #000; color: #fff; }
#accountIn { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
#accountIn[hidden] { display: none; }
#accountIn button { min-height: 44px; padding: 0 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--marking); color: var(--ink); font: 700 16px var(--display); }
.account-name { display: grid; line-height: 1.15; min-width: 0; }
.account-name small { margin: 0; }
.account-name b { font: 600 19px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ride-date { width: 44px; display: grid; justify-items: center; line-height: 1; color: var(--dim); font-size: 13px; text-transform: uppercase; }
.ride-date b { font: 700 24px var(--display); color: var(--paper); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 18px 0; }
.stat-row div { background: var(--asphalt-raised); border-radius: 10px; padding: 10px; display: grid; text-align: center; }
.stat-row b { font: 700 24px var(--display); }
.stat-row span { font-size: 13px; color: var(--dim); }
.history-map { height: 240px; margin: 12px 18px 0; border-radius: 12px; overflow: hidden; background: var(--asphalt-raised); display: grid; place-items: center; color: var(--dim); }
.sub { margin: 16px 18px 6px; font: 600 16px var(--display); color: var(--dim); text-transform: uppercase; letter-spacing: .04em; }
p.sub.pad { padding: 0; }
.plain-list { list-style: none; margin: 0; padding: 0 18px; display: grid; gap: 6px; }
.timeline { max-height: 260px; overflow: auto; }

/* ---------- v3: navigasi rute ---------- */
.route-strip.nav { grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; max-width: calc(100% - 20px); right: auto; }
.route-strip.nav .turn { grid-row: span 2; align-self: center; font: 700 34px/1 var(--display); font-style: normal; }
.route-strip.nav b { white-space: normal; }
.map-wrap:has(.route-strip.nav:not([hidden])) .map-tools { top: 100px !important; }
.route-strip.nav { right: 10px; max-width: none; }
.turn { font-style: normal; display: inline-grid; place-items: center; min-width: 26px; font-weight: 700; }
details.steps { margin: 12px 18px 0; background: var(--asphalt-raised); border-radius: 10px; }
details.steps summary { padding: 12px 14px; font: 600 18px var(--display); cursor: pointer; }
details.steps ol { list-style: none; margin: 0; padding: 0 14px 12px; display: grid; gap: 8px; max-height: 320px; overflow: auto; }
details.steps li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; }
details.steps li.passed { opacity: .45; }
.search-results .result { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 18px; border-bottom: 1px solid var(--asphalt-line); }
.result-actions { display: grid; grid-template-columns: auto auto; gap: 6px; }
.result-actions button { min-height: 44px; padding: 0 10px; border-radius: 8px; border: 2px solid var(--asphalt-line); background: var(--asphalt); font: 600 16px var(--display); }
.result-actions button:first-child { background: #1E6FD9; border-color: #1E6FD9; color: #fff; }
.alt-list { list-style: none; margin: 0; padding: 0 18px; display: grid; gap: 6px; }
.alt-list button { width: 100%; text-align: left; display: grid; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--asphalt-line); background: var(--asphalt-raised); }
.alt-list button.sel { border-color: #1E6FD9; }
.alt-list b { font: 700 20px var(--display); }
.alt-list span { font-size: 14px; color: var(--dim); }
.leaflet-tooltip.alt-tip { background: #5E636C; color: #fff; border: 0; font: 600 13px var(--display); padding: 2px 6px; }
.leaflet-tooltip.alt-tip::before { display: none; }

/* ---------- v3.2: elevasi & kartu perjalanan ---------- */
.elev-box { margin: 12px 18px 0; padding: 12px; background: var(--asphalt-raised); border-radius: 12px; }
.elev-box .sheet-note { padding: 0; margin: 0; }
.elev-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.elev-head b { font: 600 18px var(--display); }
.elev-svg { display: block; width: 100%; height: 120px; }
#elevStats[hidden] { display: none; }

.card-preview { padding: 12px 18px 0; display: grid; place-items: center; }
.card-preview canvas {
  display: block; max-width: 100%; max-height: 52dvh; width: auto; height: auto;
  border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.45); background: #111;
}
.card-actions > * { flex: 1; }
#cardForm { padding-top: 6px; }
#cardForm .field input { width: 100%; }
.seg.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.seg.chips legend { width: 100%; }
.seg.chips label { flex: 0 0 auto; padding: 0; background: none; }
.seg.chips label span {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px;
  border: 2px solid var(--asphalt-line); border-radius: 22px;
  background: var(--asphalt-raised); font: 600 17px var(--display);
}
.seg.chips input { position: absolute; opacity: 0; pointer-events: none; }
.seg.chips input:checked + span { border-color: var(--marking); color: var(--marking); }
.swatch::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--c); border: 1px solid rgba(0,0,0,.4); }
#cardPhotoBtn { width: 100%; min-height: 50px; }

/* ---------- v3.3: kanal crew & peserta ---------- */
.chan-chip[data-ch="crew"] { border-color: #B18CFF; color: #D6C2FF; }
.chan-chip[data-ch="all"] { border-color: var(--marking); color: var(--marking); }
.talker .mode-chip[hidden] { display: none; }
.seg label small { display: block; font: 400 14px var(--body); color: var(--dim); margin-top: 2px; }

/* ---------- v4: keselamatan, absensi, akun ---------- */
.badge { position: absolute; top: 2px; right: 2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--signal); color: #fff; font: 700 13px/20px var(--display); text-align: center; }
.badge[hidden] { display: none; }
#crewBtn { position: relative; }
.seg-tabs .badge { position: static; display: inline-block; margin-left: 4px; }
.event-chip { margin: 0; padding: 4px 14px; background: #3A3151; color: #D6C2FF; font: 600 15px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-chip[hidden] { display: none; }
.account-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.account-links > * { min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; text-decoration: none; }
.account-links [hidden] { display: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--marking); font: inherit; text-decoration: underline; }

.seg-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 12px 18px 0; }
.seg-tabs button { min-height: 46px; border: 2px solid var(--asphalt-line); border-radius: 10px; background: var(--asphalt-raised); font: 600 18px var(--display); }
.seg-tabs button[aria-selected="true"] { border-color: var(--marking); color: var(--marking); }

.cp-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 12px 18px 4px; scrollbar-width: none; }
.cp-tabs button { flex: none; display: inline-flex; gap: 8px; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 20px; border: 2px solid var(--asphalt-line); background: var(--asphalt-raised); font: 600 16px var(--display); }
.cp-tabs button[aria-selected="true"] { border-color: #1E6FD9; background: #1E3A66; }
.cp-tabs b { background: rgba(255,255,255,.12); border-radius: 10px; padding: 0 7px; }
.att-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px 0; }
.att-head p { margin: 0; font: 600 20px var(--display); }
.att-head b { font-size: 34px; color: var(--marking); }
.att-head small { display: block; font: 400 14px var(--body); color: var(--dim); }
.att-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 18px; }
.att-list li + li .att-row { border-top: 1px solid var(--asphalt-line); }
.btn-quiet.small, .btn-go.small { min-height: 40px; padding: 0 12px; font-size: 15px; }
.row-actions { display: flex; gap: 6px; }
.sev { width: 10px; height: 36px; border-radius: 3px; background: var(--marking); }
.sev-2 { background: var(--signal); }

.crash { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; }
.crash::backdrop { background: rgba(120, 10, 8, .92); }
.crash-inner {
  min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 14px; padding: 24px;
  background: repeating-linear-gradient(-45deg, #B3231D 0 28px, #9C1C17 28px 56px); color: #fff; text-align: center;
}
.crash-title { margin: 0; font: 700 clamp(34px, 9vw, 56px)/1 var(--display); }
.crash-count { margin: 0; font: 700 clamp(120px, 38vw, 220px)/.9 var(--display); }
.crash-text { margin: 0; max-width: 32ch; font-size: 18px; }
.crash-ok { width: min(100%, 460px); min-height: 110px; border: 0; border-radius: 22px; background: #fff; color: #1E2024; font: 700 36px var(--display); }
.crash-sos { width: min(100%, 460px); min-height: 60px; border: 3px solid #fff; border-radius: 16px; background: transparent; color: #fff; font: 700 22px var(--display); }

.live-url { margin: 10px 18px 0; padding: 10px 12px; border-radius: 10px; background: var(--asphalt-raised); overflow-x: auto; }
.live-url code { font-size: 14px; color: var(--marking); white-space: nowrap; }
.contact-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 18px; color: inherit; text-decoration: none; }
.wa-pill { padding: 8px 12px; border-radius: 18px; background: #25D366; color: #06270F; font: 700 15px var(--display); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr 90px; gap: 10px; }
.field-grid[hidden], #profileForm .field[hidden] { display: none; }
.contact-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; background: var(--asphalt-raised); border-radius: 10px; }
.contact-edit input { min-height: 44px; padding: 0 10px; background: var(--asphalt); border: 1px solid var(--asphalt-line); border-radius: 8px; }
.contact-edit input:last-child { grid-column: 1 / -1; }
#contactRows { display: grid; gap: 8px; }
@media (max-width: 420px) { .field-grid { grid-template-columns: 1fr 1fr; } }
.rider-list .att-row button, .rider-list .row-actions > * {
  width: auto; display: inline-flex; grid-template-columns: none; justify-content: center; align-items: center;
  padding: 0 12px; min-height: 40px; border: 2px solid var(--asphalt-line); border-radius: 10px; background: var(--asphalt);
  font: 600 15px var(--display); white-space: nowrap;
}
.att-head .btn-quiet { min-height: 44px; padding: 0 12px; font-size: 15px; flex: none; }
.att-head p { min-width: 0; }

.event-chip { display: flex; align-items: center; gap: 8px; }
.event-chip img { width: 22px; height: 22px; border-radius: 5px; background: #fff; object-fit: contain; flex: none; }
.event-chip span { overflow: hidden; text-overflow: ellipsis; }

.badge.inline { position: static; display: inline-block; margin-left: 6px; vertical-align: middle; }
.badge.inline[hidden] { display: none; }
.club-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; }
.club-mini { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; background: #fff; }
.club-mini.ph { display: grid; place-items: center; background: var(--asphalt-raised); color: var(--marking); font: 700 20px var(--display); }
.btn-primary.as-link { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.rider-list .row-actions > a { color: inherit; text-decoration: none; }
.rider-list .row-actions > .btn-go { background: #1E6FD9; border-color: #1E6FD9; color: #fff; }

.notif-btn { position: relative; min-width: 44px; }
.notif-btn .badge { top: -4px; right: -4px; }
.rider-list li.unread { border-left: 4px solid var(--marking); }
.notif-row { display: block; padding: 12px 18px; color: inherit; text-decoration: none; }
.btn-quiet.as-link { display: flex; align-items: center; justify-content: center; text-decoration: none; min-height: 50px; }
#accountIn { grid-template-columns: auto minmax(0, 1fr) auto auto; }
/* baris talker: muat tiga chip di layar sempit */
.talker { flex-wrap: wrap; row-gap: 6px; }
.talker .talker-text { flex: 1 1 100%; }
.talker .mode-chip { font-size: 16px; padding: 0 10px; min-height: 34px; }
@media (min-width: 420px) { .talker .talker-text { flex: 1 1 auto; } }
.talker .mode-chip { white-space: nowrap; }
.chan-card { padding: 4px 0 8px; border-bottom: 1px solid var(--asphalt-line); }
.chan-card:empty { display: none; }
.chan-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 18px; }
.chan-row small { color: var(--dim); }
.chan-card > .btn-quiet { margin: 4px 18px 0; }

.fam-tg:empty { display: none; }
.fam-tg { margin-top: 6px; }
.fam-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.free-tag { margin-left: 6px; padding: 1px 8px; border-radius: 10px; background: #20442A; color: #C9EFD1; font: 600 12px var(--body); vertical-align: middle; }

/* ---------- Peringatan Jalan ---------- */
.report-btn { background: #B3231D !important; color: #fff !important; border-color: #B3231D !important; font-weight: 700; }
.report-body { padding: 8px 18px 18px; display: grid; gap: 12px; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.report-grid button { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 0 12px; border-radius: 14px; border: 2px solid var(--asphalt-line); background: var(--asphalt-raised); color: var(--paper); font: 600 17px var(--display); text-align: left; }
.report-grid button span { font-size: 26px; }
.report-grid button:active { border-color: var(--marking); }
.hz-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px #B3231D, 0 2px 6px rgba(0,0,0,.4); font-size: 17px; }
.hz-icon.cand { box-shadow: 0 0 0 3px #9AA0A6, 0 2px 6px rgba(0,0,0,.4); opacity: .85; }
.hz-pop { display: flex; gap: 6px; margin-top: 6px; }
.hz-pop button { padding: 4px 8px; border-radius: 6px; border: 1px solid #ccc; background: #f4f4f4; font-weight: 600; }
.safety-card { margin: 10px 0; padding: 12px; border-radius: 14px; background: var(--asphalt-raised); border-left: 6px solid #9CCB6B; }
.safety-card.lvl-sedang { border-left-color: var(--marking); }
.safety-card.lvl-tinggi { border-left-color: var(--signal); }
.safety-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.safety-head h4 { margin: 0; font: 700 22px var(--display); text-transform: capitalize; }
.safety-score { width: 70px; height: 70px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: conic-gradient(var(--marking) calc(var(--p) * 1%), rgba(255,255,255,.12) 0); position: relative; }
.lvl-rendah .safety-score { background: conic-gradient(#9CCB6B calc(var(--p) * 1%), rgba(255,255,255,.12) 0); }
.lvl-tinggi .safety-score { background: conic-gradient(var(--signal) calc(var(--p) * 1%), rgba(255,255,255,.12) 0); }
.safety-score::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--asphalt-raised); }
.safety-score b, .safety-score small { position: relative; line-height: 1; }
.safety-score b { font: 700 26px var(--display); }
.safety-score small { font-size: 11px; color: var(--dim); }
.safety-factors, .safety-recs { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.safety-factors li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; }
.safety-factors i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 14px; background: #20442A; color: #C9EFD1; }
.safety-factors .st-warn i { background: #4A3D12; color: #FFE08A; }
.safety-factors .st-bad i { background: #5A1E1B; color: #FFC2BD; }
.safety-factors .st-unknown i { background: #3A3D42; color: var(--dim); }
.safety-factors small { color: var(--dim); }
.safety-card h5 { margin: 12px 0 0; font: 700 16px var(--display); }
.safety-recs li { padding-left: 14px; position: relative; font-size: 15px; }
.safety-recs li::before { content: "›"; position: absolute; left: 0; color: var(--marking); }
.safety-card details { margin-top: 10px; }
.safety-card summary { cursor: pointer; font-weight: 600; }
.wx { list-style: none; padding: 0; margin: 6px 0 0; font-size: 14px; }
.wx li { display: grid; grid-template-columns: 70px 60px 1fr 60px; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--asphalt-line); }
.safety-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; align-items: end; }
.field.compact input { min-height: 40px; }
.sheet-note.small { font-size: 12px; margin-top: 10px; }
/* ---------- Lencana ---------- */
.badge-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 10px 18px; }
.badge-stats div { background: var(--asphalt-raised); border-radius: 10px; padding: 8px; text-align: center; }
.badge-stats b { display: block; font: 700 22px var(--display); color: var(--marking); }
.badge-stats small { color: var(--dim); font-size: 12px; }
.badge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 18px 18px; }
.badge-item { padding: 10px; border-radius: 12px; background: var(--asphalt-raised); border: 2px solid transparent; }
.badge-item.earned { border-color: var(--marking); }
.badge-item b { display: block; font: 700 16px var(--display); }
.badge-item small { color: var(--dim); font-size: 12px; }
.badge-item .bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.1); margin-top: 6px; overflow: hidden; }
.badge-item .bar i { display: block; height: 100%; background: var(--marking); }
.badge-item .medal { float: right; font-size: 20px; }
.badge-group { padding: 8px 18px 4px; color: var(--dim); font: 600 14px var(--display); text-transform: uppercase; letter-spacing: .04em; }

.safety-unknown { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: #3A3D42; color: #FFE08A; font-size: 13px; }

/* ---------- v5.0: data & privasi ---------- */
.privacy-box { margin-top: 18px; }
.privacy-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.privacy-actions .btn-quiet { text-decoration: none; display: inline-flex; align-items: center; }
.identity-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; font-size: 14px; color: var(--dim); }
.identity-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; }
.btn-danger-quiet { margin-top: 10px; min-height: 44px; width: 100%; background: transparent; color: var(--signal); border: 1px solid var(--signal); border-radius: 10px; font: 600 15px var(--body); cursor: pointer; }
.consent-links { padding-left: 18px; }
.consent-links li { margin: 8px 0; }
.muted-sm { color: var(--dim); font-size: 13px; }

/* ---------- v5.0: tiket QR ---------- */
.ticket { text-align: center; }
.ticket-qr { background: #fff; border-radius: 16px; padding: 14px; display: inline-block; line-height: 0; }
.ticket-qr img { width: min(260px, 70vw); height: auto; display: block; }
.ticket-code { margin: 12px 0 2px; font: 700 26px/1 var(--display); letter-spacing: .08em; }
.ticket-event { margin: 10px 0 2px; font: 700 22px/1.15 var(--display); }
.ticket-meta { margin: 2px 0; color: var(--dim); font-size: 15px; }
.ticket-wave { display: inline-block; margin: 12px 0 4px; padding: 7px 14px; border: 2px solid var(--marking); border-radius: 999px; font: 600 15px var(--body); }
.ticket-status { margin: 12px 0 4px; padding: 10px; border-radius: 10px; background: var(--asphalt-raised); font-weight: 600; }
.ticket-status.in { background: rgba(110,231,183,.15); color: #6EE7B7; }
