.calculator-window {
  left: clamp(170px, 22vw, 360px);
  top: clamp(64px, 11vh, 132px);
  width: 334px;
  height: 414px;
  min-width: 304px;
  min-height: 384px;
  z-index: 10;
}

.calculator-window.is-active {
  z-index: 14;
}

.calculator-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 22px;
  height: 100%;
  min-height: 0;
  color: #14283c;
  background: linear-gradient(#edf7ff, #d7e7f4 45%, #c4d8e8);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 12px;
}

.calculator-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 24px;
  padding: 1px 6px;
  background: linear-gradient(#fbfdff, #d6e8f7);
  border-bottom: 1px solid #aabdd0;
}

.calculator-menu button,
.calculator-keypad button {
  color: #16324b;
  font: inherit;
  border: 1px solid #879fb7;
  border-radius: 2px;
}

.calculator-menu button {
  min-height: 21px;
  padding: 2px 8px;
  background: transparent;
  border-color: transparent;
}

.calculator-menu button:hover,
.calculator-menu button:focus-visible,
.calculator-keypad button:hover,
.calculator-keypad button:focus-visible {
  border-color: #5f9fd1;
  background: linear-gradient(#ffffff, #dcf1ff 46%, #a8d7f5);
  outline: 0;
}

.calculator-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 9px;
  min-height: 0;
  padding: 11px 10px 9px;
}

.calculator-display-wrap {
  position: relative;
  padding: 7px 8px 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.9), rgba(220,234,246,.72)),
    #eef5fb;
  border: 1px solid #8ba4bb;
  box-shadow: inset 0 1px 2px rgba(63, 92, 124, .24), 0 1px 0 rgba(255,255,255,.8);
}

.calculator-memory-indicator {
  position: absolute;
  left: 9px;
  top: 7px;
  width: 22px;
  height: 17px;
  color: #305777;
  font-size: 11px;
  line-height: 17px;
  text-align: center;
}

.calculator-display {
  display: block;
  width: 100%;
  min-height: 49px;
  padding: 13px 8px 4px 32px;
  overflow: hidden;
  color: #0a1d2e;
  font: 400 31px/1.05 "Segoe UI", Tahoma, Arial, sans-serif;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: linear-gradient(#f9fcff, #edf6fe);
  border: 1px solid #b4c6d6;
  box-sizing: border-box;
}

.calculator-display:focus-visible {
  outline: 1px dotted #1b5c9b;
  outline-offset: -4px;
}

.calculator-keypad {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: minmax(33px, 1fr);
  gap: 6px;
  min-height: 0;
}

.calculator-keypad button {
  min-width: 0;
  min-height: 33px;
  padding: 0 5px;
  background: linear-gradient(#fdfefe, #e4eef7 48%, #d2e1ef);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 1px 1px rgba(54, 86, 112, .18);
}

.calculator-keypad button[data-calculator-key="0"],
.calculator-keypad button[data-calculator-key="1"],
.calculator-keypad button[data-calculator-key="2"],
.calculator-keypad button[data-calculator-key="3"],
.calculator-keypad button[data-calculator-key="4"],
.calculator-keypad button[data-calculator-key="5"],
.calculator-keypad button[data-calculator-key="6"],
.calculator-keypad button[data-calculator-key="7"],
.calculator-keypad button[data-calculator-key="8"],
.calculator-keypad button[data-calculator-key="9"] {
  color: #0b1721;
  font-size: 14px;
  background: linear-gradient(#ffffff, #f6fbff 48%, #dcebf8);
}

.calculator-zero {
  grid-column: span 2;
}

.calculator-equals {
  grid-row: span 2;
  color: #082f57;
  font-size: 18px;
  background: linear-gradient(#eaf7ff, #bfe1f8 46%, #8dc5ec) !important;
  border-color: #578db6 !important;
}

.calculator-status {
  min-height: 22px;
  padding: 3px 8px;
  color: #264258;
  background: linear-gradient(#eef6fc, #d7e7f3);
  border-top: 1px solid #a8bdcf;
  box-sizing: border-box;
}

@media (max-width: 720px) {
  .calculator-window {
    width: min(334px, calc(100vw - 18px));
    min-width: 280px;
    height: min(414px, calc(100vh - var(--taskbar-h) - 24px));
    min-height: 372px;
  }

  .calculator-display {
    font-size: 27px;
  }

  .calculator-keypad {
    gap: 5px;
  }
}
