/* 환율 계산기 */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --blue: #2563eb;
  --blue2: #1d4ed8;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: 'Pretendard', 'Apple SD Gothic Neo', sans-serif; font-size: 14px; }

.wrap { max-width: 100%; padding: 0 0 60px; }

/* ── 헤더 ── */
.top { padding: 20px 0 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 48px; height: 48px; flex-shrink: 0;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 22px;
}
h1 { font-size: 22px; font-weight: 700; }
.sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ── 메인 카드 ── */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.update-time { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: auto; }

/* ── 변환 영역 ── */
.conv-block { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.curr-group label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }
.curr-group input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 18px; font-weight: 700; outline: none; transition: border-color .12s;
}
.curr-group input:focus { border-color: var(--blue); }
.curr-group select {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 14px; background: var(--card); outline: none; transition: border-color .12s; margin-top: 6px;
}
.curr-group select:focus { border-color: var(--blue); }

.swap-col { display: flex; align-items: flex-end; padding-bottom: 2px; }
.swap-btn {
  padding: 11px 12px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--card); cursor: pointer; font-size: 18px; transition: all .12s;
}
.swap-btn:hover { border-color: var(--blue); background: #eff6ff; }

.rate-display { margin-top: 14px; padding: 12px 16px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; font-size: 13px; color: #1e40af; display: flex; align-items: center; gap: 8px; }
.rate-display strong { font-weight: 700; }

/* ── 주요 통화 테이블 ── */
.rates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.rate-card {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; cursor: pointer; transition: all .12s;
}
.rate-card:hover { border-color: var(--blue); background: #eff6ff; }
.rate-card .rc-flag { font-size: 20px; }
.rate-card .rc-name { font-size: 12px; color: var(--muted); }
.rate-card .rc-rate { font-size: 15px; font-weight: 700; color: var(--ink); }
.rate-card .rc-row { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }

.loading-msg { text-align: center; padding: 30px; color: var(--muted); font-size: 13px; }
.error-msg { text-align: center; padding: 20px; color: #dc2626; background: #fef2f2; border-radius: 8px; font-size: 13px; }

/* ── 사용 안내 ── */
.guide-section {
  margin-top: 24px; background: rgba(246,248,255,.6);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}
.guide-section h2 { font-size: 15px; font-weight: 800; margin: 0 0 10px; color: var(--ink); }
.guide-section h2:not(:first-child) { margin-top: 18px; }
.guide-steps, .guide-features, .guide-usecase {
  margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.8;
}
.guide-steps li, .guide-features li, .guide-usecase li { margin-bottom: 4px; }
.guide-steps strong, .guide-features strong { color: var(--ink); }
.guide-privacy {
  margin-top: 16px; background: #eff6ff; border: 1px solid rgba(37,99,235,.22);
  border-radius: 12px; padding: 12px 14px; font-size: 12px; color: #1e40af; line-height: 1.55;
}

@media (max-width: 560px) {
  .conv-block { grid-template-columns: 1fr; }
  .swap-col { justify-content: center; }
}
