:root {
  color-scheme: light;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;

  --color-primary: #176b3a;
  --color-primary-dark: #0f4f2a;
  --color-border: #d8dee4;
  --color-text: #17212b;
  --color-muted: #5f6b76;
  --color-background: #eef2f4;
  --color-surface: #ffffff;
  --color-warning-background: #fff8df;
  --color-warning-border: #e6c75a;
  --color-error: #a4262c;
  --color-success: #176b3a;
  --sidebar-width: 390px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  overflow: hidden;
  color: var(--color-text);
  background: var(--color-background);
}

.sidebar {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 0 0 var(--sidebar-width);
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100%;
  padding: 28px;
  overflow-y: auto;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  box-shadow: 5px 0 20px rgb(25 36 46 / 10%);
}

.site-header {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1.15;
}

.introduction {
  margin: 12px 0 0;
  color: var(--color-muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.notice {
  display: grid;
  gap: 4px;
  margin-bottom: 22px;
  padding: 13px 14px;
  color: #5e4a08;
  font-size: 0.82rem;
  line-height: 1.45;
  background: var(--color-warning-background);
  border: 1px solid var(--color-warning-border);
  border-left-width: 4px;
  border-radius: 6px;
}

.notice strong {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.search-form {
  display: grid;
  gap: 16px;
}

.form-field {
  display: grid;
  gap: 6px;
}

label {
  color: #34414d;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--color-text);
  font: inherit;
  font-size: 0.95rem;
  background: #fbfcfd;
  border: 1px solid #bcc6ce;
  border-radius: 6px;
}

input:focus {
  background: #ffffff;
  border-color: var(--color-primary);
  outline: 3px solid rgb(23 107 58 / 16%);
}

button {
  min-height: 46px;
  padding: 11px 16px;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  background: var(--color-primary);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    transform 150ms ease;
}

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

button:active {
  transform: translateY(1px);
}

button:focus-visible {
  outline: 3px solid rgb(23 107 58 / 25%);
  outline-offset: 2px;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.status-message {
  min-height: 24px;
  margin-top: 20px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.status-message.success {
  color: var(--color-success);
}

.status-message.error {
  color: var(--color-error);
}

.results {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.result-card {
  padding: 14px;
  font-size: 0.84rem;
  line-height: 1.5;
  background: #f7f9fa;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: 6px;
}

.result-card h2 {
  margin: 0 0 7px;
  font-size: 0.98rem;
  line-height: 1.35;
}

.result-card dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 3px 8px;
  margin: 0;
}

.result-card dt {
  color: var(--color-muted);
  font-weight: 600;
}

.result-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.result-badge {
  display: inline-block;
  margin-top: 9px;
  padding: 3px 7px;
  color: #46515b;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  background: #e8ecef;
  border-radius: 999px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 24px;
  font-size: 0.82rem;
}

.sidebar-footer a {
  color: var(--color-primary);
  font-weight: 650;
}

.map-region {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
}

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

.maplibregl-popup-content {
  max-width: 260px;
  padding: 12px 14px;
  font-family: inherit;
  line-height: 1.4;
}

@media (max-width: 760px) {
  body {
    display: grid;
    grid-template-rows: minmax(340px, 48%) 1fr;
    overflow: auto;
  }

  .sidebar {
    width: 100%;
    height: auto;
    min-height: 340px;
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 5px 18px rgb(25 36 46 / 9%);
  }

  .map-region {
    width: 100%;
    min-height: 360px;
  }

  .sidebar-footer {
    margin-top: 18px;
  }
}
