:root {
  --bg: #ffffff;
  --bg-elevated: #f3f4f6;
  --bg-sidebar: #f3f4f6;
  --header-bg: #94b021;
  --header-text: #ffffff;
  --border-subtle: #d1d5db;
  --accent: #4d7c0f;
  --accent-soft: rgba(189, 216, 73, 0.22);
  --accent-strong: rgba(132, 204, 22, 0.4);
  --text: #111827;
  --text-dim: #6b7280;
  --danger: #b91c1c;
  --shadow-strong: rgba(15, 23, 42, 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Museo Sans", "Trebuchet MS", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.page {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1320px;
  padding: 20px;
  gap: 16px;
}

.page-footer {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.page-footer a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.page-header {
  background-color: var(--header-bg) !important;
  color: var(--header-text) !important;
  border-radius: 18px;
  padding: 18px 22px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}

.page-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-header-logo-link {
  display: block;
  line-height: 0;
  flex-shrink: 0;
}

.page-header-logo {
  max-height: 80px;
  width: auto;
  display: block;
}

.page-header h1 {
  margin: 0 0 6px;
  font-size: clamp(1.4rem, 2.1vw, 1.7rem);
  letter-spacing: 0.02em;
}

.page-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.94rem;
}

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr);
  gap: 16px;
  min-height: 560px;
}

.toolbar {
  background: var(--bg);
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  padding: 14px 18px;
}

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

.toolbar-search {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(640px, 100%);
}

.toolbar-search-label {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.toolbar-search input {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 12px 18px;
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  background: var(--bg);
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}

.toolbar-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(148, 176, 33, 0.22);
}

.map {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.sidebar {
  border-radius: 18px;
  background-color: var(--bg-sidebar) !important;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar-content {
  padding: 16px 18px;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.base-detail {
  background: var(--bg);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  padding: 16px 18px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.base-detail h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.base-detail h3 {
  margin: 16px 0 6px;
  font-size: 0.98rem;
}

.base-detail p {
  margin: 0 0 10px;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.5;
}

.base-detail p:last-child {
  margin-bottom: 0;
}

.base-detail-placeholder {
  margin-bottom: 0;
}

.base-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 14px;
  margin: 10px 0 6px;
  font-size: 0.86rem;
  color: var(--text-dim);
}

.base-detail-grid-item strong {
  display: block;
  font-weight: 600;
  color: var(--text);
}

.base-detail-photo {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  margin: 12px 0;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
  max-height: 220px;
}

.base-detail-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.base-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.74rem;
  border: 1px solid rgba(77, 124, 15, 0.3);
}

.sidebar-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-field-label {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.search-field input {
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  padding: 10px 12px;
  font-size: 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  background: var(--bg);
  color: var(--text);
}

.search-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(148, 176, 33, 0.22);
}

.result-summary {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.bases-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
}

.base-card {
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  padding: 12px 14px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.base-card:hover,
.base-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  outline: none;
}

.base-card[data-selected="true"] {
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(77, 124, 15, 0.3);
}

.base-card h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
}

.base-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.base-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(148, 176, 33, 0.18);
  color: var(--accent);
  font-size: 0.72rem;
  border: 1px solid rgba(148, 176, 33, 0.35);
}

.leaflet-container {
  background-color: var(--bg-elevated) !important;
}

.leaflet-popup-content-wrapper {
  border-radius: 12px;
}

.leaflet-popup-content {
  margin: 8px 12px;
  font-size: 0.82rem;
}

.marker-popup {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
}

.leaflet-control-attribution {
  font-size: 9px !important;
  background: var(--bg) !important;
  color: #6b7280 !important;
}

.leaflet-control-zoom a {
  background: var(--bg);
  color: #111827;
  border-color: var(--border-subtle);
}

.leaflet-control-zoom a:hover {
  background: var(--accent-soft);
  color: #111827;
  border-color: var(--accent);
}

.loading {
  color: var(--text-dim);
  font-size: 0.86rem;
}

.error-message {
  color: var(--danger);
  font-weight: 600;
  font-size: 0.86rem;
}

.hidden {
  display: none !important;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1.4fr);
  }
}

@media (max-width: 768px) {
  .page {
    padding: 12px;
  }

  .toolbar {
    padding: 12px;
  }

  .page-header {
    padding: 14px;
  }

  .page-header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .page-header-logo {
    max-height: 64px;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(320px, 1.2fr) minmax(0, 1fr);
  }

  .sidebar {
    min-height: 240px;
  }
}

