body {
  font-family: system-ui, Arial, sans-serif;
  background: #f6f7f8;
  padding: 24px;
}

.calc {
  width: 320px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 12px;
}

.screen {
  min-height: 64px;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px;
  font-size: 24px;
  text-align: right;
  overflow-wrap: anywhere;
}

.keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

button {
  padding: 12px;
  font-size: 18px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fafafa;
  cursor: pointer;
}

button:active {
  transform: translateY(1px);
}

.op {
  /*background: #e7f4ff;*/ /* light blue tint */
}

.spacer {
  visibility: hidden;
}

.wide {
  grid-column: span 2;
}

#clear {
  /*
  background: #e7f4ff;
  */
}

#equals {
  /*background: #e7f4ff;*/ /* light blue tint */
}

.tab-bar {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.tab {
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 10px 20px;
  margin: 0 4px;
  cursor: pointer;
  font-weight: bold;
}

.tab.active {
  background: #ffffff;
  border-bottom: 1px solid white;
}

.calc-panel {
  display: none;
}

.calc-panel.active {
  display: block;
}

.rpn-screen {
  min-height: 64px;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px;
  font-size: 24px;
  text-align: right;
  overflow-wrap: anywhere;
}

#rpn-input {
  font-size: 24px;
  text-align: right;
  padding: 6px 0;
}

/* HP 12C grid: 5 columns */
.rpn-keys {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

/* Enter spans two rows */
.enter {
  grid-row: span 2;
}

.rpn-op {
  /*background: #e7f4ff;*/ /* light blue tint */
  border: 1px solid #ccc;
  border-radius: 8px;
}

#rpn-clear {
  border: 1px solid #ccc;
  border-radius: 8px;
}

/* Placeholder keys (blank buttons) */
.placeholder {
  background: #eee; /* or match your calc theme */
  border: 1px solid #ccc;
  border-radius: 8px;
  pointer-events: none; /* can’t be clicked */
}

/* Optional: make 0 key extra wide like HP 12C (spans 1 col, not 2) */
.wide-zero {
  grid-column: span 1;
}
