/* RuralPin — Topo Slate theme (picked by Kody 2026-11-21).
   Dark blue-gray slate panels, faint topographic contour texture,
   one survey-amber accent. White theme backed up in app-white.css.bak. */
* { box-sizing: border-box; }
@font-face { font-family: "Amatic SC"; src: url(fonts/amatic-sc-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url(fonts/inter-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url(fonts/inter-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url(fonts/inter-latin-800-normal.woff2) format("woff2"); font-weight: 800; font-display: swap; }

html, body { margin: 0; height: 100%; font-family: "Inter", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; background: #14181d; }
#map { position: fixed; inset: 0; }
.hidden { display: none !important; }

:root {
  --slate: #20262d;
  --slate-raised: #273039;
  --ink: #151a1f;
  --bone: #edeae1;
  --bone-dim: #cfd4d8;
  --muted: #9fabb4;
  --line: #39434d;
  --amber: #e39a2d;
  --amber-hi: #f2ac3c;
  --amber-text: #1a1206;
  --topo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260' viewBox='0 0 260 260'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.05' stroke-width='1.2'%3E%3Cpath d='M-20 70 C40 40 90 100 150 80 S250 30 290 60'/%3E%3Cpath d='M-20 95 C45 65 95 125 155 105 S255 55 290 85'/%3E%3Cpath d='M-20 45 C35 20 85 75 145 55 S245 5 290 35'/%3E%3Cpath d='M-20 190 C50 160 100 215 160 195 S250 150 290 180'/%3E%3Cpath d='M-20 215 C55 185 105 240 165 220 S255 175 290 205'/%3E%3Cpath d='M-20 165 C45 138 95 190 155 170 S245 125 290 155'/%3E%3Ccircle cx='215' cy='118' r='26'/%3E%3Ccircle cx='215' cy='118' r='14'/%3E%3C/g%3E%3C/svg%3E");
  --glow: radial-gradient(130% 150% at 85% -10%, rgba(227, 154, 45, .18), rgba(227, 154, 45, 0) 55%);
}

#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 10px 8px;
  background-color: rgba(28, 34, 41, .97); background-image: var(--glow);
  box-shadow: 0 1px 8px rgba(0,0,0,.5);
  border-bottom: 1px solid var(--line);
}
#brand { display: flex; align-items: center; gap: 8px; font-family: "Amatic SC", "Inter", sans-serif; font-weight: 700; font-size: 32px; line-height: 1; color: var(--bone); letter-spacing: 1.5px; }
#searchwrap { position: relative; margin-top: 8px; }
#search {
  width: 100%; height: 48px; font-size: 17px; padding: 0 12px;
  border: 1.5px solid var(--line); border-radius: 10px; outline: none;
  background: var(--ink); color: var(--bone);
}
#search:focus { border-color: var(--amber); }
#search::placeholder { color: #7d8891; }
#results {
  position: absolute; top: 52px; left: 0; right: 0; z-index: 20;
  max-height: 60vh; overflow-y: auto;
  background-color: var(--slate-raised); background-image: var(--glow);
  border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.55); overflow: hidden;
}
.result { padding: 12px; border-bottom: 1px solid #333d46; cursor: pointer; }
.result:last-child { border-bottom: none; }
.result .addr { font-size: 16px; font-weight: 600; color: var(--bone); }
.result .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.result:active { background: #313b44; }
#startbar { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
#startlabel { font-size: 13px; color: var(--bone-dim); font-weight: 600; flex: 1 1 auto; min-width: 130px; }
button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button.mini {
  min-height: 40px; padding: 6px 10px; font-size: 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--slate-raised); color: var(--bone); font-weight: 600;
}
button.mini.armed { background: var(--amber); border-color: var(--amber); color: var(--amber-text); }

#layerbtns { position: fixed; top: 174px; right: 10px; z-index: 9; display: flex; flex-direction: column; gap: 8px; }
button.layer {
  min-height: 44px; padding: 8px 12px; font-size: 15px; font-weight: 700; border-radius: 10px;
  border: 1px solid var(--line);
  background-color: rgba(32, 38, 45, .95); background-image: var(--glow);
  color: var(--bone); box-shadow: 0 3px 10px rgba(0,0,0,.45);
}
button.layer.on { background: var(--amber); border-color: var(--amber); color: var(--amber-text); }
#parcelnote {
  position: fixed; top: 158px; left: 10px; z-index: 9; max-width: 55vw;
  background: rgba(21, 26, 31, .94); color: var(--bone); font-size: 12.5px; line-height: 1.35;
  padding: 8px 10px; border-radius: 8px; border-left: 3px solid var(--amber);
}

#sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  max-height: 52vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background-color: rgba(28, 34, 41, .98); background-image: var(--glow);
  border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 22px rgba(0,0,0,.55);
  padding: 14px 14px calc(20px + env(safe-area-inset-bottom, 0px));
}
.cardtitle { font-family: "Amatic SC", "Inter", sans-serif; font-size: 25px; font-weight: 700; letter-spacing: .8px; color: var(--bone); }
.cardsub { font-size: 13.5px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.btnrow { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
button.primary {
  min-height: 48px; padding: 10px 18px; font-size: 16px; font-weight: 700;
  background: var(--amber); color: var(--amber-text); border: none; border-radius: 10px;
}
button.primary:active { background: var(--amber-hi); }
button.ghostbtn {
  min-height: 48px; padding: 10px 14px; font-size: 15px; font-weight: 600;
  background: transparent; color: var(--bone); border: 1.5px solid var(--line); border-radius: 10px;
}
#steps { margin: 10px 0 0; padding-left: 22px; max-height: 30vh; overflow-y: auto; }
#steps li { font-size: 15px; padding: 7px 0; border-bottom: 1px solid #333d46; color: var(--bone-dim); }
#steps li .dist { color: var(--muted); font-size: 13px; }
#propfields { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 10px 0 4px; font-size: 15px; }
#propfields dt { color: var(--muted); font-weight: 600; }
#propfields dd { margin: 0; font-weight: 600; color: var(--bone); word-break: break-word; }
#wplist { list-style: none; margin: 8px 0; padding: 0; }
#wplist li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #333d46; font-size: 16px; color: var(--bone-dim); }
#wplist li .nm { flex: 1; font-weight: 600; cursor: pointer; }
#wplist li button { min-height: 38px; min-width: 44px; border-radius: 8px; border: 1px solid #b0503f; background: transparent; color: #e08a76; font-size: 15px; }
#wpname { width: 100%; height: 48px; font-size: 16px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 10px; margin-top: 10px; background: var(--ink); color: var(--bone); }

.pin-marker { width: 30px; height: 30px; margin-top: -6px; }
.start-marker { width: 18px; height: 18px; border-radius: 50%; background: #5b8dc9; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.5); }
.ghost-marker { width: 20px; height: 20px; border-radius: 50%; background: #777; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.5); opacity: .85; }
.wp-marker { font-size: 22px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); cursor: pointer; }

#toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(60px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  background: rgba(16, 20, 24, .96); color: var(--bone); font-size: 14.5px; padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 10px; max-width: 88vw; text-align: center;
}

/* ---------- navigation mode ---------- */
/* Layer buttons STAY in nav (Kody, 2026-11-22: he could not switch
   satellite/streets mid-drive). The bottom Exit hides — the big top
   ✕ Exit is the one button. */
body.navigating #topbar, body.navigating #parcelnote { display: none !important; }
body.navigating #btn-exitnav { display: none !important; }
body.navigating #layerbtns { top: 150px; }
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 25;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 12px;
  background-color: rgba(28, 34, 41, .98); background-image: var(--glow);
  border-bottom: 2px solid var(--amber);
  box-shadow: 0 2px 14px rgba(0,0,0,.6);
}
#nav-dist { font-size: 32px; font-weight: 800; color: var(--amber); line-height: 1.05; }
#nav-text { font-size: 20px; font-weight: 600; color: var(--bone); line-height: 1.25; margin-top: 2px; }
#nav-then { font-size: 14.5px; color: var(--muted); margin-top: 4px; }
#navbottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background-color: rgba(28, 34, 41, .98); background-image: var(--glow);
  border-top: 1px solid var(--line);
  box-shadow: 0 -3px 14px rgba(0,0,0,.55);
}
#nav-remain { flex: 1; font-size: 17px; font-weight: 700; color: var(--bone); }
#navbottom button { min-height: 46px; }
#btn-exitnav { border-color: #b0503f; color: #e08a76; font-weight: 700; padding: 0 20px; }
#btn-exitnav2 { float: right; border-color: #b0503f; color: #e08a76; font-weight: 700; min-height: 44px; padding: 0 16px; margin-left: 10px; }
#nav-icon { float: left; font-size: 32px; line-height: 1.1; margin: 3px 10px 0 0; color: var(--amber); min-width: 36px; }
.user-dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--amber); border: 3.5px solid #fff;
  box-shadow: 0 0 0 6px rgba(227,154,45,.35), 0 1px 8px rgba(0,0,0,.6);
}
/* The navigation vehicle: top-down car, heading-rotated by aimPuck(). */
.vehicle-puck { width: 46px; height: 46px; }
.vehicle-puck svg {
  width: 100%; height: 100%; display: block;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.5));
}

/* ---------- WS3: small-screen compaction ---------- */
@media (max-width: 560px) {
  #brand { font-size: 26px; }
  #search { height: 44px; }
}
@media (max-height: 500px) {
  #sheet { max-height: 68vh; }
}

/* ---------- driving preview chip ---------- */
#previewchip {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: calc(14px + env(safe-area-inset-top, 0px)); z-index: 24;
  background: rgba(16, 20, 24, .94); color: var(--bone);
  font-size: 14px; font-weight: 600; padding: 9px 14px;
  border: 1px solid var(--amber); border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0,0,0,.5); pointer-events: none;
}

/* ---------- motion (premium, cheap: transform/opacity only) ---------- */
@keyframes pinsettle {
  0% { transform: translateY(-14px); opacity: 0; }
  60% { transform: translateY(2px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}
.pin-marker { animation: pinsettle .45s cubic-bezier(.2,.7,.3,1) both; }
#sheet { transition: opacity .25s ease, transform .25s ease; }
#navbar, #navbottom { transition: opacity .25s ease; }
button.primary, button.ghostbtn, button.layer, button.mini {
  transition: transform .12s ease, background-color .15s ease;
}
button.primary:active, button.layer:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) {
  .pin-marker { animation: none; }
  #sheet, #navbar, #navbottom,
  button.primary, button.ghostbtn, button.layer, button.mini { transition: none; }
}

#aboutlink {
  margin-left: auto; font-family: "Inter", sans-serif; font-size: 13.5px;
  font-weight: 600; letter-spacing: 0; color: var(--muted);
  text-decoration: none; padding: 8px 4px;
}
#aboutlink:active { color: var(--amber); }

/* ---------- offline packs (P0-5) ---------- */
#offlinebadge {
  position: fixed; left: 0; right: 0; top: 118px; z-index: 9;
  background: rgba(16, 20, 24, .95); color: var(--bone);
  border-bottom: 1px solid var(--amber);
  font-size: 13px; font-weight: 600; text-align: center; padding: 7px 10px;
}
#offlinepanel > div { margin-top: 10px; }
.offpackrow {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line);
}
.offpackrow .cardsub { margin-top: 0; }
