/* =========================================================
   TRAILNAV — tema gelap, responsif (mobile ⇄ desktop)
   ========================================================= */
:root {
  --bg: #0e1311;
  --surface: #161d1a;
  --surface-2: #1e2723;
  --surface-3: #26312c;
  --line: #2b3631;
  --text: #e9f0ec;
  --muted: #8d9a93;
  --green: #2e9e4f;
  --green-2: #3ccf6a;
  --green-soft: #1b3424;
  --orange: #f08a24;
  --red: #e5484d;
  --blue: #2f8fff;
  --yellow: #eab308;
  --radius: 16px;
  --nav-h: 64px;
  --sb: env(safe-area-inset-bottom, 0px);
  --st: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--green-2); }
small, .small { font-size: 12.5px; }
.muted { color: var(--muted); }
.accent { color: var(--blue); }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.ico { flex: none; display: block; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; }

/* ---------- Shell & navigasi ---------- */
.shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.view { flex: 1; min-height: 0; overflow: auto; position: relative; }
.view-inner { height: 100%; }

.nav {
  order: 2; flex: none;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--nav-h) + var(--sb)); padding-bottom: var(--sb);
  background: var(--surface); border-top: 1px solid var(--line);
  z-index: 50;
}
.nav .brand { display: none; }
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600;
}
.nav a.active { color: var(--green-2); }
.nav a.primary .ico-wrap {
  width: 48px; height: 48px; margin-top: -18px; border-radius: 50%;
  display: grid; place-items: center; background: var(--green); color: #fff;
  box-shadow: 0 6px 18px rgba(46, 158, 79, .45), 0 0 0 5px var(--bg);
}
.nav-live { display: none; }

@media (max-width: 899px) {
  body.immersive .nav { display: none; }
}
@media (min-width: 900px) {
  .shell { flex-direction: row; }
  .nav {
    order: 0; flex-direction: column; justify-content: flex-start; gap: 4px;
    width: 232px; height: auto; padding: 20px 12px;
    border-top: 0; border-right: 1px solid var(--line);
  }
  .nav .brand {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 12px 22px; font-weight: 800; font-size: 19px; letter-spacing: .12em; color: var(--green-2);
  }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 14px; border-radius: 12px; font-size: 15px; }
  .nav a:hover { background: var(--surface-2); color: var(--text); }
  .nav a.active { background: var(--green-soft); }
  .nav a.primary .ico-wrap { width: auto; height: auto; margin: 0; background: none; box-shadow: none; color: inherit; }
  .nav a.primary { background: var(--green); color: #fff; margin: 8px 0; }
  .nav a.primary:hover { background: var(--green); filter: brightness(1.1); }
  .nav-live:not([hidden]) {
    display: block; margin-top: auto; padding: 12px 14px; border-radius: 12px;
    background: var(--surface-2); color: var(--text); text-decoration: none; font-size: 13px;
  }
}

/* ---------- Halaman ---------- */
.page { max-width: 760px; margin: 0 auto; padding: calc(16px + var(--st)) 16px 32px; }
.page.wide { max-width: 1180px; }
.page.narrow { max-width: 520px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.page-head .brand-m { font-weight: 800; font-size: 20px; letter-spacing: .14em; color: var(--green-2); }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.card .sec-head:first-child { margin-top: 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-col { display: flex; flex-direction: column; gap: 8px; }
.stack > * + * { margin-top: 14px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.flat { background: var(--surface-2); border-color: transparent; }

.home-grid, .coach-grid, .summary-grid { display: grid; gap: 16px; }
@media (min-width: 900px) {
  .home-grid { grid-template-columns: 1.15fr 1fr; align-items: start; }
  .coach-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .summary-grid { grid-template-columns: 1.3fr 1fr; align-items: start; }
  .span-2 { grid-column: span 2; }
}
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border: 0; border-radius: 12px;
  background: var(--surface-3); color: var(--text); font-weight: 600; text-decoration: none;
  cursor: pointer; transition: filter .15s, transform .06s; user-select: none;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn-primary, .btn-green { background: var(--green); color: #fff; }
.btn-soft { background: var(--green-soft); color: #c6f0d2; }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-orange { background: var(--orange); color: #1c1105; }
.btn-red { background: var(--red); color: #fff; }
.btn-lg { min-height: 52px; font-size: 16px; }
.btn-xl { min-height: 60px; font-size: 18px; font-weight: 800; letter-spacing: .06em; border-radius: 14px; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.danger { color: #ff8e91; }
.btn-ghost.danger { border-color: #4a2a2b; }

.icon-btn {
  flex: none; width: 42px; height: 42px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text); cursor: pointer; text-decoration: none;
}
.icon-btn.solid { background: rgba(14, 19, 17, .88); backdrop-filter: blur(6px); }
.link { color: var(--green-2); font-weight: 600; text-decoration: none; font-size: 13.5px; }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 600; }
.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); outline: none;
}
.input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(46, 158, 79, .25); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.seg { display: flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--surface-2); margin-bottom: 12px; }
.seg button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer;
}
.seg button.on, .seg .seg-link.on { background: var(--green); color: #fff; }
.seg .seg-link {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; border-radius: 10px; color: var(--muted); font-weight: 600; text-decoration: none; font-size: 14px;
}
.day .mark.plan { background: #a78bfa; }
textarea.input { min-height: 80px; resize: vertical; }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-grid .btn { flex-direction: column; gap: 6px; min-height: 76px; font-size: 13px; text-align: center; padding: 10px 6px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--muted); }
.cmp-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; }
.cmp-row:first-of-type { border-top: 0; }
.cmp-ok { color: var(--green-2); } .cmp-no { color: var(--orange); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font-size: 13px; cursor: pointer;
}
.chip.on { border-color: var(--green); background: var(--green-soft); color: #c6f0d2; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 6px 0 4px; }
.scale button {
  min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-weight: 700;
}
.scale button.on { background: var(--green); border-color: var(--green); color: #fff; }
.scale-labels { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 12px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; cursor: pointer; }
.switch input { width: 44px; height: 26px; appearance: none; border-radius: 99px; background: var(--surface-3); position: relative; cursor: pointer; flex: none; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked { background: var(--green); }
.switch input:checked::after { transform: translateX(18px); }

/* ---------- List ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: inherit; text-decoration: none;
}
a.list-item:hover, .list-item.clickable:hover { background: var(--surface-2); }
.li-icon { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--green); color: #fff; }
.li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.li-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-main small { color: var(--muted); }
.thumb { flex: none; border-radius: 8px; }
.empty { padding: 22px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; }

/* ---------- Statistik ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.stat-box { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.stat-box small { display: block; color: var(--muted); }
.stat-box b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .stat-grid.four { grid-template-columns: repeat(4, 1fr); } }
.progress { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 8px 0; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: var(--green-2); transition: width .3s; }
.progress.blue > i { background: linear-gradient(90deg, #2563eb, var(--blue)); }
.progress.orange > i { background: var(--orange); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; background: var(--surface-2); }
.pill.good { background: #173a24; color: #7ee2a0; }
.pill.mid { background: #3a3114; color: #f5d060; }
.pill.low { background: #3e1d1e; color: #ff9a9c; }

.chart { position: relative; height: 180px; margin-top: 8px; }

/* ---------- Beranda ---------- */
.quick { display: flex; flex-direction: column; gap: 10px; }
.quick .btn { justify-content: center; }
.banner {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 16px;
  border-radius: 14px; background: linear-gradient(90deg, #1d4d2d, #183a26); color: #fff; text-decoration: none; font-weight: 600;
}
.banner .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green-2); box-shadow: 0 0 0 0 rgba(60, 207, 106, .7); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(60, 207, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(60, 207, 106, 0); } }
.today-session { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.week-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.week-stats div { text-align: center; background: var(--surface-2); border-radius: 12px; padding: 10px 4px; }
.week-stats b { display: block; font-size: 17px; }
.week-stats small { color: var(--muted); }

/* ---------- Onboarding ---------- */
.onboard { min-height: 100%; display: flex; flex-direction: column; }
.onboard-head { text-align: center; margin: 24px 0 22px; }
.onboard-head .logo { font-weight: 800; letter-spacing: .16em; color: var(--green-2); margin-bottom: 18px; }
.onboard-head h1 { font-size: 26px; margin-bottom: 6px; }
.goal-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.goal {
  display: flex; align-items: center; gap: 14px; padding: 14px; text-align: left;
  border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer;
}
.goal small { display: block; color: var(--muted); }
.goal.selected { border-color: var(--green); background: var(--green-soft); }
.goal-ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); }
.goal.selected .goal-ico { background: var(--green); color: #fff; }
.steps { display: flex; justify-content: center; gap: 6px; margin-bottom: 8px; }
.steps i { width: 26px; height: 4px; border-radius: 4px; background: var(--surface-3); }
.steps i.on { background: var(--green-2); }
.onboard .actions { margin-top: auto; padding-top: 16px; }

/* ---------- Peta ---------- */
.map-layout { height: 100%; display: flex; flex-direction: column; }
.map-wrap { position: relative; flex: 1; min-height: 260px; }
.map { position: absolute; inset: 0; z-index: 0; background: #d9e2dc; }
.map-top { position: absolute; top: calc(12px + var(--st)); left: 12px; right: 12px; z-index: 5; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.map-top > * { pointer-events: auto; }
.map-fabs { position: absolute; right: 12px; bottom: 28px; z-index: 5; display: flex; flex-direction: column; gap: 10px; }
.fab {
  width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(14, 19, 17, .9); color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
}
.fab.on { background: var(--blue); }
.map-hint {
  position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 5;
  padding: 8px 14px; border-radius: 99px; background: rgba(14, 19, 17, .85); font-size: 13px; white-space: nowrap; pointer-events: none;
}
.panel {
  position: relative; z-index: 6; flex: none; max-height: 52%; overflow: auto;
  margin-top: -18px; padding: 14px 16px calc(16px + var(--sb));
  background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .35);
}
.handle { width: 40px; height: 4px; border-radius: 4px; background: var(--surface-3); margin: 0 auto 12px; }
.panel-head { display: flex; align-items: flex-start; gap: 10px; }
.tool-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.tool-row .btn { padding: 6px 4px; font-size: 12px; flex-direction: column; gap: 2px; min-height: 52px; }
@media (min-width: 900px) {
  .map-layout { flex-direction: row; }
  .panel { width: 390px; max-height: none; margin: 0; border-radius: 0; border-left: 1px solid var(--line); box-shadow: none; padding-top: 22px; }
  .panel .handle { display: none; }
  .map-hint { bottom: 22px; }
}

.search { flex: 1; display: flex; gap: 6px; max-width: 420px; }
.search .input { background: rgba(14, 19, 17, .9); backdrop-filter: blur(6px); }
.search-results { position: absolute; top: 52px; left: 0; width: min(420px, 100%); background: var(--surface); border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.search-results button { display: block; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; font-size: 13.5px; }
.search-results button:hover { background: var(--surface-2); }

/* Marker Leaflet */
.user-dot span { display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 0 0 7px rgba(47, 143, 255, .25), 0 2px 6px rgba(0, 0, 0, .4); }
/* Tanda (POI) */
.poi-icon { background: none; border: 0; }
.poi { position: relative; width: 30px; height: 30px; }
.poi span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .45); font-size: 15px; line-height: 1; }
.poi b { position: absolute; left: 33px; top: 5px; padding: 2px 7px; border-radius: 8px; background: rgba(14, 19, 17, .88); color: #fff; font-size: 11.5px; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.poi-palette .chip { font-size: 12.5px; min-height: 32px; padding: 5px 10px; }
.poi-badge { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--c); font-size: 16px; }
.poi-row .ico { color: var(--muted); }
.placing-bar { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 99px; background: rgba(14, 19, 17, .92); font-size: 13.5px; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
.gps-pill { color: inherit; text-decoration: none; }
/* Dialog & ajakan pasang aplikasi */
.install-modal { width: min(560px, 100%); }
.install-modal h3 { margin: 0; font-size: 20px; }
.install-modal .modal-body { margin: 10px 0 0; }
.install-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 12px; }
.install-tabs button { padding: 9px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 13.5px; cursor: pointer; }
.install-tabs button.on { background: var(--green); border-color: var(--green); color: #fff; }
.install-steps { list-style: none; counter-reset: s; margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.install-steps li { counter-increment: s; position: relative; padding: 6px 0 6px 36px; color: var(--text); line-height: 1.5; }
.install-steps li::before { content: counter(s); position: absolute; left: 0; top: 6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 800; }
.install-ok { margin-top: 10px; color: var(--green-2); font-weight: 700; }
.install-nudge { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; margin-bottom: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--green-soft); }
@media (max-width: 480px) { #install-btn { display: none; } }
.detour-box { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #3a2412; color: #ffd7a8; }
.detour-box .btn { margin-top: 8px; }
.line-popup .leaflet-popup-content { margin: 8px; }
.line-menu { display: flex; flex-direction: column; gap: 6px; min-width: 210px; }
.line-menu button { text-align: left; padding: 9px 10px; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--text); font-weight: 600; cursor: pointer; }
.line-menu button:hover { background: var(--surface-3); }
.line-menu small { color: var(--muted); line-height: 1.35; }
.leaflet-interactive.route-hit { cursor: grab; }
.leaflet-interactive.route-hit:active { cursor: grabbing; }
.gps-warn { position: absolute; top: calc(64px + var(--st)); left: 12px; right: 12px; z-index: 5; padding: 9px 12px; border-radius: 12px; background: rgba(58, 36, 18, .95); color: #ffd7a8; font-size: 13px; font-weight: 600; text-decoration: none; box-shadow: 0 4px 12px rgba(0, 0, 0, .35); }
.next-poi { margin: -4px 2px 12px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; font-weight: 600; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); }
.snap-box { margin: 12px 0 2px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.snap-box .seg { background: var(--surface); }
.snap-box .seg button { font-size: 13px; min-height: 36px; }
.spinner { display: inline-block; width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.user-dot.coarse span { background: #8da9c9; box-shadow: 0 0 0 7px rgba(141, 169, 201, .25), 0 2px 6px rgba(0, 0, 0, .4); }
.pin span { display: block; width: 100%; height: 100%; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .45); }
.pin-start span { background: var(--green); }
.pin-end span { background: var(--red); }
.pin-mid span { background: var(--blue); border-width: 2px; }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { background: rgba(14, 19, 17, .75) !important; color: #b8c4bd !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: #d0e8d8 !important; }
.leaflet-control-layers { background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--line) !important; border-radius: 12px !important; }
.leaflet-control-layers-toggle { width: 40px !important; height: 40px !important; background-size: 22px !important; filter: invert(1) brightness(1.4); }
.leaflet-control-layers-expanded { padding: 10px 14px !important; font-size: 14px; }
.leaflet-control-layers label { margin: 4px 0; cursor: pointer; }
.leaflet-bar a { background: var(--surface) !important; color: var(--text) !important; border-color: var(--line) !important; }

/* ---------- Pelacakan aktif ---------- */
.track { height: 100%; display: flex; flex-direction: column; background: var(--bg); }
.track .map-wrap { flex: 1; }
.track-panel {
  position: relative; z-index: 6; flex: none;
  margin-top: -22px; padding: 12px 16px calc(16px + var(--sb));
  background: var(--bg); border-radius: 24px 24px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .4);
}
.title-pill { flex: 1; text-align: center; font-weight: 700; padding: 9px 12px; border-radius: 99px; background: rgba(14, 19, 17, .88); backdrop-filter: blur(6px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gps-pill { padding: 9px 12px; border-radius: 99px; font-size: 12px; font-weight: 700; background: rgba(14, 19, 17, .88); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.gps-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.gps-pill.good::before { background: var(--green-2); }
.gps-pill.mid::before { background: var(--yellow); }
.gps-pill.bad::before { background: var(--red); }
.offroute { position: absolute; top: calc(66px + var(--st)); left: 50%; transform: translateX(-50%); z-index: 5; padding: 8px 14px; border-radius: 99px; background: var(--red); color: #fff; font-weight: 700; font-size: 13px; }
.paused-tag { position: absolute; top: calc(66px + var(--st)); left: 50%; transform: translateX(-50%); z-index: 5; padding: 6px 14px; border-radius: 99px; background: var(--orange); color: #1c1105; font-weight: 800; letter-spacing: .1em; font-size: 12px; }

.big-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin-bottom: 12px; }
.bstat small { display: block; color: var(--muted); font-size: 13px; }
.bstat b { display: block; font-size: clamp(22px, 7vw, 34px); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.bstat b i { font-style: normal; font-size: 13px; font-weight: 600; color: var(--muted); }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.mstat { padding: 12px; }
.mstat small { display: flex; align-items: center; gap: 5px; color: var(--muted); }
.mstat b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; margin: 2px 0; }
.mstat .muted { font-size: 11.5px; }
.mstat.clickable { cursor: pointer; }
.zone-bar { position: relative; height: 6px; border-radius: 6px; margin: 6px 0 5px; background: linear-gradient(90deg, #3b82f6 0 20%, #22c55e 20% 40%, #eab308 40% 60%, #f97316 60% 80%, #ef4444 80%); }
.zone-bar i { position: absolute; top: -4px; left: var(--x, -10px); width: 4px; height: 14px; border-radius: 2px; background: #fff; box-shadow: 0 0 4px rgba(0, 0, 0, .6); transition: left .4s; }
.extra-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); margin: 4px 2px 12px; }
.extra-row span { display: inline-flex; align-items: center; gap: 5px; }
.extra-row b { color: var(--text); }
.target-row { padding: 10px 12px; margin-bottom: 10px; border-radius: 12px; background: var(--surface-2); }
.target-row .progress { margin: 6px 0 4px; height: 8px; }
.assist { text-align: center; margin: 10px 0 0; }
.countdown {
  position: absolute; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(14, 19, 17, .88); backdrop-filter: blur(4px);
}
.countdown b { font-size: 120px; line-height: 1; font-weight: 800; color: var(--green-2); animation: pop 1s infinite; }
.countdown small { color: var(--muted); font-size: 16px; }
@keyframes pop { 0% { transform: scale(1.25); opacity: .4; } 30% { transform: scale(1); opacity: 1; } }
.track { position: relative; }
.ctrl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.panel-title { margin-bottom: 12px; }
@media (min-width: 900px) {
  .track { flex-direction: row; }
  .track-panel { width: 430px; margin: 0; border-radius: 0; box-shadow: none; border-left: 1px solid var(--line); overflow: auto; display: flex; flex-direction: column; justify-content: center; padding: 24px; }
  .track-panel .handle { display: none; }
  .bstat b { font-size: 32px; }
}

/* ---------- Ringkasan aktivitas ---------- */
.map-card { padding: 0; overflow: hidden; height: 300px; position: relative; }
@media (min-width: 900px) { .map-card { height: 380px; } }
.kcal-card { display: flex; align-items: center; gap: 14px; }
.kcal-card .flame { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: #3a2412; color: var(--orange); flex: none; }
.kcal-card b { font-size: 20px; }
.splits { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.splits th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 4px; font-size: 12.5px; }
.splits td { padding: 7px 4px; border-top: 1px solid var(--line); }
.splits .bar { height: 8px; border-radius: 8px; background: var(--blue); min-width: 4px; }
.food-form { display: grid; grid-template-columns: 1fr 80px 84px auto; gap: 6px; margin-top: 10px; }
.food-form .input { min-height: 38px; padding: 7px 10px; font-size: 13.5px; }
@media (max-width: 480px) { .food-form { grid-template-columns: 1fr 1fr; } .food-form .input:first-child { grid-column: span 2; } }
.food-list { list-style: none; padding: 0; margin: 10px 0 0; }
.food-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.food-list button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; }
.advice { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; }

/* ---------- Coach ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 4px 0 14px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; border-radius: 12px; border: 1px solid transparent; background: var(--surface-2); cursor: pointer; }
.day small { color: var(--muted); font-size: 11.5px; }
.day b { font-size: 15px; }
.day .mark { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.day .mark.cardio { background: var(--blue); }
.day .mark.home { background: var(--orange); }
.day .mark.rest { background: var(--muted); }
.day .mark.done { background: var(--green-2); }
.day.today { border-color: var(--green); }
.day.sel { background: var(--green); }
.day.sel small { color: #e0ffe9; }
.session { display: flex; gap: 12px; align-items: flex-start; }
.session .li-icon.home { background: var(--orange); }
.session .li-icon.rest { background: var(--surface-3); }
.ex-list { margin: 10px 0 0; padding-left: 18px; color: #cfd9d3; font-size: 14px; }
.ex-list li { margin: 3px 0; }
.ring { position: relative; width: 96px; height: 96px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; }
.done-badge { display: inline-flex; align-items: center; gap: 6px; color: var(--green-2); font-weight: 700; }

/* ---------- Modal & toast ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: end center; padding: 16px; background: rgba(0, 0, 0, .55); animation: fade .15s; }
@media (min-width: 600px) { .modal-backdrop { place-items: center; } }
.modal { width: min(440px, 100%); padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); margin-bottom: var(--sb); animation: rise .18s; }
.modal h3 { font-size: 18px; margin-bottom: 8px; }
.modal-body { color: #cdd8d2; margin-bottom: 18px; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--sb) + 14px); z-index: 3000;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .25s;
  max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 12px; background: #f1f6f3; color: #0e1311; font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.immersive .toast { bottom: 50%; }
@media (min-width: 900px) { .toast { bottom: 24px; } body.immersive .toast { bottom: 24px; } }

.dropzone::after {
  content: "Lepaskan file GPX untuk mengimpor"; position: fixed; inset: 12px; z-index: 4000;
  display: grid; place-items: center; border: 3px dashed var(--green-2); border-radius: 20px;
  background: rgba(14, 19, 17, .85); color: var(--green-2); font-size: 20px; font-weight: 700;
}
