*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: #1c2530;
  background: #f5f7f9;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  overflow-wrap: anywhere;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
  line-height: 1.2;
}

.lead {
  margin: 0 0 1.25rem;
  color: #3d4a57;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.tabs button {
  flex: 1 1 auto;
  padding: 0.6rem 0.75rem;
  border: 1px solid #b8c3cd;
  border-bottom: none;
  border-radius: 0.4rem 0.4rem 0 0;
  background: #e6ebf0;
  color: #1c2530;
  font: inherit;
  cursor: pointer;
}

.tabs button[aria-selected="true"] {
  background: #fff;
  font-weight: 600;
  box-shadow: inset 0 3px 0 #1f5f8b;
}

.panel {
  padding: 1rem;
  border: 1px solid #b8c3cd;
  border-radius: 0 0 0.4rem 0.4rem;
  background: #fff;
}

.formula {
  margin: 0 0 1rem;
  color: #3d4a57;
}

.nowrap {
  white-space: nowrap;
  font-weight: 600;
  color: #1c2530;
}

.field {
  margin-bottom: 0.9rem;
}

label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

input {
  display: block;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid #8a98a6;
  border-radius: 0.3rem;
  font: inherit;
  color: inherit;
  background: #fff;
}

input[aria-invalid="true"] {
  border-color: #b3261e;
  box-shadow: 0 0 0 1px #b3261e;
}

.error {
  margin: 0.25rem 0 0;
  color: #b3261e;
  font-size: 0.9rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.actions button {
  padding: 0.6rem 1.2rem;
  border: 1px solid #1f5f8b;
  border-radius: 0.3rem;
  background: #1f5f8b;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.actions button.secondary {
  background: #fff;
  color: #1f5f8b;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid #f0a500;
  outline-offset: 2px;
}

.result:not(:empty) {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.3rem;
  background: #eef5fa;
  border-left: 4px solid #1f5f8b;
}

.result[data-state="error"] {
  background: #fcefee;
  border-left-color: #b3261e;
}

.result p {
  margin: 0;
}

.result-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.result-formula,
.result-note {
  margin-top: 0.25rem !important;
  color: #3d4a57;
  font-size: 0.95rem;
}

.result-error {
  color: #b3261e;
  font-weight: 600;
}

.hint,
.note {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: #4a5764;
}
