* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  background: #f4f5f7;
  color: #1f2933;
  line-height: 1.5;
}

main.card {
  max-width: 720px;
  margin: 24px auto;
  padding: 24px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
}

h1 {
  margin: 0 0 16px;
  font-size: 1.5rem;
  font-weight: 600;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

button {
  font: inherit;
  padding: 8px 14px;
  border: 1px solid #cbd2d9;
  background: #ffffff;
  color: #1f2933;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    opacity 0.15s ease;
}

button:hover:not(:disabled) {
  background: #f0f2f5;
  border-color: #9aa5b1;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#btn-start {
  background: #2f7d32;
  border-color: #2f7d32;
  color: #ffffff;
}

#btn-start:hover:not(:disabled) {
  background: #276b29;
  border-color: #276b29;
}

#btn-stop {
  background: #b54708;
  border-color: #b54708;
  color: #ffffff;
}

#btn-stop:hover:not(:disabled) {
  background: #963a06;
  border-color: #963a06;
}

.status {
  margin: 12px 0 16px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.95rem;
  border: 1px solid transparent;
}

.status--neutral {
  background: #f0f2f5;
  color: #3e4c59;
  border-color: #e0e4e9;
}

.status--info {
  background: #e6f0fb;
  color: #1c4f8b;
  border-color: #c7dbf3;
}

.status--success {
  background: #e6f4ea;
  color: #1e6429;
  border-color: #c5e3ce;
}

.status--danger {
  background: #fdecea;
  color: #8a1f11;
  border-color: #f5c6c2;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.stat {
  background: #f4f5f7;
  border-radius: 8px;
  padding: 10px 12px;
}

.stat__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7b8794;
  margin-bottom: 4px;
}

.stat__value {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1f2933;
  word-break: break-word;
}

#map {
  width: 100%;
  height: 360px;
  border-radius: 8px;
  margin-top: 12px;
  background: #e0e4e9;
}

.last-update {
  margin-top: 8px;
  font-size: 0.8rem;
  color: #7b8794;
}

.debug-panel {
  margin-top: 16px;
  border: 1px solid #e0e4e9;
  border-radius: 8px;
  padding: 8px 12px;
  background: #fafbfc;
  font-size: 0.8rem;
}

.debug-panel summary {
  cursor: pointer;
  color: #3e4c59;
  font-weight: 600;
}

.debug-build {
  margin-top: 6px;
  color: #7b8794;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.debug-log {
  margin: 6px 0 0;
  max-height: 220px;
  overflow: auto;
  background: #ffffff;
  border: 1px solid #e0e4e9;
  border-radius: 4px;
  padding: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #1f2933;
  white-space: pre-wrap;
  word-break: break-word;
}
