html, body {
  overflow: hidden;
  height: 100%;
  margin: 0;
}

body {
  background-color: white;
  font-family: 'Inter', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.calculator-container {
  width: 90vw;
  flex-grow: 1; /* takes up all vertical space between top and buttons */
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calculator-grid {
  display: none;
  grid-template-columns: auto auto;
  align-items: center;
  row-gap: 0.2em;
  column-gap: 1em;
  font-size: 4rem;
  width: 100%;
}

.calculator-grid.active {
  display: grid;
}

.hidden {
  display: none !important;
}

.label, .result, .input {
  white-space: nowrap;
}

.label {
  text-align: right;
  color: black;
}


.input-wrapper {
  display: flex;
  position: relative;
  width: 8ch;
  align-items: center;
}

.input-mirror {
  position: absolute;
  visibility: hidden;
  white-space: pre;
  font: inherit;
}

.suffix {
  margin-left: 4px;
  color: gray;
  font-size: inherit;
  flex-shrink: 0;
}

.editable-input {
  display: inline-block;
  min-width: 1ch;
  max-width: 100%;
  outline: none;
  background: transparent;
  font-size: inherit;
  color: grey;
  white-space: nowrap;
}

.input {
  border: none;
  background: transparent;
  font-size: inherit;
  color: grey;
  outline: none;
  padding: 0;
  width:auto;
  max-width: 100%;
  box-sizing: content-box;
  flex-shrink: 1;
  flex-grow: 0;            /* do not grow to fill */
}

.hidden-input {
  display: none;
}

.result {
  font-weight: bold;
  color: darkgreen;
  font-size: inherit;
  text-align: left;
}

/* Remove spinner arrows in number inputs */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield;
}

.button-container {
  display: flex;
  justify-content: center;
  gap: 20px; /* space between buttons */
  padding: 20px;
}

.action-button {
  padding: 10px 20px;
  font-size: 1.2rem;
  border: none;
  border-radius: 8px;
  background-color: #9f9f9f;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s;
}

.action-button:hover {
  background-color: #717171;
}