/* RunTracker (Setapak) — plain CSS (tanpa @apply/@tailwind).
   Palet & layout mengikuti mockup di /assets/setapak (cream + oranye, kartu putih). */

/* Token sama persis dengan .stpk di front-page.php/blog.php — biar app & landing page satu identitas. */
:root {
  --rtk-bg: #f7f3ee;
  --rtk-card: #ffffff;
  --rtk-ink: #1c1a17;
  --rtk-muted: #7a746c;
  --rtk-faint: #9c958c;
  --rtk-line: #ece6dd;
  --rtk-accent: #f5502e;
  --rtk-accent-deep: #d13c1d;
  --rtk-accent-soft: #ffe9e2;
  --rtk-teal: #0e8b7a;
  --rtk-amber: #E3BA5E;
  --rtk-track: #ece6dd;
  --rtk-danger: #EF4444;
  --rtk-shadow: 0 8px 24px rgba(28,26,23,0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --rtk-bg: #141210;
    --rtk-card: #1d1a17;
    --rtk-ink: #f6f1ea;
    --rtk-muted: #9c948b;
    --rtk-faint: #736c65;
    --rtk-line: #2f2a26;
    --rtk-accent: #ff6f4a;
    --rtk-accent-deep: #f5502e;
    --rtk-accent-soft: #3b211a;
    --rtk-teal: #2fbaa4;
    --rtk-track: #2f2a26;
    --rtk-shadow: 0 8px 24px rgba(0,0,0,0.3);
  }
}

@keyframes rtk-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes rtk-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes rtk-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.rtk-app {
  max-width: 28rem;
  margin: 0 auto;
  background: var(--rtk-bg);
  color: var(--rtk-ink);
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "DM Sans", "Segoe UI", sans-serif;
  position: relative;
}
/* Reset warisan tipografi global tema — style.css (export page-builder utk section lain) punya
   rule bare-tag hardcoded hitam: h1-h6/p/span/b/i/li/strong{color:#000}. Itu bocor ke app karena
   satu dokumen wp_head() yang sama, dan rule eksplisit di elemen selalu menang atas warisan induk,
   jadi teks/ikon selalu hitam walau --rtk-ink sudah benar. Daftar tag di sini = persis semua
   bare-tag color rule di style.css (cek ulang kalau tema global nambah lagi ke depannya).
   Taruh reset ini SEBELUM rule komponen lain (mis. .rtk-tabbar button, .rtk-card h4) biar
   urutan-sumber tetap membiarkan mereka menang balik dengan warna yang benar. */
.rtk-app h1, .rtk-app h2, .rtk-app h3, .rtk-app h4, .rtk-app h5, .rtk-app h6,
.rtk-app p, .rtk-app b, .rtk-app strong, .rtk-app span, .rtk-app i, .rtk-app li {
  color: inherit;
  font-family: inherit;
}

.rtk-main { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }

/* Atribut hidden HARUS menang atas display:flex/grid kelas komponen (.rtk-act-sheet, .rtk-gps-pill, .rtk-watch-live, …).
   Sebelumnya ini kebetulan beres karena preflight Tailwind tema ([hidden]{display:none}) kebetulan dimuat SETELAH app.css;
   di sini dibuat eksplisit biar tidak bergantung pada urutan enqueue tema. */
.rtk-app [hidden] { display: none !important; }

/* ---- Screen transitions ---- */
.rtk-screen { display: none; animation: rtk-fade 0.25s ease; }
.rtk-screen.active { display: block; }

/* ---- Offline badge (pengganti topbar lama) ---- */
.rtk-net-badge {
  display: none;
  align-items: center;
  gap: 6px;
  position: sticky;
  top: 8px;
  margin: 8px 16px 0;
  z-index: 20;
  width: fit-content;
  background: var(--rtk-danger);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
}
.rtk-net-badge.offline { display: flex; }

/* ---- Buttons (dipakai lintas layar) ---- */
.rtk-btn {
  background: var(--rtk-accent);
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  padding: 14px 20px;
  min-height: 48px;
  min-width: 44px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  transition: opacity 0.2s, transform 0.1s;
}
.rtk-btn:active { transform: scale(0.97); }
.rtk-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.rtk-btn.ghost {
  background: var(--rtk-card);
  border: 1px solid var(--rtk-line);
  color: var(--rtk-ink);
}
.rtk-btn.warn { background: var(--rtk-amber); color: #fff; }
.rtk-btn.danger { background: var(--rtk-danger); color: #fff; }
.rtk-btn.small { padding: 10px 16px; min-height: 44px; font-size: 0.875rem; }

.rtk-ghost-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--rtk-card);
  border: 1px solid var(--rtk-line);
  color: var(--rtk-muted);
  border-radius: 14px;
  padding: 12px 16px;
  min-height: 44px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

/* ---- Card, the base building block ---- */
.rtk-card {
  background: var(--rtk-card);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--rtk-shadow);
  margin-bottom: 12px;
}
.rtk-card h4 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
}
.rtk-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.rtk-card-head h4 { margin: 0; }

.rtk-section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 4px 10px; }
.rtk-section-head h4 { margin: 0; font-size: 1.1rem; font-weight: 700; }

.rtk-link { color: var(--rtk-accent); font-weight: 700; font-size: 0.85rem; text-decoration: none; }
.rtk-hint { color: var(--rtk-muted); font-size: 0.85rem; line-height: 1.4; margin: 4px 0 10px; }

/* ================================
   HOME
   ================================ */
.rtk-home-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 4px 20px;
}
.rtk-greet { color: var(--rtk-muted); margin: 0 0 2px; font-size: 0.95rem; }
.rtk-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 1px;
}
.rtk-brand svg { color: var(--rtk-accent); flex-shrink: 0; }
.rtk-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--rtk-card);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--rtk-shadow);
}
.rtk-streak-badge {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--rtk-accent-soft);
  color: var(--rtk-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.rtk-streak-badge b {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: var(--rtk-accent);
  color: #fff;
  font-size: 0.65rem;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Activity ring */
.rtk-activity-row { display: flex; align-items: center; gap: 20px; }
.rtk-ring {
  --p: 0;
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(closest-side, var(--rtk-card) 74%, transparent 75% 100%),
    conic-gradient(var(--rtk-accent) calc(var(--p) * 1%), var(--rtk-track) 0);
}
.rtk-ring span { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.rtk-ring small { color: var(--rtk-muted); font-size: 0.7rem; letter-spacing: 1px; margin-top: 2px; }

.rtk-activity-legend { list-style: none; margin: 0; padding: 0; flex: 1; }
.rtk-activity-legend li { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.rtk-activity-legend .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rtk-activity-legend .dot.dist { background: var(--rtk-accent); }
.rtk-activity-legend .dot.time { background: var(--rtk-teal); }
.rtk-activity-legend .dot.runs { background: var(--rtk-amber); }
.rtk-activity-legend span { display: block; color: var(--rtk-muted); font-size: 0.7rem; letter-spacing: 0.5px; }
.rtk-activity-legend b { font-size: 1.05rem; font-weight: 800; }

/* This week bar chart */
.rtk-streak-pill { display: inline-flex; align-items: center; gap: 4px; color: var(--rtk-accent); font-weight: 700; font-size: 0.8rem; }
.rtk-week-total { color: var(--rtk-accent); font-weight: 800; font-size: 0.9rem; margin: 0 0 14px; }
.rtk-week-bars { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 90px; }
.rtk-week-bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.rtk-week-bars .bar {
  width: 100%;
  max-width: 28px;
  min-height: 6px;
  border-radius: 999px;
  background: var(--rtk-track);
}
.rtk-week-bars .bar-col.filled .bar { background: var(--rtk-accent); }
.rtk-week-bars .bar-col span { font-size: 0.7rem; color: var(--rtk-muted); }
.rtk-week-bars .bar-col.filled span { color: var(--rtk-ink); font-weight: 700; }

/* Recent runs */
.rtk-history-item {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  margin: 0 0 10px;
  background: var(--rtk-card);
  border: none;
  color: var(--rtk-ink);
  border-radius: 16px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  min-height: 44px;
  font-family: inherit;
  box-shadow: var(--rtk-shadow);
}
.rtk-history-item .rtk-hist-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--rtk-accent-soft);
  color: var(--rtk-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.rtk-history-item .info { flex: 1; min-width: 0; }
.rtk-history-item b { display: block; font-size: 1rem; }
.rtk-history-item .sub { display: block; color: var(--rtk-muted); font-size: 0.8rem; margin-top: 2px; }
.rtk-history-item i.chev { color: var(--rtk-muted); }
.rtk-empty { text-align: center; color: var(--rtk-muted); padding: 32px 0; }
.rtk-empty i { display: block; font-size: 2.5rem; margin-bottom: 8px; color: var(--rtk-track); }

/* ================================
   BOTTOM TAB BAR
   ================================ */
.rtk-tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 28rem;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--rtk-card);
  border-top: 1px solid var(--rtk-line);
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
  z-index: 30;
}
.rtk-tabbar button {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--rtk-muted);
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  min-width: 44px;
  min-height: 44px;
}
.rtk-tabbar button i { font-size: 1.3rem; }
.rtk-tabbar button.active { color: var(--rtk-accent); }
/* Spesifisitas: .rtk-tabbar button (0,1,1) mengalahkan .rtk-tab-run (0,1,0) — tombol lari kehilangan
   isi oranye & layout tengahnya. Jadi rule ini di-scope ke .rtk-tabbar juga (0,2,0). */
.rtk-tabbar .rtk-tab-run {
  width: 56px;
  height: 56px;
  min-height: 56px;
  padding: 0;
  border-radius: 50%;
  background: var(--rtk-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -32px;
  box-shadow: 0 0 0 6px rgba(244,80,45,0.18);
}
.rtk-tabbar .rtk-tab-run i { font-size: 1.5rem; color: #fff; }
.rtk-tabbar .rtk-tab-run.recording { animation: rtk-pulse 1.4s ease infinite; box-shadow: 0 0 0 10px rgba(244,80,45,0.22); }

/* ================================
   TRACKING (Run)
   ================================ */
.rtk-track-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px 20px; }
.rtk-rec-label { display: flex; align-items: center; gap: 6px; color: var(--rtk-accent); font-weight: 700; font-size: 0.85rem; letter-spacing: 1px; text-transform: uppercase; }
.rtk-rec-label .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rtk-accent); animation: rtk-pulse 1.2s ease infinite; }
.rtk-gps-pill { display: flex; align-items: center; gap: 6px; background: var(--rtk-accent-soft); color: var(--rtk-accent); font-size: 0.8rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; }

.rtk-track-main { text-align: center; padding: 8px 0 20px; }
.rtk-track-main .lbl { color: var(--rtk-muted); font-size: 0.75rem; letter-spacing: 2px; text-transform: uppercase; }
.rtk-time {
  font-size: 3.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-family: ui-rounded, -apple-system, BlinkMacSystemFont, "DM Sans", sans-serif;
  line-height: 1.1;
  margin: 4px 0 24px;
}
.rtk-grid3 { display: flex; justify-content: space-around; }
.rtk-grid3 > div .lbl { display: block; margin-bottom: 4px; }
.rtk-grid3 > div b { display: block; font-size: 1.75rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---- Map ---- */
/* Leaflet menaruh pane-nya di z-index 400 & kontrol di 1000. Tanpa stacking context sendiri,
   angka itu diadu langsung dengan chrome app (tab bar 30, sheet 40/45, toast 50) di root — peta menang
   dan menimpa tab bar. `isolation: isolate` mengurung semua z-index internal Leaflet di dalam kartu peta. */
.rtk-map {
  height: 260px; border-radius: 20px; overflow: hidden;
  background: var(--rtk-track); box-shadow: var(--rtk-shadow);
  position: relative; z-index: 0; isolation: isolate;
}

/* Territory game (tab WORLD): pilih faksi + legend. Warna faksi lewat --fc dari PHP/JS. */
.rtk-faction-row { display: flex; gap: 8px; }
.rtk-faction-btn { flex: 1; min-height: 48px; border: 2px solid var(--fc); background: transparent; color: var(--fc); border-radius: 14px; font-family: inherit; font-weight: 800; font-size: 0.95rem; cursor: pointer; }
.rtk-faction-btn.active { background: var(--fc); color: #fff; }
.rtk-faction-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 4px 10px; font-size: 0.8rem; font-weight: 600; color: var(--rtk-muted); }
.rtk-faction-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--fc); vertical-align: -1px; }
.rtk-map.small { height: 220px; }

.rtk-track-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 0 8px; }
.rtk-pause-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: none;
  background: var(--rtk-card);
  color: var(--rtk-ink);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(38,35,32,0.16);
  min-width: 44px;
  min-height: 44px;
}
.rtk-pause-btn:active { transform: scale(0.96); }
.rtk-finish-link {
  background: none;
  border: none;
  color: var(--rtk-danger);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 8px;
  min-height: 44px;
}

/* ================================
   RESULT
   ================================ */
.rtk-result-head { text-align: center; padding: 12px 0 20px; }
.rtk-flag-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--rtk-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 12px;
}
.rtk-result-head h2 { margin: 0; font-size: 1.4rem; font-weight: 800; }

.rtk-result-dist { text-align: center; padding: 20px 0; }
.rtk-result-dist .lbl { color: var(--rtk-muted); font-size: 0.75rem; letter-spacing: 2px; text-transform: uppercase; }
.rtk-result-dist strong { display: block; font-size: 3rem; font-weight: 800; color: var(--rtk-accent); line-height: 1.1; }

.rtk-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.rtk-stat-card { background: var(--rtk-card); border-radius: 16px; padding: 14px; box-shadow: var(--rtk-shadow); }
.rtk-stat-card i { color: var(--rtk-accent); font-size: 1.1rem; }
.rtk-stat-card .lbl { display: block; color: var(--rtk-muted); font-size: 0.7rem; letter-spacing: 1px; text-transform: uppercase; margin: 6px 0 2px; }
.rtk-stat-card b { display: block; font-size: 1.2rem; font-weight: 800; }

.rtk-badge-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--rtk-card);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--rtk-shadow);
  margin-bottom: 10px;
}
.rtk-badge-item i { width: 36px; height: 36px; border-radius: 50%; background: var(--rtk-accent-soft); color: var(--rtk-accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rtk-badge-item b { display: block; font-size: 0.9rem; }
.rtk-badge-item span { display: block; color: var(--rtk-muted); font-size: 0.8rem; }

/* Splits table + pace chart, dipakai lewat "Lihat detail" */
.rtk-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.rtk-table th, .rtk-table td { padding: 10px; border-bottom: 1px solid var(--rtk-line); text-align: center; }
.rtk-table th { font-size: 0.75rem; color: var(--rtk-muted); font-weight: 600; }
.rtk-chart { width: 100%; height: 120px; background: var(--rtk-card); border-radius: 14px; box-shadow: var(--rtk-shadow); }

.rtk-row { display: flex; gap: 10px; justify-content: center; margin: 16px 0 8px; }
.rtk-row.wrap { flex-wrap: wrap; }
.rtk-row .rtk-btn, .rtk-row .rtk-btn.ghost { flex: 1; white-space: nowrap; }
/* 4 tombol di 390px bikin label patah 2 baris → paksa grid 2 kolom. */
.rtk-row.wrap .rtk-btn { flex: 1 1 calc(50% - 5px); }

h3 { padding: 0; font-size: 1rem; font-weight: 700; color: var(--rtk-ink); margin: 18px 0 10px; }

/* ================================
   SHARE — sheet penuh layar di atas nav
   ================================ */
.rtk-sheet {
  position: fixed;
  inset: 0;
  background: var(--rtk-bg);
  z-index: 40;
  overflow-y: auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
}
.rtk-sheet-head { display: flex; align-items: center; justify-content: center; position: relative; padding: 8px 0 16px; }
.rtk-sheet-head h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.rtk-sheet-done {
  position: absolute;
  left: 0;
  background: var(--rtk-card);
  border: none;
  color: var(--rtk-accent);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 44px;
  box-shadow: var(--rtk-shadow);
}

.rtk-templates { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 16px; }
.rtk-row-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--rtk-muted); margin: 0 4px 6px; }
.rtk-tpl-btn {
  flex-shrink: 0;
  border: none;
  background: var(--rtk-card);
  color: var(--rtk-muted);
  border-radius: 999px;
  padding: 10px 18px;
  min-height: 44px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: var(--rtk-shadow);
}
.rtk-tpl-btn.active { background: var(--rtk-accent); color: #fff; }

.rtk-preview {
  width: 100%;
  border-radius: 20px;
  box-shadow: var(--rtk-shadow);
  background: var(--rtk-card);
  display: block;
  margin-bottom: 16px;
}
.rtk-preview.small { max-height: 140px; object-fit: cover; }

/* Slider ukuran rute di share card */
.rtk-range-row { display: flex; align-items: center; gap: 12px; margin: 0 2px 14px; font-size: 0.85rem; color: var(--rtk-muted); font-weight: 600; }
.rtk-range-row b { min-width: 3.2em; text-align: right; color: var(--rtk-ink); font-variant-numeric: tabular-nums; }
.rtk-range { flex: 1; min-height: 44px; accent-color: var(--rtk-accent); cursor: pointer; } /* ponytail: accent-color = thumb & track warna brand tanpa pseudo-element per browser */

.rtk-input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  border: 1px solid var(--rtk-line);
  border-radius: 14px;
  background: var(--rtk-card);
  color: var(--rtk-ink);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  min-height: 48px;
  margin-bottom: 12px;
}
.rtk-input:focus { border-color: var(--rtk-accent); }
.rtk-input::placeholder { color: var(--rtk-muted); }

/* ---- Install banner ---- */
.rtk-install-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--rtk-card);
  box-shadow: var(--rtk-shadow);
  padding: 12px 16px;
  border-radius: 16px;
  margin: 8px 16px 0;
}
.rtk-install-banner span { font-size: 0.85rem; }

/* ---- Follow map button (Leaflet control) ---- */
.rtk-follow-btn, .leaflet-control .rtk-follow {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--rtk-accent);
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s;
}
.rtk-follow-btn.off, .leaflet-control .rtk-follow.off { opacity: 0.4; }

/* ================================
   WORLD & PROGRESS (data nyata / placeholder ringan)
   ================================ */
.rtk-page-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 8px 4px 20px; }
.rtk-page-head .lbl { color: var(--rtk-muted); font-size: 0.75rem; letter-spacing: 2px; text-transform: uppercase; }
.rtk-page-head h2 { margin: 2px 0 0; font-size: 1.6rem; font-weight: 800; }
.rtk-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--rtk-card);
  color: var(--rtk-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--rtk-shadow);
  flex-shrink: 0;
}

.rtk-stats-row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.rtk-stats-row3 .rtk-stat-card { text-align: left; }

.rtk-pr-list { background: var(--rtk-card); border-radius: 20px; box-shadow: var(--rtk-shadow); overflow: hidden; margin-bottom: 18px; }
.rtk-pr-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--rtk-line); }
.rtk-pr-item:last-child { border-bottom: none; }
.rtk-pr-item i { color: var(--rtk-accent); font-size: 1.1rem; width: 20px; text-align: center; flex-shrink: 0; }
.rtk-pr-item .info { flex: 1; min-width: 0; }
.rtk-pr-item b { display: block; font-size: 0.9rem; }
.rtk-pr-item span { display: block; color: var(--rtk-muted); font-size: 0.75rem; }
.rtk-pr-item strong { font-size: 1.05rem; font-weight: 800; white-space: nowrap; }

.rtk-eyebrow { color: var(--rtk-muted); font-size: 0.75rem; letter-spacing: 1.5px; text-transform: uppercase; margin: 0 4px 10px; }

/* Feed "pencapaian" — ala kartu media sosial: badge + judul + meta + hapus. */
.rtk-feed-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--rtk-card);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--rtk-shadow);
  margin-bottom: 10px;
}
.rtk-feed-item .badge {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--rtk-accent-soft); color: var(--rtk-accent);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.rtk-feed-item .info { flex: 1; min-width: 0; }
.rtk-feed-item b { display: block; font-size: 0.9rem; }
.rtk-feed-item .meta { display: block; color: var(--rtk-muted); font-size: 0.78rem; margin-top: 2px; }
.rtk-feed-item .stats { display: block; color: var(--rtk-ink); font-size: 0.82rem; margin-top: 4px; font-weight: 600; }
.rtk-feed-del {
  background: none; border: none; color: var(--rtk-faint); cursor: pointer;
  padding: 4px; min-width: 32px; min-height: 32px; flex-shrink: 0;
}

.rtk-placeholder-card { text-align: center; padding: 32px 20px; }
.rtk-placeholder-card i { font-size: 2.5rem; color: var(--rtk-accent); margin-bottom: 12px; display: block; }
.rtk-placeholder-card h4 { margin: 0 0 6px; }
.rtk-placeholder-card p { color: var(--rtk-muted); font-size: 0.85rem; margin: 0; line-height: 1.5; }

/* ================================
   MORE
   ================================ */
.rtk-more-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--rtk-card);
  border: none;
  color: var(--rtk-ink);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--rtk-shadow);
  margin-bottom: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}
.rtk-more-item i { color: var(--rtk-accent); font-size: 1.2rem; width: 24px; text-align: center; }
.rtk-more-foot { text-align: center; color: var(--rtk-muted); font-size: 0.75rem; margin-top: 20px; }

/* ---- Toast ---- */
.rtk-toast {
  position: fixed;
  bottom: calc(90px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(24px);
  background: var(--rtk-ink);
  color: var(--rtk-bg);
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.875rem;
  /* bug: dulu "sembunyi" cuma digeser 80px ke bawah — dari bottom:90px masih nongol sebagai pil kosong di atas tab bar. */
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
  z-index: 50;
  pointer-events: none;
}
.rtk-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }

/* ---- Utility ---- */
.rtk-mut { color: var(--rtk-muted); text-align: center; }

/* ========================================
   REGISTER
   ======================================== */
.rtk-auth {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  background: var(--rtk-bg);
  font-family: -apple-system, BlinkMacSystemFont, "DM Sans", "Segoe UI", sans-serif;
}
.rtk-auth-card {
  width: 100%;
  background: var(--rtk-card);
  border-radius: 24px;
  box-shadow: var(--rtk-shadow);
  padding: 32px 28px;
}
.rtk-auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}
.rtk-auth-logo svg { color: var(--rtk-accent); flex-shrink: 0; }
.rtk-auth-logo span {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
}
.rtk-auth-title {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 6px;
}
.rtk-auth-sub {
  text-align: center;
  color: var(--rtk-muted);
  font-size: 14px;
  margin-bottom: 28px;
}
.rtk-field { margin-bottom: 18px; }
.rtk-field label {
  display: block;
  font-size: 13px;
  color: var(--rtk-muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.rtk-field-label { display: flex; align-items: center; gap: 4px; }
.rtk-field-wrap { position: relative; }
.rtk-field-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--rtk-muted);
  pointer-events: none;
}
.rtk-field input {
  width: 100%;
  padding: 14px 14px 14px 46px;
  border: 1px solid var(--rtk-line);
  border-radius: 14px;
  background: var(--rtk-bg);
  color: var(--rtk-ink);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 52px;
  box-sizing: border-box;
}
.rtk-field input:focus {
  border-color: var(--rtk-accent);
  box-shadow: 0 0 0 3px var(--rtk-accent-soft);
}
.rtk-field input::placeholder { color: var(--rtk-muted); }
.rtk-field input.plain { padding-left: 14px; }

/* ---- Onboarding (profil lokal, bukan akun) ---- */
.rtk-onboard-hero { text-align: center; padding: 48px 12px 24px; }
.rtk-onboard-hero svg { color: var(--rtk-accent); margin-bottom: 12px; }
.rtk-onboard-hero .rtk-brand { margin: 0 0 10px; }
.rtk-onboard-hero .rtk-hint { max-width: 26rem; margin: 0 auto; }

.rtk-auth-alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rtk-auth-alert.error {
  background: rgba(239,68,68,0.1);
  color: #B91C1C;
}
.rtk-auth-alert.success {
  background: rgba(12,141,123,0.12);
  color: var(--rtk-teal);
}

.rtk-auth-submit {
  width: 100%;
  margin-top: 8px;
  padding: 16px;
  border: 0;
  border-radius: 14px;
  background: var(--rtk-accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s, transform 0.1s;
}
.rtk-auth-submit:active { transform: scale(0.98); }

.rtk-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--rtk-muted);
  font-size: 13px;
}
.rtk-auth-divider::before,
.rtk-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rtk-line);
}

.rtk-auth-social {
  display: flex;
  gap: 10px;
}
.rtk-auth-social a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--rtk-line);
  border-radius: 14px;
  background: var(--rtk-bg);
  color: var(--rtk-ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.2s;
}
.rtk-auth-social a:hover { border-color: var(--rtk-accent); }

.rtk-auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--rtk-muted);
}
.rtk-auth-footer a { color: var(--rtk-accent); text-decoration: none; font-weight: 700; }
.rtk-auth-footer a:hover { text-decoration: underline; }

/* ---- Share: kustomisasi teks & warna kartu ---- */
.rtk-card-tight { padding: 14px; }
.rtk-card-tight .rtk-input { margin-bottom: 10px; }
.rtk-color-row { display: flex; align-items: center; gap: 14px; }
.rtk-swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.7rem; font-weight: 600; color: var(--rtk-muted); cursor: pointer; }
.rtk-swatch input[type="color"] {
  width: 40px; height: 40px; padding: 0; border: 2px solid var(--rtk-line); border-radius: 50%;
  background: none; cursor: pointer; -webkit-appearance: none; appearance: none;
}
.rtk-swatch input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.rtk-swatch input[type="color"]::-webkit-color-swatch { border: none; border-radius: 50%; }
.rtk-swatch input[type="color"]::-moz-color-swatch { border: none; border-radius: 50%; }
.rtk-reset-link { margin-left: auto; background: none; border: none; color: var(--rtk-accent); font-family: inherit; font-weight: 700; font-size: 0.8rem; cursor: pointer; min-height: 44px; padding: 0 6px; }

/* ---- Pilih mode aktivitas (lari / jalan / sepeda) ---- */
.rtk-act-sheet { position: fixed; inset: 0; z-index: 45; background: rgba(28,26,23,0.45); display: flex; align-items: flex-end; justify-content: center; }
.rtk-act-card {
  width: 100%; max-width: 28rem; background: var(--rtk-card); border-radius: 24px 24px 0 0;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); animation: rtk-fade 0.2s ease;
}
.rtk-act-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 1rem; }
.rtk-act-head button { background: none; border: none; color: var(--rtk-muted); font-size: 1.2rem; min-width: 44px; min-height: 44px; cursor: pointer; }
.rtk-act-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rtk-act-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 8px;
  background: var(--rtk-bg); border: 2px solid var(--rtk-line); border-radius: 18px;
  color: var(--rtk-ink); font-family: inherit; font-weight: 700; font-size: 0.9rem; cursor: pointer; min-height: 44px;
}
.rtk-act-btn i { font-size: 1.9rem; color: var(--rtk-accent); }
.rtk-act-btn.active { border-color: var(--rtk-accent); background: var(--rtk-accent-soft); }
.rtk-rec-label i { font-size: 1rem; }
/* Header tracking: label mode jangan patah; pesan GPS yang panjang yang boleh wrap. */
.rtk-track-head { gap: 10px; }
.rtk-rec-label { white-space: nowrap; flex-shrink: 0; }
.rtk-gps-pill { min-width: 0; line-height: 1.25; }
/* Share: teks kartu bisa diseret di preview */
.rtk-preview.draggable { cursor: move; touch-action: none; user-select: none; -webkit-user-select: none; }
.rtk-drag-hint { text-align: center; margin: -8px 0 12px; font-size: 0.78rem; }
/* ---- Tracking: tombol Jeda/Selesai yang jelas di light & dark ---- */
.rtk-track-actions { flex-direction: row; justify-content: center; align-items: flex-start; gap: 44px; padding: 28px 0 12px; }
.rtk-track-act { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700; color: var(--rtk-muted); }
.rtk-pause-btn { background: var(--rtk-ink); color: var(--rtk-bg); font-size: 1.7rem; box-shadow: 0 10px 28px rgba(0,0,0,0.22); } /* hitam di light, krem di dark → selalu kontras */
.rtk-pause-btn.paused { background: var(--rtk-accent); color: #fff; }
.rtk-stop-btn {
  width: 76px; height: 76px; border-radius: 50%; border: 2px solid var(--rtk-danger);
  background: transparent; color: var(--rtk-danger); font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center; cursor: pointer; min-width: 44px; min-height: 44px;
}
.rtk-stop-btn:active, .rtk-pause-btn:active { transform: scale(0.96); }
.rtk-track-head.paused .dot { animation: none; background: var(--rtk-muted); }
.rtk-track-head.paused .rtk-rec-label { color: var(--rtk-muted); }

/* ================================
   SMARTWATCH (Web Bluetooth) — pill di tracking, baris di sheet mulai, kartu di More.
   Status class (idle/remembered/connecting/connected/reconnecting/disconnected) = RTK_BLE.state().status apa adanya.
   ================================ */
.rtk-watch-pill { border: 1px solid var(--rtk-line); background: var(--rtk-card); color: var(--rtk-muted); font-family: inherit; cursor: pointer; min-height: 32px; white-space: nowrap; }
.rtk-watch-pill.connected { background: var(--rtk-accent-soft); color: var(--rtk-accent); border-color: transparent; }
.rtk-watch-pill.connected i { animation: rtk-beat 1s ease-in-out infinite; }
.rtk-watch-pill.connecting i, .rtk-watch-pill.reconnecting i { animation: rtk-pulse 1.2s ease infinite; }
.rtk-watch-pill.disconnected { color: var(--rtk-danger); }
@keyframes rtk-beat { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.25); } }

/* Angka HR + zona (Z1–Z5 dari 220 − usia) + kadens di panel tracking. */
.rtk-hr-line { display: flex; align-items: center; justify-content: center; gap: 6px; }
.rtk-zone { display: inline-block; padding: 2px 7px; border-radius: 999px; font-size: 0.7rem; font-weight: 800; background: var(--rtk-track); color: var(--rtk-muted); }
.rtk-zone:empty { display: none; }
.rtk-zone[data-z="1"] { background: rgba(74,134,184,0.18); color: #4a86b8; }
.rtk-zone[data-z="2"] { background: rgba(46,154,94,0.18); color: #2e9a5e; }
.rtk-zone[data-z="3"] { background: rgba(212,150,0,0.2); color: #b8860b; }
.rtk-zone[data-z="4"] { background: rgba(245,80,46,0.18); color: var(--rtk-accent); }
.rtk-zone[data-z="5"] { background: rgba(220,38,38,0.2); color: #dc2626; }
.rtk-cad { display: block; color: var(--rtk-muted); font-size: 0.75rem; font-weight: 600; min-height: 1em; margin-top: 2px; }

/* Baris "Connect smartwatch" di sheet Start activity. */
.rtk-watch-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 12px; padding: 12px 14px; min-height: 48px;
  background: var(--rtk-bg); border: 2px dashed var(--rtk-line); border-radius: 16px; color: var(--rtk-ink);
  font-family: inherit; font-weight: 700; font-size: 0.875rem; cursor: pointer; text-align: left;
}
.rtk-watch-btn > i:first-child { color: var(--rtk-accent); font-size: 1.3rem; }
.rtk-watch-btn span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rtk-watch-btn .chev { color: var(--rtk-faint); }
.rtk-watch-btn.on { border-style: solid; border-color: var(--rtk-accent); background: var(--rtk-accent-soft); }
.rtk-watch-btn.on > i:first-child { animation: rtk-beat 1s ease-in-out infinite; }

/* Kartu Smartwatch di More. */
.rtk-watch-row { display: flex; align-items: center; gap: 12px; }
.rtk-watch-ic { width: 44px; height: 44px; border-radius: 50%; background: var(--rtk-accent-soft); color: var(--rtk-accent); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.rtk-watch-row .info { flex: 1; min-width: 0; }
.rtk-watch-row .info b { display: block; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rtk-watch-row .info span { display: block; color: var(--rtk-muted); font-size: 0.78rem; line-height: 1.35; }
.rtk-watch-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rtk-faint); flex-shrink: 0; }
.rtk-watch-dot.connected { background: var(--rtk-teal); box-shadow: 0 0 0 4px rgba(14,139,122,0.18); }
.rtk-watch-dot.connecting, .rtk-watch-dot.reconnecting { background: var(--rtk-amber); animation: rtk-pulse 1.2s ease infinite; }
.rtk-watch-dot.disconnected { background: var(--rtk-danger); }
.rtk-watch-live { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 4px; padding-top: 12px; border-top: 1px solid var(--rtk-line); text-align: center; }
.rtk-watch-live .lbl { display: block; color: var(--rtk-muted); font-size: 0.65rem; letter-spacing: 1px; text-transform: uppercase; }
.rtk-watch-live b { display: block; font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.rtk-watch-card .rtk-hint { margin: 10px 0 0; }
.rtk-watch-card .rtk-hint:empty { display: none; }
.rtk-watch-link { display: block; width: 100%; margin-top: 6px; background: none; border: none; color: var(--rtk-accent); font-family: inherit; font-weight: 700; font-size: 0.8rem; cursor: pointer; min-height: 40px; }
.rtk-check { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--rtk-muted); font-size: 0.8rem; cursor: pointer; }
.rtk-check input { width: 18px; height: 18px; accent-color: var(--rtk-accent); margin: 0; }

/* ---- Onboarding mobile-friendly + install card ---- */
.rtk-onboard { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.rtk-onboard .rtk-card { max-width: 100%; }
.rtk-onboard input { font-size: 16px; } /* cegah auto-zoom iOS */
.rtk-onboard input[type="date"] { min-height: 52px; }
.rtk-install-card { margin-top: 12px; }
.rtk-install-steps { margin: 12px 0 0; padding-left: 20px; color: var(--rtk-muted); font-size: 0.85rem; line-height: 1.6; }
.rtk-install-steps b { color: var(--rtk-ink); }
@media (max-width: 380px) {
  .rtk-onboard-hero { padding: 32px 8px 16px; }
  .rtk-onboard .rtk-card { padding: 16px; }
}
