:root {
  color-scheme: light;
  --bg: #f4f2ed;
  --surface: #ffffff;
  --surface-muted: #eef4ef;
  --text: #18201c;
  --muted: #66736c;
  --line: #d8ddd8;
  --accent: #0f7b62;
  --accent-dark: #0a5d4a;
  --accent-soft: #dff3ec;
  --blue: #2864b4;
  --grid: rgba(24, 32, 28, 0.08);
  --danger: #a43d37;
  --shadow: 0 12px 34px rgba(25, 36, 31, 0.1);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
}

.tool-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: 24px;
  align-items: end;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 18px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(2.1rem, 4.8vw, 4.1rem);
  line-height: 1;
  letter-spacing: 0;
}

.intro {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.privacy-note {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #bddccc;
  border-radius: 8px;
  background: var(--accent-soft);
  color: #123d32;
}

.privacy-note strong {
  font-size: 0.95rem;
}

.privacy-note span {
  color: #315d50;
  font-size: 0.92rem;
  line-height: 1.45;
}

.tool-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 4px 24px 14px;
}

.tool-nav-link {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  font-size: 0.92rem;
  text-decoration: none;
}

.tool-nav-link:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.tool-nav-link.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tool-nav-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid var(--line);
}

.tool-nav-group-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tool-nav-home {
  font-weight: 800;
}

.tool-group {
  margin-bottom: 26px;
}

.tool-group-title {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.tool-grid-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 32px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: border-color 160ms ease, transform 160ms ease;
}

.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.tool-card-label {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tool-card-title {
  font-size: 1.1rem;
}

.tool-card-desc {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(310px, 390px) minmax(0, 1fr);
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 28px;
}

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

.upload-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 168px;
  padding: 18px;
  border: 2px dashed #abc2b6;
  border-radius: 8px;
  background: #f8faf8;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--accent);
  background: var(--surface-muted);
  transform: translateY(-1px);
}

.drop-zone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 2rem;
  line-height: 1;
}

.drop-title {
  display: block;
  color: var(--text);
  font-weight: 800;
  font-size: 1.08rem;
}

.drop-subtitle {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.95rem;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 10px 12px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  background: var(--accent);
  color: white;
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-dark);
}

.secondary-button {
  background: white;
  border-color: var(--line);
  color: var(--text);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.status-message {
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 7px;
  background: #f7f7f4;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.4;
}

.status-message.is-error {
  background: #fff0ef;
  color: var(--danger);
}

.status-message.is-success {
  background: var(--accent-soft);
  color: #17463a;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.stats-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfbf9;
}

.stats-grid dt {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stats-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
  font-weight: 800;
}

.preview-panel {
  display: flex;
  flex-direction: column;
  min-height: 430px;
  overflow: hidden;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.preview-header h2 {
  margin: 0;
  font-size: 1.12rem;
}

.preview-kicker {
  margin: 0 0 3px;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

#preview-meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.route-preview {
  position: relative;
  width: 100%;
  min-height: 360px;
  flex: 1;
  overflow: hidden;
  background: #e8ede8;
}

/* Leaflet-Karte fuellt den Vorschau-Bereich.
   WICHTIG: keine globale `.route-preview svg`-Regel mehr - Leaflet legt fuer
   Vektor-Layer ein eigenes <svg> an, das sonst auf 100%/360px gezwungen und
   damit zerstoert wird. */
.route-preview.leaflet-container {
  background: #e8ede8;
  font: inherit;
}

.route-preview .leaflet-control-attribution {
  font-size: 0.72rem;
}

.preview-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 6px 10px rgba(15, 123, 98, 0.24));
}

.preview-line.route {
  stroke: var(--blue);
  stroke-dasharray: 10 10;
}

.preview-point {
  fill: white;
  stroke: var(--text);
  stroke-width: 3;
}

.empty-preview {
  display: grid;
  place-content: center;
  gap: 8px;
  min-height: 360px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.empty-preview span {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.empty-preview strong {
  color: var(--text);
  font-size: 1.1rem;
}

.consent-gate {
  max-width: 460px;
  margin: 0 auto;
}

.consent-hint {
  margin: 0;
  max-width: 420px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.consent-gate .primary-button {
  justify-self: center;
  margin-top: 6px;
  padding-inline: 22px;
}

.slider-row {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfbf9;
}

.slider-row label {
  font-size: 0.92rem;
  color: var(--muted);
}

.slider-row strong {
  color: var(--text);
}

.slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.slider-hint {
  color: var(--muted);
  font-size: 0.82rem;
}

.profile-section {
  border-top: 1px solid var(--line);
  background: #fbfaf7;
}

.profile-box {
  position: relative;
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.profile-svg {
  display: block;
  width: 100%;
  height: auto;
}

.profile-area {
  fill: rgba(15, 123, 98, 0.14);
  stroke: none;
}

.profile-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linejoin: round;
}

.profile-axis {
  fill: var(--muted);
  font-size: 22px;
}

.select-input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
}

.maps-output-section {
  border-top: 1px solid var(--line);
  background: #fbfaf7;
}

.maps-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.maps-actions .primary-button,
.maps-actions .secondary-button {
  padding-inline: 18px;
}

.url-box {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.maps-hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.maps-hint a {
  color: var(--accent-dark);
}

.site-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 24px 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--accent-dark);
  font-weight: 700;
}

.site-footer-note {
  margin-top: 6px !important;
  font-size: 0.85rem;
}

.site-footer-links {
  margin-top: 10px !important;
}

.legal-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 4px 24px 8px;
}

.legal-content {
  max-width: 760px;
}

.legal-content h2 {
  margin: 26px 0 8px;
  font-size: 1.15rem;
}

.legal-content p,
.legal-content ul {
  margin: 0 0 4px;
  color: var(--muted);
  line-height: 1.6;
}

.legal-content ul {
  padding-left: 20px;
}

.legal-content a {
  color: var(--accent-dark);
}

.content-band {
  border-top: 1px solid var(--line);
  background: #fbfaf7;
}

.content-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

.content-inner h2 {
  margin: 0 0 18px;
  font-size: 1.45rem;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.faq-grid article {
  padding: 0;
}

.faq-grid h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.faq-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 880px) {
  .tool-header,
  .workspace {
    grid-template-columns: 1fr;
  }

  .tool-header {
    padding-top: 28px;
  }

  .preview-panel {
    min-height: 360px;
  }

  .route-preview,
  .empty-preview {
    min-height: 300px;
  }

  .faq-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .tool-header,
  .workspace,
  .content-inner {
    padding-left: 14px;
    padding-right: 14px;
  }

  .actions,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.35rem;
  }
}
