:root {
  color-scheme: light;
  --bg: #f1f3f5;
  --card-bg: #ffffff;
  --text: #1f2933;
  --muted: #5a6472;
  --border: #d9dde2;
  --accent: #2f6f4f;
  --accent-hover: #255a40;
  --error-bg: #fdecec;
  --error-border: #e8a3a3;
  --error-text: #9b2c2c;
  --result-bg: #eaf5ee;
  --result-border: #a9d4b8;
  --result-text: #1f4d33;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2.5rem 1rem;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  line-height: 1.5;
}

.card {
  width: 100%;
  max-width: 28rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 2rem;
}

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

.subtitle {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.field {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.input-with-unit {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
}

.input-with-unit:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 79, 0.15);
}

.input-with-unit input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  outline: none;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  color: var(--text);
  background: transparent;
}

.input-with-unit .unit {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: #f4f6f7;
  color: var(--muted);
  font-size: 0.85rem;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

button {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

button:hover {
  background: var(--accent-hover);
}

button:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

.error,
.result {
  margin: 1.25rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
}

.error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
}

.result {
  background: var(--result-bg);
  border: 1px solid var(--result-border);
  color: var(--result-text);
  font-weight: 600;
  font-size: 1.1rem;
  text-align: center;
}

@media (max-width: 420px) {
  .card {
    padding: 1.5rem;
  }
}
