/* ==========================================================================
   KatakanPeta — Base & Components
   ========================================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--fs-body);
  line-height: 1.5;
  min-height: 100vh;
  transition: background var(--dur-med) var(--ease-out), color var(--dur-med) var(--ease-out);
  overscroll-behavior-y: contain;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.app-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--color-bg);
}

.page {
  padding: var(--sp-5) var(--sp-5) calc(var(--nav-height) + var(--sp-8) + var(--safe-bottom));
  animation: fadeSlideIn var(--dur-med) var(--ease-out);
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Typography helpers ---- */
.h-display { font-family: var(--font-display); font-size: var(--fs-display-xl); font-weight: 600; letter-spacing: -0.01em; }
.h-title   { font-family: var(--font-display); font-size: var(--fs-title); font-weight: 600; }
.text-muted { color: var(--color-text-muted); }
.data-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---- Signature motif: Contour line ---- */
.contour-divider {
  width: 100%;
  height: 28px;
  display: block;
  opacity: 0.5;
}
.contour-divider path { stroke: var(--color-accent); stroke-width: 1.5; fill: none; }

.contour-header {
  position: relative;
  z-index: 0; /* WAJIB: membentuk stacking context sendiri agar ::before (z-index:-1)
                 tetap terkurung di dalam header ini, bukan kepental ke belakang
                 background body/app-shell (bug yang bikin header tampak pudar/hilang) */
  padding-top: var(--sp-3);
  padding-bottom: var(--sp-6);
  overflow: hidden;
}
.hero-icons { position: absolute; top: var(--sp-3); right: var(--sp-5); display: flex; gap: var(--sp-2); z-index: 1; }
.hero-text-zone { display: flex; min-height: 108px; padding-right: 100px; }
.hero-text-zone.hero-text-align-top { align-items: flex-start; padding-top: 2px; }
.hero-text-zone.hero-text-align-center { align-items: center; }
.hero-text-zone.hero-text-align-bottom { align-items: flex-end; padding-bottom: var(--sp-2); }
.contour-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(20,33,15,0.35) 0%, rgba(20,33,15,0.55) 55%, var(--color-primary) 100%),
    var(--hero-bg-image, none),
    radial-gradient(120% 60% at 20% 0%, rgba(107,142,78,0.18), transparent 60%),
    linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary) 60%, transparent 100%);
  background-size: cover, cover, auto, auto;
  background-position: center, center, center, center;
  z-index: -1;
  border-radius: 0 0 32px 32px;
}
/* Default kalau admin belum upload foto custom: siluet pegunungan berlapis,
   digambar murni pakai gradient CSS (tanpa perlu file gambar eksternal) supaya
   tetap ringan & selalu tampil bagus meski offline / sebelum foto diatur. */
.contour-header:not(.has-hero-photo)::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.5;
  background:
    linear-gradient(115deg, transparent 42%, rgba(242,241,232,0.10) 43%, transparent 46%),
    linear-gradient(160deg, transparent 60%, rgba(20,33,15,0.55) 61%, rgba(20,33,15,0.55) 68%, transparent 69%),
    linear-gradient(200deg, transparent 55%, rgba(20,33,15,0.4) 56%, rgba(20,33,15,0.4) 64%, transparent 65%),
    linear-gradient(145deg, transparent 70%, rgba(20,33,15,0.65) 71%, rgba(20,33,15,0.65) 82%, transparent 83%);
}
.contour-header .h-display,
.contour-header .text-muted { color: #F2F1E8; }
.contour-header .text-muted { opacity: 0.85; }

/* ---- Card ---- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  padding: var(--sp-5);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
}

.card-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255,255,255,0.3);
}

/* ---- Buttons ---- */
.btn {
  min-height: 48px;
  padding: 0 var(--sp-5);
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 0.9375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--color-primary); color: #F2F1E8; box-shadow: var(--shadow-soft); }
.btn-outline { background: transparent; border: 1.5px solid var(--color-border); color: var(--color-text); }
.btn-icon {
  width: 44px; height: 44px; border-radius: var(--radius-pill);
  background: var(--color-surface); box-shadow: var(--shadow-soft);
  display: inline-flex; align-items: center; justify-content: center;
}

/* Ripple */
.ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.5); transform: scale(0); animation: ripple 550ms var(--ease-out); pointer-events: none; }
@keyframes ripple { to { transform: scale(3.2); opacity: 0; } }

/* ---- Quick Action Grid ---- */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); margin-top: calc(var(--sp-8) * -1); position: relative; z-index: 2; }
.quick-action {
  background: var(--color-surface); border-radius: 18px; padding: var(--sp-3) var(--sp-1);
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  box-shadow: var(--shadow-lift); text-align: center;
}
.quick-action span { font-size: 0.6875rem; font-weight: 600; color: var(--color-text-muted); line-height: 1.2; min-height: 2.2em; display: flex; align-items: center; justify-content: center; }
.quick-action .qa-icon { width: 36px; height: 36px; border-radius: var(--radius-pill); background: var(--color-surface-alt); display: flex; align-items: center; justify-content: center; }

/* ---- Section ---- */
.section { margin-top: var(--sp-7); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--sp-4); }
.section-head .link { font-size: var(--fs-caption); color: var(--color-accent); font-weight: 600; }

/* ---- Stat pill row ---- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.stat-pill { text-align: center; padding: var(--sp-4) var(--sp-2); }
.stat-pill .val { font-family: var(--font-mono); font-size: 1.375rem; font-weight: 700; display: block; }
.stat-pill .lbl { font-size: 0.6875rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---- Badge strip ---- */
.badge-strip { display: flex; gap: var(--sp-3); overflow-x: auto; padding-bottom: var(--sp-2); scrollbar-width: none; }
.badge-strip::-webkit-scrollbar { display: none; }
.badge {
  flex: 0 0 auto; width: 76px; display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
}
.badge-icon {
  width: 60px; height: 60px; border-radius: var(--radius-pill);
  background: linear-gradient(145deg, var(--earth-300), var(--earth-500));
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-soft);
}
.badge.locked .badge-icon { background: var(--color-surface-alt); filter: grayscale(1); opacity: 0.6; }
.badge span { font-size: 0.6875rem; text-align: center; color: var(--color-text-muted); }

/* ---- Trip card ---- */
.trip-card { display: flex; gap: var(--sp-4); align-items: center; }
.trip-thumb { width: 64px; height: 64px; border-radius: 14px; background: var(--color-surface-alt); flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.trip-card.empty-state { transition: transform var(--dur-fast) var(--ease-out); }
.trip-card.empty-state:active { transform: scale(0.98); }
.trip-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Quote card ---- */
.quote-card { position: relative; padding: var(--sp-6) var(--sp-5); }
.quote-card .mark { font-family: var(--font-display); font-size: 2.5rem; color: var(--color-accent); opacity: 0.4; line-height: 0.5; }

/* ---- Bottom Navigation ---- */
.bottom-nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: var(--max-width);
  padding-bottom: var(--safe-bottom);
  background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--color-border);
  display: flex; flex-direction: column;
  z-index: 100;
}
.bottom-nav-items {
  height: var(--nav-height);
  display: flex; align-items: center; justify-content: space-around;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--color-text-muted); font-size: 0.625rem; font-weight: 600;
  width: 56px; padding: var(--sp-2) 0; border-radius: 14px;
  transition: color var(--dur-fast) var(--ease-out);
}
.nav-item.active { color: var(--color-primary); }
.nav-item[aria-label="SOS"] { color: var(--color-sos); }
.nav-item[aria-label="SOS"].active { color: var(--color-sos); }
.nav-item svg { width: 22px; height: 22px; }
.nav-item.center-fab {
  width: 52px; height: 52px; border-radius: var(--radius-pill);
  background: var(--color-primary); color: #F2F1E8;
  margin-top: -28px; box-shadow: var(--shadow-lift);
  justify-content: center;
}
.nav-item.center-fab svg { width: 24px; height: 24px; }

/* ---- Marquee pengumuman admin — strip di bawah tombol navigasi paling bawah ---- */
.bottom-nav-marquee {
  height: 0; overflow: hidden; white-space: nowrap;
  border-top: 1px solid var(--color-border);
  transition: height var(--dur-med) var(--ease-out);
}
.bottom-nav-marquee.show { height: 30px; }
.bottom-nav-marquee .marquee-track {
  display: inline-flex; white-space: nowrap;
  animation-name: marquee-scroll; animation-timing-function: linear; animation-iteration-count: infinite;
}
.bottom-nav-marquee .marquee-item {
  display: inline-block; padding: 0 var(--sp-6); font-size: 0.75rem; font-weight: 600;
  line-height: 30px; color: var(--color-primary);
}
.bottom-nav-marquee .marquee-item::before { content: '📣'; margin-right: var(--sp-2); }
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .bottom-nav-marquee .marquee-track { animation: none; }
}

/* ---- Skeleton loading ---- */
.skeleton {
  background: linear-gradient(90deg, var(--color-surface-alt) 25%, var(--color-border) 50%, var(--color-surface-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 10px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---- Pull to refresh indicator ---- */
.ptr-indicator {
  display: flex; align-items: center; justify-content: center; height: 0; overflow: hidden;
  transition: height var(--dur-med) var(--ease-out); color: var(--color-accent);
}
.ptr-indicator.active { height: 48px; }
.ptr-indicator svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Utility ---- */
.flex { display: flex; }
.gap-2 { gap: var(--sp-2); }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.offline-banner {
  display: none; align-items: center; gap: var(--sp-2);
  background: var(--earth-500); color: #fff; font-size: var(--fs-caption); font-weight: 600;
  padding: var(--sp-2) var(--sp-5); text-align: center; justify-content: center;
}
.offline-banner.show { display: flex; }

/* ---- Search bar ---- */
.search-bar {
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-pill); padding: 0 var(--sp-4); height: 48px;
}
.search-bar input {
  border: none; background: none; outline: none; flex: 1;
  font-family: var(--font-body); font-size: 0.9375rem; color: var(--color-text);
}
.search-bar input::placeholder { color: var(--color-text-muted); }
.search-bar svg { flex-shrink: 0; color: var(--color-text-muted); }

/* ---- Filter chips ---- */
.filter-chips { display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none; padding: var(--sp-1) 0; }
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-pill);
  background: var(--color-surface); border: 1px solid var(--color-border);
  font-size: 0.8125rem; font-weight: 600; color: var(--color-text-muted);
  transition: all var(--dur-fast) var(--ease-out);
}
.chip.active { background: var(--color-primary); color: #F2F1E8; border-color: var(--color-primary); }

/* ---- Trail list card ---- */
.trail-list-card {
  display: flex; gap: var(--sp-4); padding: var(--sp-3);
  border-radius: var(--radius-card); background: var(--color-surface);
  box-shadow: var(--shadow-soft); border: 1px solid var(--color-border);
  margin-bottom: var(--sp-3);
}
.trail-list-thumb {
  width: 84px; height: 84px; border-radius: 14px; overflow: hidden; flex-shrink: 0;
  background: var(--color-surface-alt);
}
.trail-list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.difficulty-badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 0.6875rem; font-weight: 700;
  padding: 3px 10px; border-radius: var(--radius-pill); color: #fff;
}
.difficulty-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---- Detail hero ---- */
.detail-hero {
  position: relative; height: 260px; margin: 0 calc(var(--sp-5) * -1);
  background-size: cover; background-position: center;
  display: flex; align-items: flex-end;
}
.detail-hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,33,15,0.1) 0%, rgba(20,33,15,0.85) 100%);
}
.detail-hero-back {
  position: absolute; top: var(--sp-5); left: var(--sp-5); z-index: 2;
  width: 40px; height: 40px; border-radius: var(--radius-pill);
  background: rgba(0,0,0,0.35); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.detail-hero-save {
  position: absolute; top: var(--sp-5); right: var(--sp-5); z-index: 2;
  width: 40px; height: 40px; border-radius: var(--radius-pill);
  background: rgba(0,0,0,0.35); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.detail-hero-content { position: relative; z-index: 1; padding: var(--sp-5); color: #F2F1E8; }

/* ---- Detail stat grid ---- */
.detail-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); margin-top: calc(var(--sp-6) * -1); position: relative; z-index: 2; }

/* ---- Tip list ---- */
.tip-item { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) 0; border-bottom: 1px solid var(--color-border); }
.tip-item:last-child { border-bottom: none; }
.tip-item .tip-icon { flex-shrink: 0; width: 28px; height: 28px; border-radius: var(--radius-pill); background: var(--color-surface-alt); display: flex; align-items: center; justify-content: center; }

/* ---- Checklist item ---- */
.checklist-item { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--color-border); }
.checklist-item:last-child { border-bottom: none; }
.checklist-item input[type="checkbox"] {
  width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--color-border);
  accent-color: var(--color-primary); flex-shrink: 0;
}
.checklist-item .mandatory-tag { font-size: 0.625rem; font-weight: 700; color: var(--color-sos); text-transform: uppercase; }

/* ---- Route tab ---- */
.route-tabs {
  display: flex; gap: var(--sp-2); overflow-x: auto; scroll-snap-type: x proximity;
  padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.route-tabs::-webkit-scrollbar { display: none; }
.route-tab {
  padding: var(--sp-3) var(--sp-4); border-radius: 14px; background: var(--color-surface);
  border: 1px solid var(--color-border); text-align: center;
  flex-shrink: 0; scroll-snap-align: start; min-width: 92px;
}
.route-tab.active { border-color: var(--color-primary); background: var(--color-surface-alt); }
.route-tab .rt-name { font-weight: 700; font-size: 0.8125rem; }
.route-tab .rt-meta { font-size: 0.6875rem; color: var(--color-text-muted); font-family: var(--font-mono); }

/* ---- Empty state ---- */
.empty-state { text-align: center; padding: var(--sp-8) var(--sp-5); color: var(--color-text-muted); }
.empty-state svg { margin-bottom: var(--sp-3); opacity: 0.5; }

/* ---- Tracker: idle state ---- */
.tracker-idle { text-align: center; padding: var(--sp-8) var(--sp-5); }
.tracker-idle .pulse-ring {
  width: 140px; height: 140px; border-radius: 50%; margin: 0 auto var(--sp-6);
  background: var(--color-surface-alt); display: flex; align-items: center; justify-content: center;
  position: relative;
}
.tracker-idle .pulse-ring::before {
  content: ''; position: absolute; inset: -10px; border-radius: 50%;
  border: 2px solid var(--color-accent); opacity: 0.4; animation: pulseRing 2.4s ease-out infinite;
}
@keyframes pulseRing { 0% { transform: scale(0.9); opacity: 0.5; } 100% { transform: scale(1.25); opacity: 0; } }

/* ---- Tracker: active stats ---- */
.tracker-stat-hero { text-align: center; padding: var(--sp-6) 0; }
.tracker-stat-hero .big-stat {
  font-family: var(--font-mono); font-size: 3rem; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tracker-stat-hero .big-stat-label { font-size: 0.75rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: var(--sp-2); }

.tracker-mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.tracker-mini-stats .stat-pill .val { font-size: 1.125rem; }

.breadcrumb-canvas-wrap, .elevation-canvas-wrap {
  width: 100%; height: 180px; border-radius: var(--radius-card);
  background: var(--color-surface); border: 1px solid var(--color-border);
  overflow: hidden;
}
.elevation-canvas-wrap { height: 110px; }
.breadcrumb-canvas-wrap canvas, .elevation-canvas-wrap canvas { width: 100%; height: 100%; display: block; }

/* ---- Tracker controls ---- */
.tracker-controls { display: flex; gap: var(--sp-3); align-items: center; justify-content: center; }
.tracker-btn-round {
  width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lift);
}
.tracker-btn-round.primary { background: var(--color-primary); color: #F2F1E8; }
.tracker-btn-round.danger { background: var(--color-sos); color: #fff; }
.tracker-btn-round.secondary { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); width: 52px; height: 52px; }

.gps-status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--color-text-muted); }
.gps-status .gps-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--moss-500); animation: gpsPulse 1.6s ease-in-out infinite; }
@keyframes gpsPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ---- Finish summary ---- */
.summary-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.export-btn-row { display: flex; gap: var(--sp-3); }
.export-btn-row .btn { flex: 1; }

/* ---- Gear: template picker ---- */
.template-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
.template-card {
  padding: var(--sp-4); border-radius: var(--radius-card); background: var(--color-surface);
  border: 1.5px solid var(--color-border); text-align: center;
}
.template-card .tc-icon { font-size: 1.75rem; margin-bottom: var(--sp-2); }
.template-card .tc-name { font-weight: 700; font-size: 0.875rem; }
.template-card .tc-meta { font-size: 0.6875rem; color: var(--color-text-muted); margin-top: 2px; }

/* ---- Gear: weight summary bar ---- */
.weight-summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-5); background: var(--color-primary); border-radius: var(--radius-card);
  color: #F2F1E8; margin: 0 calc(var(--sp-5) * -1) var(--sp-5); border-radius: 0 0 24px 24px;
}
.weight-summary .ws-total { font-family: var(--font-mono); font-size: 1.75rem; font-weight: 700; }
.weight-summary .ws-label { font-size: 0.6875rem; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.04em; }
.weight-summary .ws-progress { text-align: right; }
.progress-ring-mini { width: 44px; height: 44px; }

/* ---- Gear: category accordion ---- */
.gear-category { border-radius: var(--radius-card); background: var(--color-surface); border: 1px solid var(--color-border); margin-bottom: var(--sp-3); overflow: hidden; }
.gear-category-head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4); cursor: pointer; }
.gear-category-head .gc-emoji { font-size: 1.25rem; }
.gear-category-head .gc-name { flex: 1; font-weight: 600; font-size: 0.875rem; }
.gear-category-head .gc-count { font-size: 0.75rem; color: var(--color-text-muted); font-family: var(--font-mono); }
.gear-category-head .gc-chevron { transition: transform var(--dur-fast) var(--ease-out); }
.gear-category.open .gc-chevron { transform: rotate(180deg); }
.gear-category-body { max-height: 0; overflow: hidden; transition: max-height var(--dur-med) var(--ease-out); }
.gear-category.open .gear-category-body { max-height: 1000px; }
.gear-item-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--color-border); }
.gear-item-row .gi-name { flex: 1; font-size: 0.875rem; }
.gear-item-row .gi-name.checked { text-decoration: line-through; color: var(--color-text-muted); }
.gear-item-row .gi-weight { font-family: var(--font-mono); font-size: 0.75rem; color: var(--color-text-muted); }
.gear-item-row .gi-remove { color: var(--color-text-muted); }

/* ---- Add item form ---- */
.field-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-3); min-width: 0; }
.field-row label { font-size: 0.75rem; font-weight: 600; color: var(--color-text-muted); }
.field-row input, .field-row select, .field-row textarea {
  height: 46px; border-radius: 12px; border: 1px solid var(--color-border); background: var(--color-surface);
  padding: 0 var(--sp-3); font-family: var(--font-body); font-size: 0.9375rem; color: var(--color-text);
  width: 100%; box-sizing: border-box; min-width: 0;
}
.field-row textarea { height: auto; padding: var(--sp-3); min-height: 90px; resize: vertical; }
.field-row-inline { display: flex; gap: var(--sp-3); min-width: 0; }
.field-row-inline .field-row { flex: 1; min-width: 0; }

/* ---- Logbook: entry card ---- */
.logbook-card { display: flex; gap: var(--sp-4); padding: var(--sp-3); border-radius: var(--radius-card); background: var(--color-surface); border: 1px solid var(--color-border); margin-bottom: var(--sp-3); }
.logbook-thumb { width: 72px; height: 72px; border-radius: 14px; overflow: hidden; flex-shrink: 0; background: var(--color-surface-alt); }
.logbook-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mood-emoji { font-size: 1rem; }
.star-rating { display: inline-flex; gap: 2px; }
.star-rating svg { width: 13px; height: 13px; }

/* ---- Logbook: rating picker (form) ---- */
.rating-picker { display: flex; gap: var(--sp-2); }
.rating-picker button { width: 40px; height: 40px; border-radius: 12px; background: var(--color-surface-alt); display: flex; align-items: center; justify-content: center; }
.rating-picker button.active { background: var(--earth-500); }
.mood-picker { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.mood-picker button { width: 48px; height: 48px; border-radius: 14px; background: var(--color-surface-alt); font-size: 1.375rem; display: flex; align-items: center; justify-content: center; }
.mood-picker button.active { background: var(--moss-300); }

/* ---- Photo upload preview ---- */
.photo-upload-box {
  height: 140px; border-radius: var(--radius-card); border: 1.5px dashed var(--color-border);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2);
  color: var(--color-text-muted); position: relative; overflow: hidden; background: var(--color-surface-alt);
}
.photo-upload-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-upload-box input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---- Weather detail ---- */
.weather-hero { text-align: center; padding: var(--sp-7) var(--sp-5) var(--sp-6); color: #F2F1E8; }
.weather-hero .wh-temp { font-family: var(--font-mono); font-size: 3.5rem; font-weight: 700; line-height: 1; }
.weather-detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
.weather-detail-card { padding: var(--sp-4); text-align: center; }
.weather-detail-card .wd-icon { font-size: 1.5rem; margin-bottom: var(--sp-2); }
.weather-detail-card .wd-val { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 700; }
.weather-detail-card .wd-lbl { font-size: 0.6875rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.stale-banner { background: var(--earth-300); color: var(--forest-950); font-size: 0.75rem; font-weight: 600; text-align: center; padding: var(--sp-2); border-radius: 12px; }

/* ---- Achievement grid ---- */
.achievement-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.achievement-card { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); text-align: center; }
.achievement-card .ac-icon {
  width: 68px; height: 68px; border-radius: var(--radius-pill);
  background: linear-gradient(145deg, var(--earth-300), var(--earth-500));
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-soft); font-size: 1.75rem;
}
.achievement-card.locked .ac-icon { background: var(--color-surface-alt); filter: grayscale(1); opacity: 0.55; }
.achievement-card .ac-name { font-size: 0.75rem; font-weight: 600; }
.achievement-card .ac-progress { font-size: 0.625rem; color: var(--color-text-muted); font-family: var(--font-mono); }

/* ---- Profile ---- */
.profile-header { display: flex; flex-direction: column; align-items: center; padding: var(--sp-7) var(--sp-5) var(--sp-6); text-align: center; }
.profile-avatar {
  width: 92px; height: 92px; border-radius: 50%; overflow: hidden; position: relative;
  background: var(--color-surface-alt); display: flex; align-items: center; justify-content: center;
  font-size: 2rem; box-shadow: var(--shadow-lift); margin-bottom: var(--sp-4);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.profile-avatar .avatar-edit-badge {
  position: absolute; bottom: 0; right: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--color-primary); display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.profile-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4); border-bottom: 1px solid var(--color-border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row .sr-label { font-size: 0.875rem; font-weight: 500; }
.toggle-switch { width: 44px; height: 26px; border-radius: var(--radius-pill); background: var(--color-border); position: relative; transition: background var(--dur-fast) var(--ease-out); }
.toggle-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform var(--dur-fast) var(--ease-out); }
.toggle-switch.on { background: var(--color-primary); }
.toggle-switch.on::after { transform: translateX(18px); }

/* ---- SOS: hero & big actions ---- */
.sos-hero { background: linear-gradient(180deg, var(--color-sos) 0%, #8E2E24 100%); padding: var(--sp-7) var(--sp-5) var(--sp-6); margin: 0 0 var(--sp-5); border-radius: 0 0 32px 32px; text-align: center; color: #fff; }
.sos-hero .sos-icon { width: 84px; height: 84px; border-radius: 50%; background: rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; margin: 0 auto var(--sp-4); }
.sos-big-btn {
  width: 100%; min-height: 64px; border-radius: 20px; background: #fff; color: var(--color-sos);
  font-weight: 700; font-size: 1.0625rem; display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25); margin-top: var(--sp-5);
}
.sos-action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
.sos-action-card {
  padding: var(--sp-4); border-radius: var(--radius-card); background: var(--color-surface);
  border: 1px solid var(--color-border); text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
}
.sos-action-card.active { background: var(--color-sos); color: #fff; border-color: var(--color-sos); }
.sos-action-card .sa-icon { font-size: 1.5rem; }
.sos-action-card .sa-label { font-size: 0.8125rem; font-weight: 600; }

/* ---- Contact card ---- */
.contact-card { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3); border-radius: var(--radius-card); background: var(--color-surface); border: 1px solid var(--color-border); margin-bottom: var(--sp-3); }
.contact-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--color-surface-alt); display: flex; align-items: center; justify-content: center; font-size: 1.125rem; flex-shrink: 0; }
.contact-actions { display: flex; gap: var(--sp-2); }
.contact-actions button { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--color-surface-alt); }
.contact-actions .call-btn { background: var(--moss-300); }
.contact-actions .share-btn { background: var(--earth-300); }

/* ---- Guide accordion (reuse gear-category style dgn warna netral) ---- */
.guide-item { border-radius: var(--radius-card); background: var(--color-surface); border: 1px solid var(--color-border); margin-bottom: var(--sp-3); overflow: hidden; }
.guide-item-head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4); cursor: pointer; }
.guide-item-head .gi-emoji { font-size: 1.25rem; }
.guide-item-head .gi-title { flex: 1; font-weight: 600; font-size: 0.875rem; }
.guide-item-body { max-height: 0; overflow: hidden; transition: max-height var(--dur-med) var(--ease-out); }
.guide-item.open .guide-item-body { max-height: 600px; }
.guide-item.open .gc-chevron, .guide-item.open .gi-chevron { transform: rotate(180deg); }
.guide-step { display: flex; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4); font-size: 0.8125rem; line-height: 1.5; border-top: 1px solid var(--color-border); }
.guide-step:first-child { border-top: none; }
.guide-step .step-num { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--color-surface-alt); font-size: 0.6875rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ---- AI Chat ---- */
.ai-header { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-5); border-bottom: 1px solid var(--color-border); }
.ai-avatar { width: 40px; height: 40px; border-radius: var(--radius-pill); background: var(--color-primary); display: flex; align-items: center; justify-content: center; }
.ai-chat-scroll { flex: 1; overflow-y: auto; padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }
.chat-bubble { max-width: 82%; padding: var(--sp-3) var(--sp-4); border-radius: 18px; font-size: 0.875rem; line-height: 1.5; white-space: pre-wrap; }
.chat-bubble.user { align-self: flex-end; background: var(--color-primary); color: #F2F1E8; border-bottom-right-radius: 4px; }
.chat-bubble.assistant { align-self: flex-start; background: var(--color-surface-alt); color: var(--color-text); border-bottom-left-radius: 4px; }
.chat-bubble.system-note { align-self: center; background: transparent; color: var(--color-text-muted); font-size: 0.75rem; text-align: center; max-width: 100%; }
.chat-bubble.assistant p { margin: 0 0 6px; }
.chat-bubble.assistant p:last-child { margin-bottom: 0; }
.chat-bubble.assistant ul, .chat-bubble.assistant ol { margin: 2px 0 8px; padding-left: 1.25em; }
.chat-bubble.assistant li { margin-bottom: 3px; }
.chat-bubble.assistant li:last-child { margin-bottom: 0; }
.chat-bubble.assistant strong { font-weight: 700; }
.chat-bubble.assistant .task-item { list-style: none; margin-left: -1.25em; }
.chat-bubble.assistant .task-item label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.chat-bubble.assistant .task-box { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; accent-color: var(--color-primary); cursor: pointer; }
.chat-bubble.assistant .task-item label:has(.task-box:checked) { color: var(--color-text-muted); text-decoration: line-through; }
.typing-dots { display: inline-flex; gap: 4px; align-items: center; }
.typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--color-text-muted); animation: typingBounce 1.2s infinite ease-in-out; }
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }

.quick-prompt-row { display: flex; gap: var(--sp-2); overflow-x: auto; padding: 0 var(--sp-5) var(--sp-3); scrollbar-width: none; }
.quick-prompt-row::-webkit-scrollbar { display: none; }
.quick-prompt-chip { flex: 0 0 auto; padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-pill); background: var(--color-surface); border: 1px solid var(--color-border); font-size: 0.8125rem; white-space: nowrap; }

.ai-input-bar { display: flex; gap: var(--sp-2); padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--color-border); background: var(--color-bg); }
.ai-input-bar textarea {
  flex: 1; border: 1px solid var(--color-border); border-radius: 18px; padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-body); font-size: 0.9375rem; resize: none; max-height: 100px; background: var(--color-surface); color: var(--color-text);
}
.ai-send-btn { width: 46px; height: 46px; border-radius: 50%; background: var(--color-primary); color: #F2F1E8; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ai-send-btn:disabled { opacity: 0.5; }

.ai-offline-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: var(--sp-8) var(--sp-5); color: var(--color-text-muted); }

/* ---- Auth ---- */
.auth-wrap { padding: var(--sp-8) var(--sp-5); }
.auth-logo { text-align: center; margin-bottom: var(--sp-7); }
.auth-logo .al-icon { width: 64px; height: 64px; border-radius: var(--radius-pill); background: var(--color-primary); display: flex; align-items: center; justify-content: center; margin: 0 auto var(--sp-4); }
.auth-tabs { display: flex; background: var(--color-surface-alt); border-radius: var(--radius-pill); padding: 4px; margin-bottom: var(--sp-6); }
.auth-tab { flex: 1; text-align: center; padding: var(--sp-2) 0; border-radius: var(--radius-pill); font-size: 0.875rem; font-weight: 600; color: var(--color-text-muted); }
.auth-tab.active { background: var(--color-surface); color: var(--color-primary); box-shadow: var(--shadow-soft); }
.auth-error { background: rgba(192,57,43,0.1); color: var(--color-sos); font-size: 0.8125rem; padding: var(--sp-3); border-radius: 12px; margin-bottom: var(--sp-4); }
.skip-login-link { display: block; text-align: center; margin-top: var(--sp-5); font-size: 0.8125rem; color: var(--color-text-muted); }

@media (min-width: 481px) {
  .bottom-nav { border-radius: 0 0 24px 24px; }
}

/* ==========================================================================
   Responsif Tablet & Laptop — app-shell melebar mengikuti layar, bukan
   terjebak di lebar mobile (480px) dengan ruang kosong besar di kiri-kanan.
   ========================================================================== */
@media (min-width: 640px) {
  :root { --max-width: 680px; }
  .page { padding-left: var(--sp-7); padding-right: var(--sp-7); }
}

@media (min-width: 900px) {
  :root { --max-width: 900px; }
}

@media (min-width: 1200px) {
  :root { --max-width: 1180px; }
  .page { padding-left: var(--sp-8); padding-right: var(--sp-8); }
  .bottom-nav { bottom: var(--sp-5); border-radius: 24px; box-shadow: var(--shadow-lift); }
}

/* ---- Beranda: jadi dashboard 2 kolom di layar lebar (tablet ke atas) ---- */
@media (min-width: 900px) {
  .page-home {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--sp-6);
  }
  .page-home .area-header,
  .page-home .area-quick,
  .page-home .area-divider,
  .page-home .area-quote { grid-column: 1 / -1; }
}

/* ==========================================================================
   Peta Offline (PDF) — import, kalibrasi, & viewer
   ========================================================================== */

.map-input {
  width: 100%; min-height: 44px; padding: 0 var(--sp-3);
  border-radius: 12px; border: 1.5px solid var(--color-border);
  background: var(--color-bg); color: var(--color-text); font-size: 0.875rem;
  font-family: var(--font-body);
}
.map-input:focus { outline: none; border-color: var(--color-accent); }

/* ---- Kalibrasi: pratinjau gambar + marker ---- */
.calib-img-wrap { position: relative; width: 100%; max-height: 50vh; overflow: auto; cursor: crosshair; }
.calib-img-wrap img { width: 100%; display: block; }
.calib-markers, #calib-markers { position: absolute; inset: 0; pointer-events: none; }
.calib-marker {
  position: absolute; transform: translate(-50%, -50%);
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--color-primary); color: #F2F1E8; font-weight: 700; font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: var(--shadow-soft);
}

/* ---- Viewer full-screen ---- */
.map-viewer {
  position: fixed; inset: 0; background: var(--forest-950); z-index: 50;
  display: flex; flex-direction: column; overflow: hidden;
}
.map-topbar {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: calc(var(--sp-3) + env(safe-area-inset-top, 0px)) var(--sp-4) var(--sp-3);
  background: linear-gradient(180deg, rgba(20,33,15,0.85), rgba(20,33,15,0));
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
}
.map-topbar-title { flex: 1; color: #F2F1E8; font-weight: 700; font-size: 0.9375rem; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-topbar-btn {
  width: 38px; height: 38px; border-radius: var(--radius-pill); flex-shrink: 0;
  background: rgba(0,0,0,0.35); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.map-canvas-wrap { position: absolute; inset: 0; touch-action: none; }
#map-canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.map-uncalibrated-banner {
  position: absolute; top: calc(64px + env(safe-area-inset-top, 0px)); left: var(--sp-4); right: var(--sp-4); z-index: 3;
  background: rgba(156,122,79,0.94); color: #fff; font-size: 0.8125rem; font-weight: 600;
  padding: var(--sp-3); border-radius: 14px; display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
}
.map-uncalibrated-banner a { color: #fff; text-decoration: underline; }

.map-coord-readout {
  position: absolute; left: var(--sp-4); bottom: calc(var(--sp-4) + env(safe-area-inset-bottom, 0px));
  z-index: 3; background: rgba(0,0,0,0.5); backdrop-filter: blur(8px); color: #F2F1E8;
  font-family: var(--font-mono); font-size: 0.75rem; padding: 8px 12px; border-radius: 10px;
}

.map-fab-controls {
  position: absolute; right: var(--sp-4); bottom: calc(var(--sp-4) + env(safe-area-inset-bottom, 0px));
  z-index: 3; display: flex; flex-direction: column; gap: var(--sp-3); align-items: center;
}
.map-fab-controls .tracker-btn-round.active { background: var(--color-primary); color: #F2F1E8; border-color: var(--color-primary); }
.map-fab-controls .map-fab-labeled {
  width: auto; height: 40px; border-radius: var(--radius-pill); padding: 0 var(--sp-3);
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.map-fab-controls .map-fab-labeled span { font-size: 0.75rem; font-weight: 700; }

/* ==========================================================================
   Beranda — Polish Premium (hero, reveal-on-scroll, micro-interaksi)
   Semua animasi di sini otomatis dimatikan lewat prefers-reduced-motion
   global di tokens.css.
   ========================================================================== */

/* ---- Hero: eyebrow + judul, foto Ken Burns halus, sun-glow ambient ---- */
.hero-eyebrow {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.8125rem; letter-spacing: 0.01em;
}
.hero-eyebrow::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--moss-300); flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(156,185,127,0.55);
  animation: eyebrowPulse 2.4s var(--ease-out) infinite;
}
@keyframes eyebrowPulse {
  0%   { box-shadow: 0 0 0 0 rgba(156,185,127,0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(156,185,127,0); }
  100% { box-shadow: 0 0 0 0 rgba(156,185,127,0); }
}
.hero-title { line-height: 1.08; letter-spacing: -0.015em; }

.contour-header { isolation: isolate; }
.contour-header::after { transition: opacity 600ms var(--ease-out); }
.contour-header.has-hero-photo::before { animation: heroPan 26s ease-in-out infinite alternate; }
@keyframes heroPan {
  from { transform: scale(1.02) translate(0, 0); }
  to   { transform: scale(1.10) translate(-1%, -1%); }
}
/* Sun-glow ambient — titik cahaya halus yang mengambang pelan di balik konten hero */
.contour-header .hero-glow {
  position: absolute; top: -60px; right: -40px; width: 220px; height: 220px;
  border-radius: 50%; z-index: -1; pointer-events: none;
  background: radial-gradient(circle, rgba(156,185,127,0.35), transparent 70%);
  animation: glowDrift 9s ease-in-out infinite alternate;
}
@keyframes glowDrift {
  from { transform: translate(0, 0) scale(1); opacity: 0.7; }
  to   { transform: translate(-14px, 10px) scale(1.15); opacity: 1; }
}

#weather-widget.card-glass {
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255,255,255,0.22);
}
[data-theme="dark"] #weather-widget.card-glass {
  background: rgba(255,255,255,0.08);
}
#weather-widget .wx-icon { display: inline-flex; animation: floatY 4.2s ease-in-out infinite; }
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* ---- Reveal on scroll/load — dipicu class .in-view lewat IntersectionObserver ---- */
.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity 640ms var(--ease-out), transform 640ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---- Divider kontur: garis "digambar" saat halaman terbuka ---- */
.contour-divider path {
  stroke-dasharray: 900; stroke-dashoffset: 900;
  animation: drawContour 1.4s var(--ease-out) 250ms forwards;
}
@keyframes drawContour { to { stroke-dashoffset: 0; } }

/* ---- Quick actions: lift halus saat hover (desktop), stagger saat masuk ---- */
.quick-action {
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
  opacity: 0; transform: translateY(14px);
  animation: qaIn 560ms var(--ease-out) forwards;
  animation-delay: calc(var(--qa-i, 0) * 70ms + 120ms);
}
@keyframes qaIn { to { opacity: 1; transform: translateY(0); } }
@media (hover: hover) {
  .quick-action:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(20,33,15,0.16); }
}

/* ---- Badge: pop halus saat hover ---- */
.badge-icon { transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out); }
@media (hover: hover) {
  .badge:not(.locked):hover .badge-icon { transform: translateY(-3px) scale(1.06); box-shadow: var(--shadow-lift); }
}

/* ---- Kartu trip/riwayat: lift halus saat hover (desktop) ---- */
@media (hover: hover) {
  .trip-card { transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out); }
  .trip-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
}

/* ---- Statistik: angka "pop" singkat saat baru terisi ---- */
.stat-pill .val.pop { animation: statPop 420ms var(--ease-out); }
@keyframes statPop {
  0%   { transform: scale(0.85); opacity: 0.4; }
  60%  { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); }
}

/* ==========================================================================
   Image Positioner — modal geser & zoom foto sebelum diunggah
   ========================================================================== */
.imgpos-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(20,33,15,0.82);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-5);
}
.imgpos-panel {
  background: var(--color-surface); border-radius: 24px; padding: var(--sp-5);
  width: 100%; max-width: 420px; box-shadow: var(--shadow-lift);
}
.imgpos-title { font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; text-align: center; margin-bottom: var(--sp-3); }
.imgpos-frame {
  position: relative; width: 100%; overflow: hidden; border-radius: 16px;
  background: #000; touch-action: none; cursor: grab; margin: 0 auto;
}
.imgpos-frame--circle { border-radius: 50%; aspect-ratio: 1 !important; max-width: 260px; }
.imgpos-frame:active { cursor: grabbing; }
.imgpos-img {
  position: absolute; top: 50%; left: 50%; max-width: none;
  user-select: none; -webkit-user-drag: none;
}
.imgpos-zoom-row { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-4); color: var(--color-text-muted); }
.imgpos-zoom-row input[type="range"] { flex: 1; accent-color: var(--color-primary); }
.imgpos-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }

/* ==========================================================================
   Compass Overlay — dipakai baik sebagai tool berdiri sendiri (Trails)
   maupun dari dalam peta (map-viewer)
   ========================================================================== */
.compass-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(20,33,15,0.88);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-5);
}
.compass-panel {
  background: var(--color-surface); border-radius: 24px; padding: var(--sp-5);
  width: 100%; max-width: 340px; box-shadow: var(--shadow-lift);
  display: flex; flex-direction: column; align-items: center;
}
.compass-dial-wrap { position: relative; width: 220px; height: 220px; margin: var(--sp-2) 0; }
.compass-dial {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--color-border); background: var(--color-surface-alt);
  transition: transform 120ms linear;
}
.compass-label {
  position: absolute; font-family: var(--font-display); font-weight: 600; font-size: 1.125rem;
  color: var(--color-text); width: 24px; height: 24px; text-align: center;
}
.compass-label-n { top: 8px; left: 50%; transform: translateX(-50%); color: var(--color-sos); }
.compass-label-e { top: 50%; right: 8px; transform: translateY(-50%); }
.compass-label-s { bottom: 8px; left: 50%; transform: translateX(-50%); }
.compass-label-w { top: 50%; left: 8px; transform: translateY(-50%); }
.compass-fixed-pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  color: var(--color-primary); font-size: 1.5rem; line-height: 1;
}
.compass-heading-text { font-family: var(--font-mono); font-size: 2rem; font-weight: 700; color: var(--color-text); margin-top: var(--sp-2); }

/* Tombol bulat kompas di FAB peta (map-viewer) — konsisten dgn tombol lain */
#open-compass-btn { display: none; }

/* ==========================================================================
   Cuaca gunung — baris hari yang bisa diklik (ganti prakiraan per jam di atasnya)
   ========================================================================== */
.trail-day-row { transition: background 150ms var(--ease-out); background: none; }
#trail-daily-list { overflow: hidden; } /* biar highlight baris pertama/terakhir ikut lengkungan sudut card */
.trail-day-row.active { background: rgba(0,0,0,0.08); }
[data-theme="dark"] .trail-day-row.active { background: rgba(255,255,255,0.10); }

/* ==========================================================================
   Badge titik merah di ikon bottom-nav (mis. notifikasi pesan japri belum dibaca)
   ========================================================================== */
.nav-badge-dot {
  position: absolute; top: -2px; right: -3px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--color-sos); border: 1.5px solid var(--color-surface);
}
