:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #0f2448;
  --text-subtle: #4f6283;
  --border: #d8e0ef;
  --primary: #1d5eff;
  --primary-2: #2da1ff;
  --shadow: 0 12px 30px rgba(35, 61, 125, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  touch-action: manipulation;
}

.page {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 20px 16px 28px;
}

.hero h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
}

.hero p {
  margin: 8px 0 18px;
  color: #5c6c87;
  line-height: 1.5;
}

.card,
.result-card {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.label {
  font-size: 14px;
  color: var(--text-subtle);
}

.currency-wrap {
  margin-top: 2px;
}

.currency-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.picker-group {
  min-width: 0;
}

.picker {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f9fbff;
  color: var(--text);
  height: 44px;
  padding: 10px 28px 10px 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.swap-btn {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.preset-wrap {
  margin-top: 14px;
}

.preset-list {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-btn {
  border: 1px solid #d7e2f5;
  border-radius: 999px;
  background: #f7faff;
  color: #1a335f;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.preset-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent;
  color: #fff;
}

.amount-wrap {
  margin-top: 14px;
}

.amount-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 10px;
  align-items: end;
}

.amount-main {
  min-width: 0;
}

.amount-input-wrap {
  position: relative;
}

.amount-input {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f9fbff;
  color: var(--text);
  height: 64px;
  padding: 10px 58px 10px 12px;
  font-size: 28px;
  font-weight: 700;
}

.amount-unit {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-size: 12px;
  color: #a0adc4;
  pointer-events: none;
}

.amount-stepper {
  align-self: end;
  height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  align-items: center;
  overflow: visible;
}

.step-btn {
  border: 0;
  background: transparent;
  color: inherit;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.step-btn::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -12px;
  transform: translateX(-50%);
  width: 56px;
  height: 52px;
  border-radius: 28px;
  background: rgba(0, 0, 0, 0);
}

.step-icon {
  border: 1px solid #d7e2f5;
  border-radius: 50%;
  background: #f7faff;
  color: #1a335f;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.step-btn:hover .step-icon {
  background: #ecf3ff;
}

.swap-btn:disabled,
.step-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.result-card {
  margin-top: 14px;
}

.result-label {
  margin-bottom: 6px;
}

.result-main {
  font-size: 34px;
  font-weight: 700;
  display: flex;
  align-items: baseline;
}

.result-number {
  font-size: inherit;
  font-weight: inherit;
}

.result-unit-text {
  margin-left: 12px;
  font-size: 20px;
  font-weight: 600;
  color: #7f8ea8;
}

.result-rate {
  margin-top: 8px;
  color: #3f5378;
}

.result-time {
  margin-top: 6px;
  color: #8393ac;
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: rgba(16, 40, 78, 0.92);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
}

.hidden {
  display: none;
}

@media (max-width: 520px) {
  .hero h1 {
    font-size: 24px;
  }

  .amount-row {
    grid-template-columns: minmax(0, 1fr) 82px;
  }

  .amount-input {
    font-size: 24px;
  }

  .result-main {
    font-size: 28px;
  }
}
