:root{
  --bg:#f5f6f8;
  --card:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --dark:#111111;
  --shadow: 0 8px 22px rgba(0,0,0,.06);
  --radius:18px;
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: "Segoe UI","Apple SD Gothic Neo",system-ui,sans-serif;
  background:var(--bg);
  color:var(--text);
}

/* Topbar */
.topbar{
  position: sticky;
  top:0;
  z-index:10;
  background:rgba(245,246,248,.92);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}
.topbar-inner{
  max-width:560px;
  margin:0 auto;
  padding:14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.brand{
  display:flex; align-items:center; gap:10px;
  text-decoration:none; color:var(--text);
}
.brand-mark{
  width:34px; height:34px;
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:50%;
  background:linear-gradient(135deg, rgba(25,195,125,.25), rgba(59,130,246,.18));
  border:1px solid rgba(17,24,39,.08);
  font-weight:900;
}
.brand-text{ font-weight:900; letter-spacing:.2px; }

.topnav{ display:flex; gap:12px; }
.topnav-link{
  font-size:13px;
  color:var(--muted);
  text-decoration:none;
  padding:8px 10px;
  border-radius:10px;
}
.topnav-link:hover{ background:rgba(17,24,39,.05); color:var(--text); }

/* App width (mobile-first) */
.app{
  max-width:560px;
  margin:0 auto;
  padding:16px;
}

.page{ display:flex; flex-direction:column; gap:14px; }

/* Hero */
.hero-card{
  /* ✅ B형: 사진 + 라이트 톤 오버레이 */
  background:
    linear-gradient(
      0deg,
      rgba(255,255,255,.65),
      rgba(255,255,255,.65)
    ),
    url("/static/img/hero_bg.png") center / cover no-repeat;

  border:1px solid rgba(17,24,39,.06);
  border-radius: var(--radius);
  padding:18px;
  box-shadow: var(--shadow);
  position:relative;
  overflow:hidden;
  min-height:160px;
}

.hero-content{
  z-index:2;
  max-width:75%;
  position:relative;
}

.hero-title{
  font-size:20px;
  font-weight:900;
  margin-bottom:8px;
}

.hero-sub{
  font-size:13px;
  line-height:1.45;
  color:var(--muted);
  margin-bottom:14px;
}

/* ✅ 사진 배경에서는 blob 제거 (이상해지는 원인) */
.hero-art{ display:none; }
/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border-radius:12px;
  padding:11px 14px;
  text-decoration:none;
  font-size:13px;
  font-weight:800;
  border:1px solid transparent;
  cursor:pointer;
}
.btn-primary{
  color:white;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}
.btn-dark{
  color:white;
  background: var(--dark);
}
.btn-arrow{ font-size:16px; line-height:1; margin-top:-1px; }

/* Menu list */
.menu-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.menu-item{
  background:var(--card);
  border:1px solid rgba(17,24,39,.06);
  border-radius: var(--radius);
  padding:14px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  box-shadow: var(--shadow);
  text-decoration:none;
  color:inherit;
}
.menu-left{ display:flex; align-items:center; gap:12px; }
.menu-icon{
  width:38px; height:38px;
  border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  background: rgba(17,24,39,.04);
  font-size:18px;
}
.menu-title{ font-weight:900; font-size:14px; }
.menu-desc{ color:var(--muted); font-size:12px; margin-top:2px; }
.menu-right{
  font-size:12px;
  color:var(--text);
  background: rgba(17,24,39,.04);
  padding:8px 10px;
  border-radius: 12px;
  font-weight:800;
}

/* mini hero */
.hero-mini{
  background: radial-gradient(120% 120% at 0% 0%, #ffffff 0%, #f7fffb 45%, #f0f6ff 100%);
  border:1px solid rgba(17,24,39,.06);
  border-radius: var(--radius);
  padding:16px;
  box-shadow: var(--shadow);
  display:flex;
  justify-content:space-between;
  align-items:center;
  overflow:hidden;
}
.hero-mini-title{ font-weight:900; font-size:15px; margin-bottom:6px; }
.hero-mini-desc{ color:var(--muted); font-size:12px; margin-bottom:12px; }
.hero-mini-art{
  width:86px; height:66px;
  border-radius:16px;
  background: linear-gradient(135deg, rgba(25,195,125,.35), rgba(59,130,246,.18));
  border:1px solid rgba(17,24,39,.08);
}

/* Panels */
.panel{
  background:var(--card);
  border:1px solid rgba(17,24,39,.06);
  border-radius: var(--radius);
  padding:16px;
  box-shadow: var(--shadow);
}
.panel-head{ margin-bottom:12px; }
.panel-title{ margin:0; font-size:16px; font-weight:900; }
.panel-meta{ margin-top:6px; font-size:12px; color:var(--muted); }

/* Rate box */
.rate-box{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:12px;
  border:1px solid rgba(17,24,39,.08);
  border-radius: 16px;
  background: rgba(17,24,39,.02);
  margin-bottom:12px;
}
.rate-line{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.rate-fixed{ color:var(--muted); font-weight:800; font-size:13px; }
.rate-input{
  width:200px;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid rgba(17,24,39,.14);
  font-size:15px;
  text-align:right;
  background:white;
}

/* Calculator inputs */
.calc-grid{ display:grid; gap:10px; }
.field-label{ display:block; font-size:12px; color:var(--muted); margin:6px 0; font-weight:800; }
.field-input{
  width:100%;
  padding:14px;
  border-radius:14px;
  border:1px solid rgba(17,24,39,.12);
  font-size:15px;
  background:white;
}

/* Prices */
.price-row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.price-card{
  background:var(--card);
  border:1px solid rgba(17,24,39,.06);
  border-radius: var(--radius);
  padding:14px;
  box-shadow: var(--shadow);
}
.price-brand{ font-weight:900; }
.price-value{
  margin-top:10px;
  font-size:18px;
  font-weight:900;
}
.unit{ font-size:12px; color:var(--muted); font-weight:800; margin-left:4px; }
.price-sub{ margin-top:6px; font-size:12px; color:var(--muted); }

@media (min-width: 900px){
  .app{ max-width: 620px; }
}


/* ===== Trade Page ===== */
.trade-wrap{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.trade-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:6px 2px 2px;
}
.back-btn{
  text-decoration:none;
  font-size:18px;
  padding:10px 12px;
  border-radius:12px;
  color:#111827;
  background: rgba(17,24,39,.04);
}
.trade-title{
  font-weight:900;
  color:#10b981;
}
.trade-spacer{ width:42px; }

.trade-tabs{
  display:flex;
  gap:8px;
  border-bottom:1px solid rgba(17,24,39,.12);
  padding-bottom:10px;
}
.tab{
  border:none;
  background: rgba(17,24,39,.04);
  color:#111827;
  padding:10px 14px;
  border-radius:12px 12px 0 0;
  font-weight:900;
  cursor:pointer;
  font-size:13px;
}
.tab.active{
  background:#fff;
  border:1px solid rgba(17,24,39,.12);
  border-bottom: 1px solid #fff;
}

.coin-row{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 2px;
}
.coin-badge{
  width:34px; height:34px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(17,24,39,.06);
  font-weight:900;
}
.coin-name{
  font-weight:900;
  font-size:16px;
}

.tab-panel{ display:none; }
.tab-panel.show{ display:block; }

.form-card{
  background:#fff;
  border-radius:18px;
  padding:16px;
  border:1px solid rgba(17,24,39,.06);
  box-shadow: 0 8px 22px rgba(0,0,0,.06);
}

.amount-row{
  display:flex;
  align-items:center;
  gap:10px;
}
.amount-unit{
  color:#9ca3af;
  font-weight:900;
}

.address-row{
  display:flex;
  align-items:center;
  gap:10px;
}
.icon-btn{
  width:44px;
  height:44px;
  border-radius:14px;
  border:1px solid rgba(17,24,39,.12);
  background:#fff;
  cursor:pointer;
  font-size:18px;
}

.submit-btn{
  width:100%;
  margin-top:16px;
  padding:14px 16px;
  border:none;
  border-radius:14px;
  background:#d1d5db;
  color:#6b7280;
  font-weight:900;
  cursor:not-allowed;
}

/* QR Area */
.qr-area{
  margin-top:12px;
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(17,24,39,.12);
  background: rgba(17,24,39,.02);
}
.qr-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
}
.qr-title{ font-weight:900; }
.qr-close{
  border:none;
  background: rgba(17,24,39,.08);
  padding:8px 10px;
  border-radius:12px;
  cursor:pointer;
  font-weight:900;
}
.qr-reader{
  width:100%;
  max-width:420px;
  margin:0 auto;
}
.qr-help{
  margin-top:10px;
  font-size:12px;
  color:#6b7280;
}
.empty-note{
  color:#6b7280;
  font-size:13px;
}
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}

/* =========================
   Exchange price cards
   ========================= */
.price-card{
  position:relative;
  overflow:hidden;
  border-radius:14px;
  padding:14px;
  box-shadow: var(--shadow);
  border:1px solid rgba(17,24,39,.06);

  /* ✅ 사진 + 톤 오버레이 (B형) */
  background:
    linear-gradient(
      0deg,
      rgba(255,255,255,.70),
      rgba(255,255,255,.70)
    ),
    var(--bg-image) center / cover no-repeat;
}

/* 텍스트는 항상 위 */
.price-card > *{
  position:relative;
  z-index:2;
}

/* 업비트 */
.price-card.upbit .price-brand{
  color:#2563eb; /* 파란색 */
}

/* 빗썸 */
.price-card.bithumb .price-brand{
  color:#f97316; /* 주황색 */
}
/* =========================
   ONLY 거래번호 조회 카드 강조
   ========================= */
.menu-item.menu-lookup{
  padding:24px 18px;     /* 카드 안을 꽉 채움 */
  min-height:96px;       /* 높이 확실히 증가 */
}

/* 아이콘 크게 */
.menu-item.menu-lookup .menu-icon{
  font-size:30px;
  width:48px;
  height:48px;
}

/* 제목 크게 */
.menu-item.menu-lookup .menu-title{
  font-size:18px;
  font-weight:900;
}

/* 설명도 한 단계 업 */
.menu-item.menu-lookup .menu-desc{
  font-size:14px;
  margin-top:6px;
}

/* 우측 조회 버튼 강조 */
.menu-item.menu-lookup .menu-right{
  font-size:15px;
  font-weight:900;
  padding:10px 14px;
  border-radius:12px;
}

/* =========================
   거래번호 조회 카드 – 현재 대비 1/3 축소
   ========================= */

.menu-item.menu-lookup{
  padding:8px 10px;     /* ⬅ 12→8 */
  min-height:48px;      /* ⬅ 64→48 */
}

/* 아이콘 */
.menu-item.menu-lookup .menu-icon{
  font-size:28px;       /* ⬅ 20→16 */
  width:30px;           /* ⬅ 34→26 */
  height:30px;
}

/* 제목 */
.menu-item.menu-lookup .menu-title{
  font-size:15px;       /* ⬅ 15→13 */
}

/* 설명 */
.menu-item.menu-lookup .menu-desc{
  font-size:13px;       /* ⬅ 12→11 */
  margin-top:3px;
}

/* 오른쪽 조회 영역: 흰 여백만 유지 */
.menu-item.menu-lookup .menu-right{
  padding-left:12px;    /* ⬅ 18→12 */
  padding-right:14px;
  font-size:14px;
}

/* 거래소 브랜드 + 로고 */
.price-brand.with-logo{
  display:flex;
  align-items:center;
  gap:6px;
  font-weight:900;
}

/* 업비트 로고 크기 */
.price-brand.with-logo .brand-logo{
  width:16px;
  height:16px;
  object-fit:contain;
}

/* 모바일에서도 안정적으로 */
@media (max-width:480px){
  .price-brand.with-logo .brand-logo{
    width:15px;
    height:15px;
  }
}

/* 메뉴 아이콘 → 이미지 로고 */
.menu-icon{
  width:38px;
  height:38px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(17,24,39,.04);
}

/* 실제 로고 이미지 */
.menu-icon .menu-logo{
  width:22px;
  height:22px;
  object-fit:contain;
}
.pending-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:18px;
  height:18px;
  padding:0 6px;
  margin-left:6px;
  border-radius:999px;
  background:#ef4444;
  color:#fff;
  font-size:11px;
  font-weight:900;
  line-height:18px;
}


