/* ==========================================================================
   COMPONENT — Calculator (card, display, keypad grid)
   Depends on tokens in css/main.css and key styles in components/buttons.css
   ========================================================================== */

.calculator-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Ambient warm glow bleeding from behind the card, matching the reference */
.calculator-wrapper::before {
  content: '';
  position: absolute;
  top: 8%;
  right: 10%;
  width: 260px;
  height: 260px;
  background: var(--color-bg-glow-orange);
  filter: blur(90px);
  opacity: 0.35;
  pointer-events: none;
}

.calculator-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--color-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-7);
  z-index: 1;
}

/* ---- Top bar: menu icon + mic icon ---- */
.calculator-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.calculator-topbar__left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.scientific-title {
  font-size: 1.3rem;
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
}

.scientific-title__accent {
  color: var(--color-btn-operator);
  font-weight: var(--fw-bold);
}
/* ---- Display: running expression + big result ---- */
.calculator-display {
  text-align: right;
  margin-bottom: var(--space-7);
  padding: 0 var(--space-2);
}

.calculator-display__expression {
  font-size: var(--fs-expression);
  font-weight: var(--fw-regular);
  color: var(--color-text-secondary);
  min-height: 1.4em;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

.calculator-display__result {
  font-size: var(--fs-result);
  font-weight: var(--fw-light);
  color: var(--color-text-primary);
  line-height: 1.1;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

/* ---- Keypad grid: 4 columns x 5 rows ---- */
.calculator-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

/* Responsive: shrink paddings/heights on very small cards handled in responsive.css */