:root {
  --primary: #2361a1;
  --text: #231f20;
  --muted: #5c6370;
  --border: #d0d5dd;
  --error: #d92d20;
  --bg: #ffffff;
  --radius: 0.375rem;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

[x-cloak] { display: none !important; }

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

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.field { margin-bottom: 14px; }
.field.narrow { max-width: 75%; }

label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.875rem;
  font-weight: 500;
}

input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  color: inherit;
  background: #fff;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

input[aria-invalid="true"] { border-color: var(--error); }

.error {
  margin: 4px 0 0;
  color: var(--error);
  font-size: 0.8125rem;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  min-width: 120px;
  padding: 9px 18px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.btn.primary { background: var(--primary); color: #fff; }
.btn.secondary { background: #fff; color: var(--primary); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.result h1 {
  margin: 8px 0 16px;
  color: var(--primary);
  font-size: 1.875rem;
  font-weight: 700;
  text-align: center;
}

.result p { margin: 0 0 20px; }
.center { text-align: center; }

@media (max-width: 480px) {
  .row { grid-template-columns: 1fr; }
  .field.narrow { max-width: none; }
  .actions .btn { flex: 1; min-width: 0; }
}
