* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, #8a9ba8 0%, #6a7d8a 50%, #8a9ba8 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: Arial, sans-serif;
}

.calculator {
  background: linear-gradient(160deg, #2e2e2e 0%, #1e1e1e 100%);
  border-radius: 14px;
  width: 310px;
  padding: 14px 12px 20px;
  box-shadow:
    6px 6px 24px rgba(0,0,0,0.7),
    inset 0 1px 0 rgba(255,255,255,0.07);
  border: 1px solid #3a3a3a;
}

/* Header */
.calc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 10px;
  padding: 0 2px;
}

.brand {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 3px;
  font-style: italic;
}

.model {
  font-size: 11px;
  color: #aaa;
  margin-left: 6px;
}

.svpam {
  font-size: 8px;
  color: #888;
  letter-spacing: 1px;
}

/* Display */
.display-shell {
  background: #0a0a0a;
  border-radius: 6px;
  padding: 5px;
  margin-bottom: 12px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.8);
}

.display {
  background: #b8c8b0;
  border-radius: 3px;
  padding: 6px 8px 10px;
  min-height: 78px;
  background: linear-gradient(180deg, #b0c0a8 0%, #a8b8a0 100%);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.indicators {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.ind {
  font-size: 7px;
  color: #2a4a1a;
  opacity: 0.2;
  font-weight: bold;
  transition: opacity 0.2s;
}

.expr-line {
  font-size: 11px;
  color: #3a5a2a;
  text-align: right;
  min-height: 18px;
  font-family: 'Courier New', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cursor {
  color: #1a3a0a;
  font-weight: bold;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.result-line {
  font-size: 26px;
  color: #1a3a0a;
  text-align: right;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  transition: color 0.3s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Keypads */
.keypad {
  display: grid;
  gap: 5px;
  margin-bottom: 5px;
}

.sci-keypad {
  grid-template-columns: repeat(5, 1fr);
}

.nav-keypad {
  grid-template-columns: repeat(5, 1fr);
}

.num-keypad {
  grid-template-columns: repeat(5, 1fr);
}

/* Buttons base */
.btn {
  height: 30px;
  border: none;
  border-radius: 5px;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: filter 0.08s, transform 0.08s, box-shadow 0.08s;
  box-shadow: 0 3px 0 rgba(0,0,0,0.4);
  user-select: none;
}

.btn:hover {
  filter: brightness(1.15);
}

.btn:active {
  filter: brightness(0.85);
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.4);
}

.top-label {
  font-size: 6px;
  color: #f0a000;
  position: absolute;
  top: 2px;
  font-weight: normal;
  transition: color 0.2s, font-weight 0.2s;
  pointer-events: none;
}

/* Sci buttons */
.sci-btn {
  background: linear-gradient(180deg, #555 0%, #444 100%);
  color: #fff;
  font-size: 9px;
  padding-top: 8px;
  height: 32px;
  border: 1px solid #333;
}

/* Top row */
.shift-btn {
  background: linear-gradient(180deg, #f0a800 0%, #d09000 100%);
  color: #000;
  font-size: 9px;
  border: 1px solid #a07000;
}

.alpha-btn {
  background: linear-gradient(180deg, #dd3333 0%, #bb2222 100%);
  color: #fff;
  font-size: 9px;
  border: 1px solid #881111;
}

.mode-btn {
  background: linear-gradient(180deg, #555 0%, #444 100%);
  color: #fff;
  font-size: 9px;
  border: 1px solid #333;
}

.on-btn {
  background: linear-gradient(180deg, #555 0%, #444 100%);
  color: #fff;
  font-size: 9px;
  border: 1px solid #333;
}

/* Nav row */
.del-btn {
  background: linear-gradient(180deg, #555 0%, #444 100%);
  color: #fff;
  font-size: 9px;
  border: 1px solid #333;
}

.ac-btn {
  background: linear-gradient(180deg, #555 0%, #444 100%);
  color: #fff;
  font-size: 9px;
  border: 1px solid #333;
}

.nav-btn {
  background: linear-gradient(180deg, #4a4a4a 0%, #3a3a3a 100%);
  color: #fff;
  font-size: 10px;
  border: 1px solid #2a2a2a;
}

/* Number keypad */
.num-btn {
  background: linear-gradient(180deg, #f0ece4 0%, #e0dcd4 100%);
  color: #111;
  font-size: 15px;
  font-weight: bold;
  height: 38px;
  border: 1px solid #bbb;
}

.op-btn {
  background: linear-gradient(180deg, #6a6a6a 0%, #555 100%);
  color: #fff;
  font-size: 13px;
  height: 38px;
  border: 1px solid #444;
}

.eq-btn {
  background: linear-gradient(180deg, #44aaff 0%, #2288dd 100%);
  color: #fff;
  font-size: 22px;
  grid-row: span 2;
  align-self: stretch;
  height: auto;
  border: 1px solid #1166bb;
  box-shadow: 0 3px 0 #0a4488;
}

.red-btn {
  background: linear-gradient(180deg, #dd3333 0%, #bb2222 100%);
  color: #fff;
  font-size: 11px;
  height: 38px;
  border: 1px solid #881111;
}

.zero-btn {
  grid-column: span 2;
}
