:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f8f9fa;
  --text: #20252b;
  --muted: #69727d;
  --line: #dee2e6;
  --line-strong: #ced4da;
  --primary: #0d6efd;
  --primary-dark: #0a58ca;
  --primary-soft: #e7f1ff;
  --success: #198754;
  --success-soft: #eaf7ef;
  --accent: #6f42c1;
  --warning-soft: #fff6e5;
  --danger: #dc3545;
  --danger-soft: #fff1f2;
  --shadow: 0 8px 24px rgba(33, 37, 41, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

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

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: end;
  padding: 10px 0 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.headline-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand-mark svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

h1 {
  max-width: 720px;
  margin-bottom: 10px;
  font-size: clamp(32px, 4.5vw, 54px);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  color: #2b3035;
  font-size: 19px;
  line-height: 1.25;
}

.lead {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.hero-panel,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
}

.hero-panel-title {
  grid-column: 1 / -1;
  border-bottom: 1px solid var(--line);
}

.hero-panel div {
  padding: 15px 16px;
}

.hero-panel div + div {
  border-left: 1px solid var(--line);
}

.hero-panel-title + div {
  border-left: 0;
}

.hero-panel span {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.hero-panel strong {
  display: block;
  color: #111827;
  font-size: 24px;
  line-height: 1.1;
}

.hero-panel-title strong {
  color: var(--primary);
  font-size: 14px;
}

.calculator {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 22px;
}

.calculator > .panel:nth-child(2),
.calculator > .panel:nth-child(3),
.calculator > .panel:nth-child(4) {
  grid-column: 1;
}

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

.section-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid + .grid {
  margin-top: 14px;
}

.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 7px;
  color: #495057;
  font-size: 13px;
  font-weight: 700;
}

select,
input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

select:hover,
input:hover {
  border-color: #adb5bd;
}

select:focus,
input:focus,
button:focus-visible {
  outline: 3px solid rgba(13, 110, 253, 0.18);
  outline-offset: 2px;
  border-color: #86b7fe;
}

.input-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  align-items: center;
}

.input-with-unit input {
  border-radius: 6px 0 0 6px;
}

.input-with-unit small {
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  border-left: 0;
  border-radius: 0 6px 6px 0;
}

.compact-stats {
  margin-top: 18px;
}

.compact-stats div {
  min-height: 82px;
  padding: 15px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compact-stats span,
.muted,
.total > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.compact-stats span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
}

.mini-icon::before {
  display: block;
  font-size: 13px;
  line-height: 1;
}

.fuel-icon::before {
  content: "F";
  font-weight: 900;
}

.toll-icon::before {
  content: "↔";
  font-weight: 900;
}

.route-icon::before {
  content: "↗";
  font-weight: 900;
}

.wallet-icon::before {
  content: "₺";
  font-weight: 900;
}

.weather-icon::before {
  content: "°";
  font-weight: 900;
}

.compact-stats strong {
  display: block;
  margin-top: 8px;
  color: #111827;
  font-size: 21px;
}

.compact-stats small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.weather-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.weather-card span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.weather-card strong {
  display: block;
  margin-top: 7px;
  color: #111827;
  font-size: 22px;
}

.weather-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  text-align: right;
}

.map-panel {
  overflow: hidden;
}

.map-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border: 1px solid #b6d4fe;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.route-map {
  width: 100%;
  min-height: 360px;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background: #eef1f4;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.leaflet-container {
  font: inherit;
}

.leaflet-control-attribution {
  font-size: 10px;
}

button {
  min-height: 44px;
  padding: 0 15px;
  color: #fff;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.icon-button {
  width: 42px;
  min-height: 42px;
  padding: 0;
  font-size: 20px;
}

.text-button {
  min-height: 38px;
  color: var(--danger);
  background: #fff;
  border-color: #f1aeb5;
}

.text-button:hover {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.auto-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 13px 15px;
  color: #0f5132;
  background: var(--success-soft);
  border: 1px solid #badbcc;
  border-radius: 8px;
}

.auto-banner span {
  color: #4b6458;
  font-size: 13px;
  font-weight: 800;
}

.auto-banner strong {
  font-size: 14px;
}

.toll-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 15px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toll-actions strong {
  display: block;
  margin-top: 4px;
  color: #111827;
  font-size: 23px;
}

.toll-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.toll-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toll-row.is-auto {
  background: #fbfffc;
  border-color: #badbcc;
}

.toll-row p {
  margin: 0;
  font-weight: 800;
}

.toll-row small {
  color: var(--muted);
}

.toll-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  color: #0f5132;
  background: var(--success-soft);
  border: 1px solid #badbcc;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.toll-row:not(.is-auto) .toll-badge {
  color: #664d03;
  background: var(--warning-soft);
  border-color: #ffecb5;
}

.toll-row button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  color: var(--danger);
  background: #fff;
  border-color: #f1aeb5;
}

.toll-row button:hover {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.source-grid div {
  min-height: 126px;
  padding: 15px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.source-grid strong {
  display: block;
  margin-bottom: 8px;
}

.source-grid p,
.source-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.source-note {
  margin-top: 14px;
}

.credit-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.credit-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border: 1px solid #b6d4fe;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.credit-links a:hover {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.total {
  position: sticky;
  top: 18px;
  grid-column: 2;
  grid-row: 1 / span 2;
  border-top: 4px solid var(--primary);
}

.total strong {
  display: block;
  margin-top: 8px;
  color: #111827;
  font-size: 40px;
  line-height: 1;
}

.breakdown {
  display: grid;
  gap: 0;
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.breakdown p {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.breakdown .round-trip {
  margin-top: 12px;
  padding: 13px 14px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border: 1px solid #b6d4fe;
  border-radius: 8px;
}

.note {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.empty {
  padding: 14px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
}

.site-footer {
  display: grid;
  gap: 6px;
  padding: 24px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 900px) {
  .hero,
  .calculator {
    grid-template-columns: 1fr;
  }

  .total,
  .calculator > .panel:nth-child(2),
  .calculator > .panel:nth-child(3),
  .calculator > .panel:nth-child(4) {
    grid-column: auto;
    grid-row: auto;
  }

  .total {
    position: static;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .two,
  .three,
  .source-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 16px;
  }

  .headline-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-panel div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .route-map {
    min-height: 300px;
    aspect-ratio: 4 / 3;
  }

  .toll-actions,
  .auto-banner,
  .section-title,
  .weather-card {
    align-items: stretch;
    flex-direction: column;
  }

  .weather-card p {
    text-align: left;
  }

  .icon-button {
    width: 100%;
  }

  .toll-row {
    grid-template-columns: 1fr auto;
  }

  .toll-row strong {
    grid-column: 1 / -1;
  }
}
