:root {
  --bg: #070b14;
  --bg-2: #10182a;
  --card: #151c31;
  --card-2: #1c2540;
  --line: rgba(255, 236, 200, 0.1);
  --gold: #e7c56a;
  --gold-2: #f3dd9a;
  --red: #c94b45;
  --green: #3aa56d;
  --text: #f6f1e6;
  --muted: #b7ae9c;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --tap: 56px;
  --font: "SF Pro Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "SF Pro Display", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.4;
}

body {
  background:
    radial-gradient(900px 420px at 50% -80px, #24345c 0%, transparent 70%),
    radial-gradient(500px 280px at 100% 0%, rgba(201, 75, 69, 0.18), transparent 60%),
    var(--bg);
}

button,
input {
  font: inherit;
}

a {
  color: var(--gold);
}

.app {
  width: min(430px, 100%);
  margin: 0 auto;
  padding: 18px 16px 48px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.kicker {
  margin: 0;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
}

h1 {
  font-family: var(--display);
  font-size: 1.55rem;
  line-height: 1.15;
  margin: 4px 0 0;
  font-weight: 750;
}

.help-btn {
  flex: none;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.courtesy {
  background: rgba(58, 165, 109, 0.12);
  border: 1px solid rgba(58, 165, 109, 0.28);
  color: #d8f3e3;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 18px;
  font-size: 15px;
}

.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: #1a1406;
  font-weight: 800;
  font-size: 14px;
  margin-right: 8px;
}

h2 {
  display: flex;
  align-items: center;
  font-size: 1.12rem;
  margin: 0 0 12px;
}

.hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
}

.stack {
  display: grid;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 12px 16px;
  border: 0;
  border-radius: 14px;
  font-weight: 700;
  text-decoration: none;
  color: #1a1406;
  background: var(--gold);
  cursor: pointer;
  width: 100%;
}

.btn:active {
  transform: translateY(1px);
}

.btn-green {
  background: var(--green);
  color: #04150c;
}

.btn-ghost {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-apple {
  background: #f4f4f5;
  color: #111;
}

.btn-google {
  background: #1a73e8;
  color: #fff;
}

.btn.done {
  opacity: 0.55;
}

.search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.search input {
  min-height: var(--tap);
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #0c1220;
  color: var(--text);
  padding: 0 14px;
}

.results {
  display: grid;
  gap: 6px;
}

.hit,
.start-pill {
  min-height: 48px;
  text-align: left;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0c1220;
  color: var(--text);
  padding: 10px 12px;
}

.start-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.start-pill .copy {
  min-width: 0;
}

.start-pill .change {
  flex: none;
  min-height: 40px;
  padding: 6px 12px;
  width: auto;
  font-size: 14px;
}

.start-pill strong,
.hit strong {
  display: block;
}

.start-pill span,
.hit span,
.muted {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.ok {
  background: rgba(58, 165, 109, 0.16);
  border-color: rgba(58, 165, 109, 0.4);
}

.error {
  color: #ffb4ae;
  font-size: 15px;
  margin: 0;
}

.toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #0c1220;
  padding: 5px;
  border-radius: 14px;
  margin-bottom: 12px;
}

.toggle button {
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.toggle button[aria-pressed="true"] {
  background: var(--gold);
  color: #1a1406;
}

.stepper {
  display: grid;
  grid-template-columns: var(--tap) 1fr var(--tap);
  gap: 10px;
  align-items: center;
}

.stepper button {
  width: var(--tap);
  height: var(--tap);
  border-radius: 14px;
  border: 0;
  background: var(--card-2);
  color: var(--text);
  font-size: 28px;
  font-weight: 700;
}

.stepper output {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
  height: 32px;
}

.chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.chips button {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0c1220;
  color: var(--text);
  font-weight: 700;
}

.chips button[aria-pressed="true"] {
  background: var(--gold);
  color: #1a1406;
  border-color: transparent;
}

.plan-btn {
  min-height: 64px;
  font-size: 1.15rem;
  margin: 8px 0 16px;
}

.summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.metric {
  background: #0c1220;
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}

.metric b {
  display: block;
  font-size: 0.95rem;
  white-space: nowrap;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

#map {
  height: 170px;
  border-radius: 14px;
  margin: 10px 0 14px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.parts {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.part {
  display: grid;
  gap: 8px;
  background: var(--card-2);
  border-radius: 14px;
  padding: 12px;
}

.part-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.tick {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
}

.tick input {
  width: 22px;
  height: 22px;
  accent-color: var(--green);
}

.stops {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.stop {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  background: #0c1220;
  border-radius: 14px;
  padding: 8px;
  border: 1px solid transparent;
}

.stop img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  background: #111;
}

.stop h3 {
  margin: 0 0 2px;
  font-size: 1rem;
}

.stop p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.stop .notes {
  margin-top: 6px;
  font-size: 14px;
  color: #ddd4c4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.foot {
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
}

.foot p {
  margin: 0 0 8px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.78);
  display: grid;
  place-items: end center;
  padding: 16px;
  z-index: 20;
}

[hidden] {
  display: none !important;
}

.sheet {
  width: min(430px, 100%);
  background: var(--card);
  border-radius: 20px 20px 16px 16px;
  padding: 18px 16px 22px;
  border: 1px solid var(--line);
}

.sheet h2 {
  margin-bottom: 10px;
}

.sheet ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.sheet li {
  margin: 0 0 8px;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 30;
  display: grid;
  align-content: center;
  padding: 16px;
}

.lightbox img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
}

.lightbox p {
  color: #ddd;
  font-size: 14px;
  margin: 10px 0 14px;
}

.busy {
  opacity: 0.7;
  pointer-events: none;
}

.leaflet-container {
  background: #0b1020;
  font-family: var(--font);
}

@media (min-width: 720px) {
  .app {
    width: min(520px, 100%);
    padding-top: 28px;
  }
}
