:root {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1f2933;
  background-color: #f7fafc;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f7fafc;
  padding: 1rem;
}

.page {
  width: min(680px, 95vw);
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  background: #fff;
  padding: 2.25rem;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.1);
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ad-block {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-block .adsbygoogle {
  width: 100%;
  min-height: 60px;
  max-height: 120px;
}

h1 {
  margin-top: 0;
  font-size: 1.75rem;
  text-align: center;
}

.formula {
  background: #edf2ff;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.formula input {
  width: 6rem;
  margin: 0 0.35rem;
  padding: 0.4rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  text-align: center;
  font-size: 1rem;
}

.grade-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

button {
  margin-top: 0.5rem;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: #1d4ed8;
}

.message {
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
}

.result {
  background: #dcfce7;
  color: #166534;
}

.error {
  background: #fee2e2;
  color: #991b1b;
}
