:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --panel: #ffffff;
  --ink: #17211f;
  --muted: #5b6764;
  --line: #d8e0dc;
  --primary: #0f766e;
  --primary-strong: #0b5f58;
  --accent: #f59e0b;
  --danger: #b42318;
  --danger-bg: #fff1ef;
  --safe-bg: #eaf8f2;
  --shadow: 0 18px 50px rgba(23, 33, 31, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
}

.topbar {
  align-items: center;
  background: rgba(245, 247, 244, 0.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-weight: 800;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  aspect-ratio: 1;
  background: var(--ink);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-size: 13px;
  justify-content: center;
  width: 34px;
}

.topnav,
.footer {
  align-items: center;
  display: flex;
  gap: 18px;
}

.topnav a,
.footer a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.app-shell {
  margin: 0 auto;
  max-width: 1180px;
  padding: 28px 24px 48px;
}

.hero {
  align-items: center;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  min-height: 260px;
}

.hero-copy,
.hero-visual {
  min-width: 0;
}

.eyebrow {
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 44px;
  letter-spacing: 0;
  line-height: 1.04;
  margin-bottom: 16px;
  max-width: 680px;
  overflow-wrap: break-word;
}

.hero-text {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
  max-width: 640px;
}

.hero-visual {
  align-items: center;
  display: flex;
  justify-content: center;
}

.phone-card {
  aspect-ratio: 5 / 4;
  background: #102421;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: #fff;
  max-width: 360px;
  overflow: hidden;
  padding: 22px;
  position: relative;
  width: 100%;
}

.map-strip {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.16) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,0.12) 1px, transparent 1px);
  background-size: 34px 34px;
  inset: 0;
  opacity: 0.35;
  position: absolute;
}

.ride-row {
  align-items: center;
  background: rgba(255,255,255,0.95);
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 14px;
  position: relative;
  z-index: 1;
}

.ride-row span {
  background: var(--primary);
  border-radius: 99px;
  display: block;
  height: 12px;
  width: 72px;
}

.ride-row.muted span {
  background: var(--accent);
  width: 108px;
}

.route-line {
  border: 5px solid var(--accent);
  border-bottom: 0;
  border-left: 0;
  border-radius: 0 80px 0 0;
  bottom: 36px;
  height: 120px;
  position: absolute;
  right: 46px;
  width: 130px;
}

.tool-grid {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.calculator,
.results,
.history-section,
.guide-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.calculator,
.results {
  padding: 22px;
}

.section-title {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-title h2 {
  font-size: 20px;
  margin-bottom: 0;
}

.field-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 750;
  gap: 8px;
}

input,
select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  min-height: 46px;
  padding: 0 12px;
  width: 100%;
}

input:focus,
select:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

.money-input {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  overflow: hidden;
}

.money-input span {
  align-items: center;
  align-self: stretch;
  background: #eef4f1;
  color: var(--muted);
  display: flex;
  font-weight: 800;
  padding: 0 12px;
}

.money-input input {
  border: 0;
  border-radius: 0;
}

.costs {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.costs h3 {
  font-size: 16px;
  margin-bottom: 14px;
}

button,
.whatsapp-button {
  align-items: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  text-decoration: none;
}

.primary-button {
  background: var(--primary);
  color: #fff;
  margin-top: 6px;
  width: 100%;
}

.primary-button:hover {
  background: var(--primary-strong);
}

.secondary-button {
  background: #ecf3f0;
  color: var(--primary-strong);
}

.ghost-button {
  background: transparent;
  color: var(--muted);
  min-height: 34px;
  padding: 0 8px;
}

.whatsapp-button {
  background: #1f9d55;
  color: #fff;
}

.results {
  position: sticky;
  top: 84px;
}

.status-pill {
  background: var(--safe-bg);
  border-radius: 99px;
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 900;
  padding: 7px 10px;
}

.status-pill.warning {
  background: var(--danger-bg);
  color: var(--danger);
}

.big-number {
  background: #0d2925;
  border-radius: 8px;
  color: #fff;
  margin-bottom: 16px;
  padding: 20px;
}

.big-number span {
  color: rgba(255,255,255,0.72);
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
}

.big-number strong {
  display: block;
  font-size: 34px;
  line-height: 1.1;
}

.metric-list {
  display: grid;
  gap: 10px;
}

.metric-list div {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 48px;
}

.metric-list span {
  color: var(--muted);
}

.insight {
  background: #fff8ea;
  border: 1px solid #f4d69a;
  border-radius: 8px;
  color: #62410c;
  line-height: 1.45;
  margin-top: 16px;
  padding: 14px;
}

.insight.warning {
  background: var(--danger-bg);
  border-color: #ffccc7;
  color: var(--danger);
}

.share-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
}

.history-section,
.guide-section {
  margin-top: 22px;
  padding: 22px;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  align-items: center;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
}

.history-item strong,
.history-item span {
  display: block;
}

.history-item span {
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  color: var(--muted);
  margin-bottom: 0;
}

.guide-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guide-grid article {
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.guide-grid p {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0;
  margin-top: 8px;
}

.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  justify-content: center;
  min-height: 72px;
  padding: 0 20px;
}

.simple-page {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  line-height: 1.6;
  margin: 48px auto;
  max-width: 760px;
  padding: 28px;
}

.simple-page h1 {
  font-size: 36px;
}

.back-link {
  color: var(--primary);
  display: inline-block;
  font-weight: 800;
  margin-bottom: 18px;
  text-decoration: none;
}

@media (max-width: 860px) {
  .topbar {
    padding: 0 16px;
  }

  .app-shell {
    padding: 22px 14px 36px;
  }

  .hero,
  .tool-grid,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    font-size: 36px;
  }

  .hero-text {
    font-size: 16px;
  }

  .hero-visual {
    display: none;
  }

  .results {
    position: static;
  }
}

@media (max-width: 560px) {
  .topnav {
    display: none;
  }

  .field-row,
  .share-row {
    grid-template-columns: 1fr;
  }

  .calculator,
  .results,
  .history-section,
  .guide-section {
    padding: 16px;
  }

  .big-number strong {
    font-size: 28px;
  }
}
