/* ==================== RESET & BASE ====================
   Box-sizing reset applied universally so component sizing
   is predictable without per-element overrides.
   ====================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'DM Sans', sans-serif;
  background-color: rgb(var(--color-surface-container-low));
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==================== CALCULATOR SHELL ====================
   380 px keeps the shell under the 390 px minimum iPhone
   viewport width, avoiding horizontal scroll on mobile.
   ========================================================== */
.calc {
  background: rgb(var(--color-surface));
  border-radius: 24px;
  box-shadow:
    0 1px 3px rgb(var(--color-shadow) / 0.06),
    0 8px 24px rgb(var(--color-shadow) / 0.08),
    0 0 0 1px rgb(var(--color-outline-variant) / 0.25);
  width: 380px;
  overflow: hidden;
}

/* ==================== DISPLAY ====================
   flex-end alignment keeps the number anchored to the
   bottom of the display area, matching physical calculator UX.
   ================================================== */
.calc__display {
  background: rgb(var(--color-surface-container-low));
  padding: 28px 28px 22px;
  border-bottom: 1px solid rgb(var(--color-outline-variant) / 0.4);
  min-height: 124px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 4px;
}

/* ==================== BUTTON GRID ====================
   1 px gap on a colored background creates the illusion
   of visible dividers without adding actual border elements.
   ====================================================== */
.calc__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgb(var(--color-outline-variant) / 0.3);
}