:root {
  font-family: system-ui, sans-serif;
  color-scheme: light dark;
}

body {
  margin: 0;
  padding: 1rem;
  display: flex;
  justify-content: center;
}

main {
  max-width: 480px;
  width: 100%;
}

.hint {
  opacity: 0.8;
  font-size: 0.9rem;
}

#estimate-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#text-input {
  flex: 1 1 200px;
  padding: 0.6rem;
  font-size: 1rem;
}

#estimate-button {
  padding: 0.6rem 1rem;
  font-size: 1rem;
  cursor: pointer;
}

.error {
  color: #c0392b;
}

#loading {
  margin-top: 1rem;
  text-align: center;
}

#loading .icon {
  display: inline-block;
  font-size: 1.5rem;
  animation: bounce 1s infinite ease-in-out;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

#result {
  margin-top: 1rem;
}

.distance-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0;
}

.distance-row .icon {
  font-size: 1.3rem;
}

#share-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

#share-buttons button {
  padding: 0.5rem 0.8rem;
  font-size: 0.9rem;
  cursor: pointer;
}

#history {
  margin-top: 1.5rem;
}

#history h2 {
  font-size: 1rem;
  opacity: 0.8;
}

#history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

#history-list li {
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}
