.calculator-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  padding: 30px;
  font-family: 'Segoe UI', sans-serif;
}

.calc-block {
  flex: 1;
  min-width: 300px;
  max-width: 500px;
}

.calc-block label {
  display: block;
  margin-top: 20px;
  font-weight: 600;
  color: #333;
}

.calc-block input,
.calc-block select {
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  font-size: 16px;
  font-family: inherit;
  color: #333;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

.calc-block input:focus,
.calc-block select:focus {
  outline: none;
  border-color: #0077cc;
  box-shadow: 0 0 0 2px rgba(0, 119, 204, 0.15);
}

/* Пара валют с кнопкой обмена */
.currency-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.currency-row .field-group {
  flex: 1;
  min-width: 0;
}

.currency-row .field-group label {
  margin-top: 0;
}

.swap-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  margin-top: 8px;
  background-color: #eef6fc;
  color: #0077cc;
  font-size: 20px;
  line-height: 1;
  border: 1px solid #bcd9ee;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.swap-btn:hover {
  background-color: #0077cc;
  color: #fff;
}

.calc-block button:not(.swap-btn):not(.reset-rate-btn) {
  margin-top: 25px;
  padding: 12px 24px;
  background-color: #0077cc;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
}

.calc-block button:not(.swap-btn):not(.reset-rate-btn):hover {
  background-color: #005fa3;
}

.reset-rate-btn {
  margin-top: 8px;
  padding: 4px 10px;
  background: none;
  color: #0077cc;
  font-size: 13px;
  border: 1px dashed #0077cc;
  border-radius: 6px;
  cursor: pointer;
}

.reset-rate-btn:hover {
  background-color: #eef6fc;
}

.result-block {
  background: #f9f9f9;
  padding: 25px;
  border-top: 4px solid #0077cc;
  border-radius: 6px;
  flex: 1;
  min-width: 280px;
}

.result-block h2 {
  margin-top: 0;
  color: #0077cc;
}

.result-output p {
  margin: 12px 0;
  font-size: 17px;
  color: #222;
}

.result-main {
  font-size: 30px;
  font-weight: 700;
  color: #0077cc;
  margin: 8px 0 4px;
  word-break: break-word;
}

.result-sub {
  font-size: 14px;
  color: #666;
}

.calculator-description {
  max-width: 800px;
  margin: 50px auto;
  padding: 30px;
  background-color: #f2f6fa;
  border-top: 4px solid #0077cc;
  border-radius: 6px;
  line-height: 1.6;
  font-size: 16px;
}

.calculator-description h2,
.calculator-description h3 {
  color: #0077cc;
  margin-top: 20px;
}

@media (max-width: 600px) {
  .currency-row {
    flex-direction: column;
    align-items: stretch;
  }

  .swap-btn {
    width: 100%;
    height: 38px;
    margin-top: 8px;
  }
}
