.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.full { grid-column: 1 / -1; }

.field label {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.dim-badge {
  display: inline-flex;
  min-width: 24px;
  height: 20px;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

input,
select {
  box-sizing: border-box;
  width: 100%;
  height: 56px;
  border: 1px solid #bfd0e3;
  border-radius: 9px;
  padding: 11px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.2;
  background: #fff;
}

input:focus,
select:focus {
  outline: none;
  border-color: #5f8fbf;
  box-shadow: 0 0 0 3px rgba(34, 110, 182, 0.15);
}

.hint {
  margin-top: 4px;
  font-size: 12px;
  color: #6f8194;
}

.type-select-wrap {
  position: relative;
}

.type-select-wrap select {
  height: 56px;
  padding-left: 54px;
  padding-right: 34px;
  appearance: none;
  -webkit-appearance: none;
}

.type-select-wrap::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #557391;
  border-bottom: 2px solid #557391;
  transform: translateY(-62%) rotate(45deg);
  pointer-events: none;
}

.type-select-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 34px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid #c8dbef;
  background: #f2f8ff;
  color: #1a588e;
  font-family: "Rajdhani", sans-serif;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.actions {
  margin-top: 14px;
  display: flex;
  gap: 9px;
}

button {
  border: none;
  border-radius: 9px;
  padding: 12px 14px;
  font-family: "Rajdhani", sans-serif;
  font-size: 18px;
  letter-spacing: 0.03em;
  cursor: pointer;
}

#calc-btn {
  flex: 1;
  background: linear-gradient(180deg, #0f4d81 0%, #0b3d68 100%);
  color: #fff;
}

#clear-btn {
  width: 120px;
  background: #e8edf3;
  color: #1e3550;
}

.result {
  margin-top: 16px;
  padding: 14px;
  border-radius: 10px;
  background: var(--result);
  border: 1px solid #d0e1f3;
  font-size: 15px;
}

.error {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #ffe8e8;
  border: 1px solid #f5c0c0;
  color: var(--err);
  font-weight: 700;
}
