* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #f2f4f6;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
}

.calculator {
  max-width: 560px;
  width: 100%;
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid #eef2f5;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.02), 0 2px 6px rgba(0, 0, 0, 0.03);
}

.calculator__header {
  padding: 1.6rem 2rem 0.8rem 2rem;
  border-bottom: 1px solid #eaedf0;
}

.calculator__title {
  font-size: 1.65rem;
  font-weight: 500;
  letter-spacing: -0.2px;
  color: #1a1e24;
}

.calculator__subtitle {
  font-size: 0.8rem;
  color: #5b6f82;
  margin-top: 6px;
}

.calculator__content {
  padding: 1.8rem 2rem 2rem 2rem;
}

.mode-switch {
  background: #f8f9fb;
  border-radius: 44px;
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 1.8rem;
  border: 1px solid #eef0f3;
}

.mode-switch__btn {
  flex: 1;
  text-align: center;
  padding: 0.6rem 0.2rem;
  border-radius: 40px;
  font-weight: 480;
  font-size: 0.85rem;
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: inherit;
  color: #3a4c5e;
  transition: all 0.15s;
}

.mode-switch__btn.active {
  background: #ffffff;
  color: #0f2b3b;
  font-weight: 500;
  border: 0.5px solid #dce3e9;
}

.calculator__description {
  background: #fafcfe;
  border-left: 2px solid #9aaebf;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  margin-bottom: 1.8rem;
  font-size: 0.85rem;
  color: #2c3f4f;
  line-height: 1.35;
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group__label {
  display: block;
  font-weight: 470;
  color: #1e2b36;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.input-group__wrapper {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid #dee4ea;
  transition: 0.1s;
  padding: 0.1rem 0.1rem 0.1rem 1rem;
}

.input-group__wrapper:focus-within {
  border-color: #8ea0b0;
  box-shadow: 0 0 0 2px rgba(100, 120, 140, 0.1);
}

.input-group__currency {
  font-size: 1.2rem;
  font-weight: 470;
  color: #5c6f83;
  margin-right: 8px;
}

.input-group__field {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.2rem;
  padding: 0.8rem 0;
  font-weight: 450;
  outline: none;
  color: #12161c;
  font-family: monospace;
}

.input-group__field::placeholder {
  font-weight: 380;
  font-size: 0.9rem;
  color: #b2c0ce;
  font-family: system-ui, monospace;
}

.calculator__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0.4rem 0 1.4rem;
}

.btn {
  width: 100%;
  border: none;
  padding: 0.85rem;
  border-radius: 40px;
  font-size: 0.95rem;
  font-weight: 470;
  cursor: pointer;
  font-family: inherit;
  transition: 0.12s;
}

.btn--primary {
  background: #1e2e3b;
  color: white;
}

.btn--primary:hover {
  background: #2c3f4e;
}

.btn--secondary {
  background: #ffffff;
  border: 1px solid #cbd7e2;
  color: #2c3f4e;
}

.btn--secondary:hover {
  background: #f6f9fc;
  border-color: #a1b3c2;
}

.result-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 1rem 1.2rem;
  margin-top: 0.2rem;
  border: 1px solid #eef2f5;
}

.result-card__title {
  font-weight: 520;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7f92;
  margin-bottom: 1rem;
}

.result-card__content {
  min-height: 140px;
}

.result-card__placeholder {
  text-align: center;
  color: #8b9eb0;
  padding: 0.5rem 0;
}

.result-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f0f3f7;
  font-size: 0.9rem;
}

.result-line:last-child {
  border-bottom: none;
}

.result-label {
  font-weight: 440;
  color: #475e6f;
}

.result-value {
  font-weight: 550;
  font-size: 1.05rem;
  font-family: monospace;
  color: #1f2e3a;
}

.result-value--highlight {
  color: #1f5e4c;
  font-weight: 600;
}

.calculator__reset {
  text-align: center;
  margin-top: 1rem;
}

.reset-btn {
  background: none;
  border: none;
  color: #7a8c9c;
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 30px;
  font-family: inherit;
}

.reset-btn:hover {
  color: #2c3f4e;
  background: #f4f7fa;
}

.calculator__footer {
  background: #ffffff;
  padding: 0.9rem 2rem;
  text-align: center;
  font-size: 0.65rem;
  color: #8b9bae;
  border-top: 1px solid #eff2f6;
}

@media (max-width: 480px) {
  .calculator__content {
    padding: 1.2rem;
  }
  .calculator__header {
    padding: 1.2rem 1.2rem 0.4rem;
  }
}