:root {
  --green: #0e7a4b;
  --green-dark: #0a5c39;
  --gold: #d9a441;
  --bg: #f2f5f3;
  --card: #ffffff;
  --text: #1c2a24;
  --muted: #5f7268;
  --border: #dfe7e2;
  --danger: #c0392b;
  --focus: #1e6bb8;
  --font-display: "Bricolage Grotesque", "Arial Narrow", sans-serif;
  --font-body: "Schibsted Grotesk", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .25, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  padding-bottom: 30px;
  accent-color: var(--green);
}

/* ---- Browser surfaces: milik design system kita, bukan bawaan ---- */
::selection { background: #cde9db; color: var(--green-dark); }
html { scrollbar-color: #c3d3ca transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c3d3ca; border-radius: 6px; border: 2px solid var(--bg); }
input, textarea { caret-color: var(--green); }
input::placeholder { color: #6f8378; opacity: 1; }   /* tint dari hue hijau, bukan abu netral */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---- Sistem ikon: satu stroke, satu ukuran optis ---- */
svg { width: 18px; height: 18px; fill: none; stroke: currentColor;
      stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.ic-lg { width: 22px; height: 22px; }
.logo { width: 26px; height: 26px; stroke-width: 1.6; }

h1, h2, h3, .brand-name, .fare-total b, .code-box, .stat .n {
  font-family: var(--font-display);
  letter-spacing: -.01em;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--green-dark);
  box-shadow: inset 0 -2px 0 var(--gold);
  color: #fff; padding: 14px 16px; position: sticky; top: 0; z-index: 1000;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-name { font-weight: 800; font-size: 16px; }
.brand-sub { font-size: 12px; opacity: .85; }
.btn-status {
  background: rgba(255,255,255,.18); color:#fff; text-decoration: none;
  padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.btn-status:hover { background: rgba(255,255,255,.28); }

main { max-width: 640px; margin: 0 auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--card); border-radius: 16px; padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ---- Jenis layanan ---- */
.seg { display: flex; gap: 8px; }
.seg-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border: 2px solid var(--border); background: #fff;
  border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--muted);
  cursor: pointer; font-family: inherit; transition: border-color .15s var(--ease), background .15s var(--ease);
}
.seg-btn:hover { border-color: #b9cdc2; }
.seg-btn.active { border-color: var(--green); background: #e8f4ee; color: var(--green-dark); }

/* ---- Hasil biaya (kartu utama) ---- */
.fare-empty {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); font-size: 13.5px; padding: 6px 4px;
}
.fare-empty b { display: block; color: var(--text); font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.fare-empty .ic-lg { color: var(--green); }
.fare-total {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 2px solid var(--green-dark); padding: 2px 2px 10px;
}
.fare-total span { font-size: 13px; font-weight: 600; color: var(--muted); }
.fare-total b { font-size: 38px; font-weight: 800; color: var(--green-dark); line-height: 1; }
.fare-row { display: flex; justify-content: space-between; font-size: 14px; margin: 12px 0 8px; }
.fare-breakdown { border-top: 1px dashed var(--border); padding-top: 10px; margin-bottom: 10px; }
.bd-item { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.fare-note { font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.fare-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; padding: 10px 4px; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid var(--border); border-top-color: var(--green);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.fare-card.pulse { animation: pop .5s var(--ease); }
@keyframes pop { from { transform: scale(.985); opacity: .7; } to { transform: scale(1); opacity: 1; } }

/* ---- Titik jemput / antar ---- */
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.readout {
  background: #f7faf8; border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 12px; font-size: 14px; min-height: 42px;
}
.readout.set { color: var(--text); }
input {
  width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 15px; background: #fff; color: var(--text); margin-bottom: 10px; font-family: inherit;
}
input:hover { border-color: #b9cdc2; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid2 input { margin-bottom: 10px; }
.picker-toggle { display: flex; gap: 8px; flex-wrap: wrap; }
.pick-btn {
  flex: 1; min-width: 96px; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px; border-radius: 10px; border: 2px solid var(--border);
  background: #fff; font-size: 13px; font-weight: 600; color: var(--muted);
  cursor: pointer; font-family: inherit;
}
.pick-btn:hover { border-color: #b9cdc2; }
.pick-btn.active { border-color: var(--gold); background: #fdf6e8; color: #8a6314; }
.pick-btn.ghost { flex: 0 0 auto; }

/* ---- Peta ---- */
#map { height: 300px; border-radius: 12px; overflow: hidden; z-index: 1; }
.map-hint { font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.5; }

/* ---- Titik populer (dilipat) ---- */
.disclosure {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: none; border: none; padding: 2px; font: inherit; cursor: pointer;
  font-weight: 600; font-size: 14px; color: var(--text); font-family: inherit;
}
.disclosure .chev { transition: transform .2s var(--ease); color: var(--muted); }
.disclosure[aria-expanded="true"] .chev { transform: rotate(180deg); }
.spots-panel { margin-top: 12px; }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 12px; top: 13px; color: var(--muted); pointer-events: none; }
.search-wrap input { padding-left: 38px; }
.spot-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 4px 0 10px; padding-bottom: 2px; }
.spot-tab {
  white-space: nowrap; padding: 7px 12px; border-radius: 20px; border: 1px solid var(--border);
  background: #fff; font-size: 12.5px; color: var(--muted); cursor: pointer; font-family: inherit;
}
.spot-tab:hover { border-color: #b9cdc2; }
.spot-tab.active { background: var(--green); color: #fff; border-color: var(--green); font-weight: 600; }
.spot-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 260px; overflow-y: auto; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; padding: 7px 11px; border-radius: 20px; border: 1px solid var(--border);
  background: #fafcfb; color: var(--text); cursor: pointer; font-family: inherit;
  transition: border-color .12s var(--ease), background .12s var(--ease);
}
.chip svg { width: 14px; height: 14px; }
.chip:hover { border-color: #b9cdc2; background: #f2f7f4; }
.chip.sel { background: var(--green); color:#fff; border-color: var(--green); }
.chip.sel svg { stroke: #fff; }
.chip.gps { background: #e8f1fb; border-color: #b8d4f0; color: #1e6bb8; font-weight: 600; }
.chip.approx { border-style: dashed; }
.spot-empty { font-size: 13px; color: var(--muted); padding: 8px 4px; }
.spot-legend { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 10px; }

/* ---- Pesanan ---- */
.order-card h3 { font-size: 16px; margin: 0 0 4px; }
.order-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; line-height: 1.5; }
.btn-primary {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px; border: none; border-radius: 12px; font-size: 15px; font-weight: 700;
  background: var(--green); color: #fff; cursor: pointer; font-family: inherit;
  transition: background .15s var(--ease);
}
.btn-primary:hover:not(:disabled) { background: #0c6a41; }
.btn-primary:disabled { background: #e2e8e4; color: #4f6056; cursor: not-allowed; }
.btn-primary.wa { background: #25D366; }
.btn-primary.wa:hover { background: #1eb85a; }
.order-result { margin-top: 12px; background: #f0f8f3; border-radius: 12px; padding: 12px; font-size: 14px; }
.code-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 20px; font-weight: 700;
  letter-spacing: 2px; color: var(--green-dark); text-align: center; padding: 8px;
}
.wa-link {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  text-align: center; padding: 12px; border-radius: 10px; margin-top: 8px;
  background: #25D366; color: #fff; text-decoration: none; font-weight: 700;
}
.footnote { font-size: 12.5px; color: var(--muted); padding: 0 4px; line-height: 1.5; border-top: 1px solid var(--border); padding-top: 10px; }

/* ---- Status page ---- */
.status-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.status-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; font-weight: 700; }
.status-badge { padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; background: #fdf6e8; color: #8a6314; }
.status-badge.ok { background: #e8f4ee; color: var(--green-dark); }
.status-badge.bad { background: #fdecea; color: var(--danger); }
.status-desc { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.timeline { border-left: 2px solid var(--border); margin-left: 6px; padding-left: 16px; margin-bottom: 14px; }
.tl-item { position: relative; padding-bottom: 14px; font-size: 13px; }
.tl-item::before {
  content: ''; position: absolute; left: -22px; top: 3px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--border);
}
.tl-item.done::before { background: var(--green); }
.tl-item .tl-time { font-size: 12px; color: var(--muted); }
.detail-list { border-top: 1px dashed var(--border); padding-top: 10px; }
.dl-item { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; }
.dl-item span { color: var(--muted); }
.error-msg { display: flex; align-items: center; gap: 8px; justify-content: center;
  background: #fdecea; color: var(--danger); padding: 12px; border-radius: 10px; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (max-width: 360px) {
  .fare-total b { font-size: 32px; }
  .pick-btn { font-size: 12.5px; }
}
