:root {
  --bg-top: #1a1f36; --bg-bottom: #0d1021; --accent: #ff6b4a;
  --accent-glow: rgba(255, 107, 74, 0.35); --card: rgba(255,255,255,0.06);
  --text: #f4f4f7; --muted: #9498ac;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  height: 100%; margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at 50% 0%, var(--bg-top), var(--bg-bottom) 70%);
  color: var(--text); overflow-x: hidden;
}
button { border: none; font-family: inherit; cursor: pointer; }

.wrap { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 24px 16px 40px; }
.title { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }

.install-banner {
  width: 100%; max-width: 420px; background: linear-gradient(135deg, rgba(255,107,74,0.15), rgba(255,74,107,0.1));
  border: 1px solid rgba(255,107,74,0.3); border-radius: 20px; padding: 18px 20px;
  margin-bottom: 20px; text-align: center; position: relative;
}
.install-banner .step-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.install-banner .step-body { font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.install-banner .step-body b { color: var(--text); }
.install-big-btn {
  width: 100%; padding: 16px; border-radius: 14px; margin-top: 12px;
  background: linear-gradient(135deg, #ff6b4a, #ff4a6b); color: white;
  font-size: 16px; font-weight: 700; box-shadow: 0 6px 18px var(--accent-glow);
}
.install-close {
  position: absolute; top: 10px; right: 12px; background: none; color: var(--muted);
  font-size: 18px; line-height: 1; padding: 4px; opacity: 0.6;
}

.list { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 12px; }

.empty {
  text-align: center; color: var(--muted); font-size: 14.5px; line-height: 1.6;
  padding: 40px 20px; opacity: 0.8;
}

.spot-card {
  background: var(--card); border: 1px solid rgba(255,255,255,0.08); border-radius: 20px;
  padding: 18px 18px 16px; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.spot-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.spot-icon { font-size: 22px; }
.spot-name { font-size: 16px; font-weight: 700; flex: 1; }
.spot-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.spot-coords { font-size: 11.5px; color: var(--muted); opacity: 0.6; font-family: ui-monospace, monospace; margin-bottom: 14px; }
.trail-note { font-size: 11px; color: var(--muted); opacity: 0.6; margin-top: 10px; text-align: center; line-height: 1.5; }
.spot-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 44px; border-radius: 12px; background: rgba(255,255,255,0.06);
  color: var(--muted); border: 1px solid rgba(255,255,255,0.08); font-size: 16px;
}
.icon-btn:active { transform: scale(0.94); }


.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: flex-end;
  z-index: 10;
}
.sheet {
  width: 100%; max-width: 480px; margin: 0 auto; background: #171b30;
  border-radius: 24px 24px 0 0; padding: 22px 20px 28px; border: 1px solid rgba(255,255,255,0.08);
}
.sheet-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; text-align: center; }
.cat-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; justify-content: center; }
.cat-chip {
  padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08); color: var(--text); font-size: 13.5px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.cat-chip.selected { background: linear-gradient(135deg, #ff6b4a, #ff4a6b); border-color: transparent; }
.save-btn {
  width: 100%; padding: 16px; border-radius: 14px;
  background: linear-gradient(135deg, #ff6b4a, #ff4a6b); color: white;
  font-size: 16px; font-weight: 700; box-shadow: 0 8px 24px var(--accent-glow);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.save-btn:active { transform: scale(0.97); }
.cancel-btn { width: 100%; padding: 12px; margin-top: 10px; background: none; color: var(--muted); font-size: 14px; }
.error-msg { color: #ff8080; font-size: 13px; margin-top: 10px; text-align: center; min-height: 16px; }

.pin-drop { animation: pinDrop 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) both; transform-origin: center bottom; }
@keyframes pinDrop {
  0%   { transform: translateY(-60px) scale(0.6); opacity: 0; }
  55%  { transform: translateY(5px) scale(1.15); opacity: 1; }
  75%  { transform: translateY(-3px) scale(0.96); }
  100% { transform: translateY(0) scale(1); }
}

.credit { margin-top: 28px; text-align: center; font-size: 12px; color: var(--muted); opacity: 0.6; }

.share-btn {
  width: 100%; max-width: 420px; margin-top: 16px; padding: 15px; border-radius: 14px;
  background: rgba(255,255,255,0.06); color: var(--text); font-size: 14.5px; font-weight: 600;
  border: 1px solid rgba(255,255,255,0.1);
}
.share-btn:active { transform: scale(0.97); }
.share-note { margin-top: 8px; font-size: 12.5px; color: var(--muted); text-align: center; word-break: break-all; padding: 0 8px; max-width: 420px; }

/* Tip jar. Collapsed to a single quiet line so it never competes with the
   buttons that actually find your car. */
.tip-box { width: 100%; max-width: 420px; margin-top: 10px; }
.tip-toggle {
  width: 100%; padding: 13px; border-radius: 14px; background: none;
  color: var(--muted); font-size: 13.5px; font-weight: 600;
  border: 1px solid rgba(255,255,255,0.08);
}
.tip-toggle:active { transform: scale(0.97); }
.tip-panel {
  margin-top: 10px; padding: 16px; border-radius: 16px;
  background: var(--card); border: 1px solid rgba(255,255,255,0.08); text-align: center;
}
.tip-coin { font-size: 15px; font-weight: 700; letter-spacing: 0.4px; }
.tip-label { margin-top: 4px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.tip-address {
  margin-top: 12px; padding: 12px 10px; border-radius: 12px;
  background: rgba(0,0,0,0.28); border: 1px solid rgba(255,255,255,0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
  line-height: 1.6; word-break: break-all; -webkit-user-select: all; user-select: all;
}
.tip-copy {
  width: 100%; margin-top: 10px; padding: 14px; border-radius: 12px;
  background: rgba(255,255,255,0.08); color: var(--text); font-size: 14.5px; font-weight: 700;
  border: 1px solid rgba(255,255,255,0.12);
}
.tip-copy:active { transform: scale(0.97); }
.tip-note { margin-top: 10px; font-size: 11.5px; color: var(--muted); opacity: 0.75; line-height: 1.5; }

/* Two big, clearly-labeled action buttons (replaces the ambiguous floating + button) */
.action-row { display: flex; gap: 10px; width: 100%; max-width: 420px; margin-bottom: 18px; }
.action-btn {
  flex: 1; padding: 16px 8px; border-radius: 18px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1); color: var(--text); font-size: 14.5px; font-weight: 700;
  line-height: 1.9;
}
.action-btn:active { transform: scale(0.96); }
.action-btn:disabled { opacity: 0.4; }

.note-input {
  width: 100%; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 13px 14px; color: var(--text); font-size: 15px; outline: none;
}
.note-input::placeholder { color: var(--muted); }
.note-input:focus { border-color: var(--accent); }

/* Press-and-hold accuracy capture */
.hold-btn { position: relative; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; }
.hold-btn .hold-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: rgba(255,255,255,0.28); transition: width 0.05s linear; }
.hold-btn .hold-label { position: relative; z-index: 1; }
.hold-btn.holding { box-shadow: 0 0 0 4px rgba(255,255,255,0.15), 0 8px 24px var(--accent-glow); }
.hold-hint { margin-top: 8px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.5; opacity: 0.8; }

/* Hike recording card */
.hike-recording {
  width: 100%; max-width: 420px; background: linear-gradient(135deg, rgba(120,200,140,0.14), rgba(80,170,255,0.08));
  border: 1px solid rgba(140,220,160,0.3); border-radius: 20px; padding: 20px; margin-bottom: 18px; text-align: center;
}
.hike-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.hike-count { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.drop-btn {
  width: 100%; padding: 20px; border-radius: 16px; font-size: 17px; font-weight: 700;
  background: linear-gradient(135deg, #34c77b, #22a4a0); color: white;
  box-shadow: 0 8px 24px rgba(52,199,123,0.35);
}
.drop-btn:active { transform: scale(0.96); }
.drop-btn:disabled { opacity: 0.6; }
.hike-buttons { display: flex; gap: 8px; margin-top: 12px; }

/* Card actions: homing is the headline action, map hand-off is secondary */
.spot-actions a { text-decoration: none; flex: 1; display: block; }
.guide-btn {
  width: 100%; padding: 14px; border-radius: 13px; margin-bottom: 8px;
  background: linear-gradient(135deg, #ff6b4a, #ff4a6b); color: white;
  font-size: 15px; font-weight: 700; box-shadow: 0 6px 18px var(--accent-glow);
}
.guide-btn:active { transform: scale(0.97); }
.secondary-act {
  width: 100%; padding: 12px 4px; border-radius: 12px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08); color: var(--text); font-size: 13px; font-weight: 600;
}
.secondary-act:active { transform: scale(0.95); }
.spot-alt { margin-top: 10px; text-align: center; font-size: 11.5px; color: var(--muted); opacity: 0.75; }
.spot-alt a { color: var(--muted); }

/* Homing screen — pure math on GPS fixes: no tiles, no API key, works with
   no signal, which is the whole point out where this app gets used. */
body.homing-open { overflow: hidden; }
.homing {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  padding: calc(28px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
  background: radial-gradient(circle at 50% 28%, #1e2444, #0b0e1c 70%);
}
.homing-close {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 16px;
  width: 40px; height: 40px; border-radius: 20px; font-size: 17px;
  background: rgba(255,255,255,0.08); color: var(--text);
}
.homing-name { font-size: 17px; font-weight: 700; text-align: center; }
.homing-dial {
  width: 208px; height: 208px; border-radius: 50%; position: relative;
  border: 2px solid rgba(255,255,255,0.12);
  background: radial-gradient(circle, rgba(255,107,74,0.12), transparent 65%);
  display: flex; align-items: center; justify-content: center;
}
/* Fixed index mark at the top of the dial = the way you are facing */
.homing-dial::before {
  content: ''; position: absolute; top: 8px; width: 2px; height: 12px;
  background: rgba(255,255,255,0.3); border-radius: 1px;
}
.homing-arrow {
  font-size: 86px; line-height: 1; color: var(--accent);
  text-shadow: 0 0 24px var(--accent-glow); transition: transform 0.25s ease-out;
}
.homing-arrow.arrived { color: #34c77b; text-shadow: 0 0 30px rgba(52,199,123,0.5); }
.homing-distance { font-size: 46px; font-weight: 800; letter-spacing: -1px; text-align: center; }
.homing-sub { font-size: 14px; color: var(--muted); text-align: center; min-height: 20px; line-height: 1.5; }
.homing-btn {
  width: 100%; max-width: 320px; padding: 15px; border-radius: 14px;
  background: linear-gradient(135deg, #ff6b4a, #ff4a6b); color: white;
  font-size: 15px; font-weight: 700;
}
.homing-btn.ghost { background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); color: var(--text); }
.homing-btn:active { transform: scale(0.97); }
.homing-note { font-size: 12px; color: var(--muted); opacity: 0.7; text-align: center; line-height: 1.5; max-width: 320px; }

