:root {
  --bg: #f4f7fb;
  --ink: #101827;
  --muted: #4f5b70;
  --card: #ffffff;
  --primary: #2d8cff;
  --primary-hover: #1f77df;
  --border: #dbe4ef;
  --line: #edf2f8;
  --error: #b91c1c;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fe 100%);
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.shell {
  width: min(100%, 860px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 16px 44px rgba(12, 26, 48, 0.08);
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(140deg, #4ca1ff 0%, #267dff 100%);
}

.brand-name {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.card {
  padding: 28px 24px 24px;
}

h1 {
  margin: 0 0 7px;
  font-size: clamp(1.5rem, 1.6vw + 1rem, 2rem);
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0 0 24px;
  max-width: 580px;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.field {
  display: grid;
  gap: 6px;
  font-weight: 800;
  color: #2a3a53;
}

.field input {
  width: 100%;
  border: 1px solid #ccd8e6;
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  font-weight: 700;
  background: #fbfdff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  outline: none;
  border-color: #63a5ff;
  box-shadow: 0 0 0 3px rgba(45, 140, 255, 0.17);
}

.options {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 700;
  color: #1f2f48;
}

.actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 11px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #3d98ff 0%, #287eff 100%);
  transition: transform 0.15s ease, filter 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(0.97);
}

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

button.ghost {
  color: #1d3150;
  border: 1px solid #cfdcec;
  background: #fff;
}

button.ghost:hover {
  background: #f6f9fe;
}

.error {
  min-height: 20px;
  color: var(--error);
  margin: 14px 0 0;
  font-weight: 700;
}

.result {
  margin-top: 24px;
  border: 1px solid #d8e3f0;
  border-radius: 12px;
  padding: 16px;
  background: #f9fcff;
}

.result h2 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #3d4f6b;
}

output {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.5;
  color: #122642;
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
  }

  .card {
    padding: 20px 16px 18px;
  }
}
