:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #dbe3ef;
  --primary: #0f172a;
  --primaryText: #ffffff;
  --soft: #eef2f7;
  --danger: #b91c1c;
  --ok: #15803d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 18px 12px 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 20px;
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.card {
  background: var(--card);
  border-radius: 26px;
  padding: 22px;
  box-shadow: 0 12px 30px rgba(15,23,42,.08);
  margin-bottom: 14px;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -.7px;
}

h2 {
  margin: 0 0 10px;
}

p {
  line-height: 1.5;
  color: var(--muted);
}

label strong {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
}

input[type="text"],
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  font-size: 15px;
  line-height: 1.5;
  outline: none;
  background: white;
  color: var(--text);
}

input[type="text"]:focus,
textarea:focus {
  border-color: var(--primary);
}

textarea {
  min-height: 230px;
  resize: vertical;
}

textarea.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.12);
}

button,
.button-link {
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 15px 16px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
}

button:disabled {
  opacity: .65;
  cursor: not-allowed;
}

.primary {
  background: var(--primary);
  color: var(--primaryText);
}

.secondary {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}

.ghost {
  background: transparent;
  color: var(--muted);
}

.small {
  width: auto;
  min-height: 40px;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 14px;
}

.light {
  background: var(--soft);
  color: var(--text);
}

.stack {
  display: grid;
  gap: 10px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}

.badge {
  background: var(--soft);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 800;
}

.info {
  margin-top: 18px;
  background: var(--soft);
  border-radius: 18px;
  padding: 14px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}

.pro-info {
  background: #ecfdf3;
  color: #14532d;
  border: 1px solid #bbf7d0;
}

.alert {
  display: none;
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: 16px;
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.alert.show {
  display: block;
}

.stop-list,
.route-list {
  display: grid;
  gap: 10px;
}

.stop,
.route-item {
  display: flex;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  background: #fff;
}

.stop small,
.route-body small {
  display: block;
  margin-top: 4px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.4;
}

.number {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  flex-shrink: 0;
}

.route-body {
  flex: 1;
  min-width: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.actions button,
.actions a {
  width: auto;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.actions a.call-link {
  background: #ecfdf3;
  color: #14532d;
  border-color: #bbf7d0;
}

.next {
  background: var(--primary);
  color: white;
  border-radius: 24px;
  padding: 18px;
  margin-bottom: 18px;
  display: grid;
  gap: 10px;
}

.next p,
.next small {
  color: #cbd5e1;
}

.next h2 {
  margin-top: 6px;
  color: white;
}

.next .button-link {
  background: white;
  color: var(--text);
}

.next .button-link.call-main {
  background: #dcfce7;
  color: #14532d;
}

.done {
  opacity: 1;
  background: #ecfdf3;
  border-color: #bbf7d0;
}

.done .number {
  background: #15803d;
  color: #ffffff;
}

.done .route-body strong {
  color: #14532d;
}

.done .route-meta {
  color: #15803d;
  font-weight: 800;
}

.done-box {
  background: #ecfdf3;
  color: #14532d;
  border-radius: 24px;
  padding: 18px;
  margin-bottom: 18px;
}

.done-box p {
  color: #166534;
}

.hidden {
  display: none !important;
}

.paywall {
  border: 2px solid var(--primary);
}

.install-box {
  display: none;
  background: #dcfce7;
  color: #14532d;
  border-radius: 18px;
  padding: 14px;
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 14px;
}

.route-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.phone-meta {
  margin-top: 5px;
  color: var(--ok);
  font-size: 12px;
  font-weight: 800;
}

.skipped {
  opacity: .65;
  background: #f8fafc;
  border-style: dashed;
}

.route-map {
  width: 100%;
  height: 320px;
  border-radius: 22px;
  overflow: hidden;
  margin: 14px 0 18px;
  border: 1px solid var(--border);
  background: var(--soft);
  position: relative;
  z-index: 1;
}

.route-map .leaflet-container,
.leaflet-container {
  font-family: Arial, sans-serif;
}

.map-note {
  margin-top: -6px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.leaflet-popup-content {
  font-family: Arial, sans-serif;
  font-size: 14px;
}

.leaflet-popup-content strong {
  display: block;
  margin-bottom: 4px;
}

.map-pin {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  border: 3px solid #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.28);
}

.map-pin.is-done {
  background: #15803d;
}

.map-pin.is-skipped {
  background: #b45309;
}

.map-pin.is-end {
  background: #2563eb;
}

@media (max-width: 420px) {
  .route-map {
    height: 260px;
  }
}

@media (max-width: 380px) {
  h1 {
    font-size: 26px;
  }

  .card {
    padding: 18px;
    border-radius: 22px;
  }
}
.brand-ico {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  flex: 0 0 42px;
}

.brand-ico img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.route-hero-image {
    margin: -24px -24px 24px;
    overflow: hidden;
    border-radius: 18px 18px 0 0;
}

.route-hero-image img {
    display: block;
    width: 100%;
    height: auto;
}