.hm-calculator {
  width: 100%;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 0;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.14);
}

.hm-calculator * {
  box-sizing: border-box;
}

.hm-calculator button {
  font: inherit;
}

.hm-screen {
  padding: 20px;
  background: #1e2026;
  color: #ffffff;
  border-bottom: 1px solid #cbd5e1;
}

.hm-screen-top {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}

.hm-angle-button,
.hm-copy-button {
  min-height: 38px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hm-angle-button {
  padding: 0 12px;
  gap: 7px;
}

.hm-angle-button strong {
  color: #93c5fd;
}

.hm-copy-button {
  width: 38px;
  padding: 0;
  font-size: 17px;
}

.hm-angle-button:hover,
.hm-copy-button:hover,
.hm-angle-button:focus,
.hm-copy-button:focus {
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

.hm-expression {
  min-height: 32px;
  color: #94a3b8;
  text-align: right;
  font-size: clamp(17px, 2vw, 25px);
  line-height: 1.25;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.hm-result {
  min-height: 82px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  text-align: right;
  color: #ffffff;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.075em;
  font-weight: 900;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.hm-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  margin-top: 8px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 750;
}

.hm-status-row.hm-good {
  color: #86efac;
}

.hm-status-row.hm-error {
  color: #fca5a5;
}

.hm-memory-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border-bottom: 1px solid #cbd5e1;
  background: #eef6ff;
}

.hm-key-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: stretch;
}

.hm-key-section {
  min-width: 0;
}

.hm-standard-section {
  background: #ffffff;
  border-right: 1px solid #cbd5e1;
}

.hm-scientific-section {
  background: #f8fafc;
}

.hm-section-title {
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid #cbd5e1;
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 900;
  background: rgba(248, 250, 252, 0.9);
}

.hm-keys {
  display: grid;
  gap: 0;
}

.hm-standard-grid {
  grid-template-columns: repeat(4, 1fr);
}

.hm-scientific-grid {
  grid-template-columns: repeat(4, 1fr);
}

.hm-key {
  min-height: 64px;
  border: 0;
  border-right: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  border-radius: 0;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
  font-size: 17px;
  font-weight: 850;
  transition: background 0.12s ease, color 0.12s ease, transform 0.08s ease;
  user-select: none;
}

.hm-key:hover,
.hm-key:focus {
  background: #f1f5f9;
  outline: none;
}

.hm-key:active {
  transform: scale(0.985);
}

.hm-standard-grid .hm-key:nth-child(4n),
.hm-scientific-grid .hm-key:nth-child(4n),
.hm-memory-strip .hm-key:last-child {
  border-right: 0;
}

.hm-memory-strip .hm-key {
  min-height: 46px;
  background: #eef6ff;
  color: #0369a1;
  font-size: 14px;
}

.hm-memory-strip .hm-key:hover,
.hm-memory-strip .hm-key:focus {
  background: #dff0ff;
}

.hm-scientific-grid .hm-key {
  background: #f8fafc;
  color: #334155;
  font-size: 15px;
}

.hm-scientific-grid .hm-key:hover,
.hm-scientific-grid .hm-key:focus {
  background: #eef2f7;
}

.hm-operator-key {
  background: #eaf2ff;
  color: #1d4ed8;
}

.hm-operator-key:hover,
.hm-operator-key:focus {
  background: #dbeafe;
}

.hm-clear-key {
  background: #fee2e2;
  color: #b91c1c;
}

.hm-delete-key {
  background: #fff7ed;
  color: #c2410c;
}

.hm-equal-key {
  background: #2563eb;
  color: #ffffff;
}

.hm-equal-key:hover,
.hm-equal-key:focus {
  background: #1d4ed8;
}

.hm-zero-key {
  grid-column: span 2;
}

@media (max-width: 760px) {
  .hm-key-layout {
    grid-template-columns: 1fr;
  }

  .hm-standard-section {
    border-right: 0;
    border-bottom: 1px solid #cbd5e1;
  }

  .hm-key {
    min-height: 58px;
  }

  .hm-screen {
    padding: 16px;
  }

  .hm-result {
    min-height: 68px;
  }
}

@media (max-width: 420px) {
  .hm-scientific-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hm-scientific-grid .hm-key:nth-child(4n) {
    border-right: 1px solid #cbd5e1;
  }

  .hm-scientific-grid .hm-key:nth-child(3n) {
    border-right: 0;
  }

  .hm-key {
    min-height: 54px;
    font-size: 16px;
  }

  .hm-scientific-grid .hm-key {
    font-size: 14px;
  }
}
