:root {
  --bg: #f4f7f2;
  --surface: #ffffff;
  --text: #1b2818;
  --muted: #4c5f48;
  --accent: #0a7f4f;
  --accent-strong: #05623d;
  --border: #d5e2d0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #ebf5e5 0%, var(--bg) 45%, #e3efe0 100%);
  color: var(--text);
  min-height: 100vh;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(6px);
}

.app-header h1 {
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.7rem);
}

.app-header p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, var(--accent), #31a96d);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.16s ease, background-color 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lang-control {
  display: grid;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.lang-control select {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.55rem;
  font: inherit;
  background: #fff;
  color: var(--text);
}

.layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  min-height: calc(100vh - 84px);
}

.panel {
  padding: 1rem 1.25rem;
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
}

.panel h2 {
  margin-top: 0;
}

.status {
  margin-top: 0;
  color: var(--muted);
}

.place-form {
  display: grid;
  gap: 0.45rem;
  margin: 0.75rem 0 0.9rem;
}

.place-form label {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

.place-form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
}

.place-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.58rem 0.7rem;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.place-form input:focus {
  outline: 2px solid rgba(10, 127, 79, 0.2);
  border-color: var(--accent);
}

.fountain-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.7rem;
  max-height: calc(100vh - 280px);
  overflow: auto;
}

.fountain-item {
  line-height: 1.3;
}

.fountain-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.fountain-item button {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  padding: 0.25rem 0.65rem;
  background: var(--accent-strong);
}

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

.map {
  width: 100%;
  height: 100%;
}

.leaflet-popup-content {
  line-height: 1.35;
}

.donation-banner {
  position: fixed;
  left: 50%;
  bottom: max(0.9rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(760px, calc(100vw - 1.2rem));
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--border);
  border-radius: 0.95rem;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
  z-index: 1200;
}

.donation-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.35;
}

.donation-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.donation-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  text-decoration: none;
  font-size: 0.87rem;
  font-weight: 700;
  background: var(--accent-strong);
  color: #fff;
}

.donation-dismiss {
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  background: #e8efe5;
  color: #284126;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(420px, 65vh);
  }

  .panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .fountain-list {
    max-height: 230px;
  }

  .place-form-row {
    grid-template-columns: 1fr;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-controls {
    width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: 0.8rem 0.9rem;
  }

  .panel {
    padding: 0.85rem 0.9rem;
  }

  .header-controls {
    gap: 0.45rem;
  }

  .lang-control {
    width: 100%;
    font-size: 0.75rem;
  }

  .lang-control select {
    width: 100%;
  }

  #locate-btn {
    width: 100%;
    text-align: center;
  }

  .place-form input {
    padding: 0.52rem 0.62rem;
  }

  #place-btn {
    width: 100%;
  }

  .fountain-list {
    max-height: 180px;
  }

  .donation-banner {
    padding: 0.75rem 0.8rem;
    width: calc(100vw - 0.9rem);
  }

  .donation-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .donation-link,
  .donation-dismiss {
    width: 100%;
  }
}
