:root {
  color-scheme: light dark;
  --border: color-mix(in srgb, currentColor 15%, transparent);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: canvas;
  color: canvastext;
}

header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

header h1 {
  margin: 0 0 0.25rem;
}

header p {
  margin: 0;
  opacity: 0.75;
}

main {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 90px);
}

@media (min-width: 800px) {
  main {
    flex-direction: row;
  }
}

#chat {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding: 1rem;
  gap: 0.75rem;
}

#messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 200px;
}

.message {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  max-width: 80%;
  white-space: pre-wrap;
}

.message-user {
  align-self: flex-end;
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.message-assistant {
  align-self: flex-start;
  border: 1px solid var(--border);
}

.message-system {
  align-self: center;
  opacity: 0.7;
  font-size: 0.9em;
}

#query-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.location-row,
.query-row {
  display: flex;
  gap: 0.5rem;
}

.location-row input,
.query-row input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: canvas;
  color: canvastext;
}

button {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: canvas;
  color: canvastext;
  cursor: pointer;
}

#map-section {
  flex: 1;
  min-width: 0;
  min-height: 300px;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 300px;
}
