* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: #18202a;
  background: #eef2f6;
}

button,
output {
  font: inherit;
}

.page {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 1.5rem;
  padding: 2rem;
}

.page h1 {
  margin: 0;
  text-align: center;
  font-size: 2rem;
}

.calculator {
  width: min(100%, 22rem);
  padding: 1rem;
  border: 1px solid #d4dce6;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1rem 2.5rem rgba(24, 32, 42, 0.12);
}

.calculator__display {
  display: block;
  width: 100%;
  min-height: 4rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid #c5cfdb;
  border-radius: 6px;
  text-align: right;
  font-size: 2rem;
  line-height: 1.2;
  color: #0f1720;
  background: #f8fafc;
}

.calculator__row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.calculator__row + .calculator__row {
  margin-top: 0.5rem;
}

.calculator button {
  min-height: 3rem;
  border: 1px solid #c5cfdb;
  border-radius: 6px;
  color: #18202a;
  background: #ffffff;
  cursor: pointer;
}

.calculator button:hover {
  background: #edf4ff;
}

.calculator button:focus-visible {
  outline: 3px solid #7aa7e8;
  outline-offset: 2px;
}

.calculator button[data-action] {
  color: #ffffff;
  border-color: #2f6fb0;
  background: #2f6fb0;
}

.calculator button[data-action]:hover {
  background: #255b91;
}

.calculator button[data-action].is-active {
  color: #18202a;
  border-color: #f2b84b;
  background: #ffd166;
}
