/* ============================================================
   CALCULATOR WINDOW
   ============================================================ */
#calculator-window {
  top: 80px;
  left: 200px;
  width: 320px;
  height: 480px;
  min-width: 280px;
  min-height: 400px;
  z-index: 15;
  background: #2a2a2a;
  font-family: 'Ubuntu', 'Segoe UI', sans-serif;
  color: #eee;
}

/* --- Calculator Header Bar --- */
#calculator-header {
  display: flex;
  align-items: center;
  background: #2d2d2d;
  padding: 0 8px;
  height: 38px;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  border-bottom: 1px solid #3a3a3a;
  gap: 6px;
}
#calculator-header:active { cursor: grabbing; }

#calculator-title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: #ccc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 8px;
}

/* --- Display --- */
#calc-display {
  background: #1e1e1e;
  padding: 20px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  flex-shrink: 0;
  overflow: hidden;
}

#calc-expression {
  font-size: 16px;
  color: #888;
  min-height: 22px;
  word-break: break-all;
  text-align: right;
  width: 100%;
  direction: rtl;
}

#calc-result {
  font-size: 32px;
  color: #eee;
  font-weight: 300;
  word-break: break-all;
  text-align: right;
  width: 100%;
  min-height: 40px;
  line-height: 1.2;
}

/* --- Button Grid --- */
#calc-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 8px;
  flex: 1;
}

/* --- Buttons --- */
.calc-btn {
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  background: #3a3a3a;
  color: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
  border: none;
  outline: none;
  font-family: 'Ubuntu', 'Segoe UI', sans-serif;
  transition: background 0.12s;
  user-select: none;
  -webkit-user-select: none;
}
.calc-btn:hover {
  background: #4a4a4a;
}
.calc-btn:active {
  background: #555;
}

.calc-btn.operator {
  background: #444;
  color: var(--accent-color);
}
.calc-btn.operator:hover {
  background: #525252;
}
.calc-btn.operator:active {
  background: #5a5a5a;
}

.calc-btn.equals {
  background: var(--accent-color);
  color: #fff;
}
.calc-btn.equals:hover {
  background: #d4441a;
}
.calc-btn.equals:active {
  background: #c03a15;
}

.calc-btn.clear {
  color: #ff5555;
}

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

/* --- Resize Handle --- */
#calculator-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  z-index: 20;
}
