/* 기본 리셋 & 폰트 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui,
    -system-ui, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  background: #f4f6fb;
  color: #111827;
  overflow-x: hidden; /* 가로 튐 방지 */
}

/* 레이아웃 */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px 32px;
}

/* 헤더 */
.header {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title h1 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
}

.header-title-row{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}

.header-subtitle {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: #6b7280;
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 카드 공통 */
.card {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 18px 18px;
  margin-bottom: 16px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  border: 1px solid #e5e7eb;
}

.card-auth {
  max-width: 460px;
  margin: 12px auto 20px;
}

.card-title {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 600;
}

.card-desc {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: #6b7280;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 폼 스타일 */
.form {
  margin-top: 6px;
}

.form-row {
  margin-bottom: 10px;
}

.form-label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: #374151;
  gap: 4px;
}

.form-checkbox{
  display:flex;
  align-items:center;
  gap:8px;
  font-size: 0.85rem;
  color:#374151;
}

.input {
  padding: 8px 10px;
  font-size: 0.9rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  outline: none;
  background: #f9fafb;
}

.input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
  background: #ffffff;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-full {
  width: 100%;
}

/* 버튼 스타일 */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 8px 14px;
  font-size: 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.btn-sm{
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #059669);
  border-color: #2563eb;
  color: #ffffff;
}

.btn-primary:hover {
  opacity: 0.95;
}

.btn-secondary {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.btn-secondary:hover {
  background: #020617;
}

.btn-outline {
  background: transparent;
  border-color: #9ca3af;
  color: #374151;
}

.btn-outline:hover {
  background: #f3f4f6;
}

/* 텍스트 */
.text-error {
  margin: 0;
  font-size: 0.8rem;
  color: #dc2626;
}

/* 테이블 */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.table thead {
  background: #f3f4f6;
}

.table th,
.table td {
  border: 1px solid #e5e7eb;
  padding: 6px 8px;
  text-align: left;
}

.table th {
  font-weight: 600;
  color: #4b5563;
}

.table tbody tr:nth-child(even) {
  background: #f9fafb;
}

/* 푸터 */
.footer {
  margin-top: auto;
  padding: 12px 16px 16px;
  text-align: center;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* 반응형 (헤더) */
@media (max-width: 720px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .card-auth {
    width: 100%;
    margin: 12px auto 20px;
  }
}

/* ===== 상단 도구 탭 네비게이션 ===== */
.tools-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0 auto 1.5rem;
  justify-content: center;
  max-width: 960px;
}

.tool-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.8rem;
  border-radius: 0.5rem;
  border: 1px solid #111827;
  background: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: background 0.15s ease, color 0.15s ease,
    box-shadow 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.tool-tab:hover {
  background: #111827;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
  transform: translateY(-1px);
}

/* 모바일에서 너비 꽉 채우도록 */
@media (max-width: 768px) {
  .tools-tabs {
    gap: 0.75rem;
  }
  .tool-tab {
    flex: 1 1 100%;
  }
}

/* 내 대시보드 – 멤버십 뱃지 */
.badge-membership {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  line-height: 1;
  padding: 0 12px;
  margin-left: 8px;
  border-radius: 999px;
  border: 1px solid #2563eb;
  background: #eff6ff;
  color: #2563eb;
  font-size: 0.75rem;
  font-weight: 600;
}
/* ✅ 멤버십 등급별 색상 */
.badge-membership.tier-basic {
  background: #f3e4cf;
  color: #6b3f1d;
  border-color: rgba(107, 63, 29, 0.25);
}

.badge-membership.tier-silver {
  background: #eef2f6;
  color: #4b5563;
  border-color: rgba(75, 85, 99, 0.25);
}

.badge-membership.tier-gold {
  background: #fff2c6;
  color: #8a5b00;
  border-color: rgba(138, 91, 0, 0.25);
}

.badge-membership.tier-platinum {
  background: #efe7ff;
  color: #4c1d95;
  border-color: rgba(76, 29, 149, 0.25);
}

/* badge-membership 모양은 그대로 쓰고, 색만 membership-info-btn이 덮어씀 */
.membership-info-btn {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
  cursor: pointer;
  margin-left: 0;
}
.membership-info-btn:hover {
  background: #bfdbfe;
}

/* 세로 요약 리스트 */
.summary-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  border-top: 1px solid #e5e7eb;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.95rem;
}

.summary-label {
  color: #4b5563;
}

.summary-value {
  font-weight: 600;
  color: #111827;
}

/* 이름 줄 */
.dashboard-greeting {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* === 공통 모달 스타일 === */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 14px;
}

.modal.hidden {
  display: none;
}

.modal-panel {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px 28px;
  max-width: 640px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.25);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  color: #6b7280;
}

.modal-close:hover {
  color: #111827;
}

.modal-desc {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 12px;
}

.help-text {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 4px;
}

/* ✅ 리워드 액션 버튼 (기본은 PC) */
.reward-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* ✅ 모바일에서 “글씨 튐” 해결: 2열 → 아주 좁으면 1열 */
@media (max-width: 720px) {
  .reward-actions {
    justify-content: stretch;
  }
  .reward-actions .btn {
    flex: 1 1 calc(50% - 10px);
    white-space: normal;      /* 줄바꿈 허용 */
    line-height: 1.2;
    text-align: center;
    min-width: 0;
  }
}
@media (max-width: 420px) {
  .reward-actions .btn {
    flex: 1 1 100%;
  }
}

/* 자산 현황 카드 */
.asset-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 10px;
}

.asset-label {
  font-size: 0.78rem;
  color: #6b7280;
}

.asset-value {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

/* 자산 그리드 */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}

.asset-grid-wallet-like{
  grid-template-columns: 1fr 360px;
  align-items: start;
}

.asset-column {
  background: #f9fafb;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  min-width: 0;
}

.asset-column-wallet-ui{
  background: transparent;
  border: none;
  padding: 0;
}

.asset-title {
  margin: 0 0 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

.asset-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  font-size: 0.85rem;
}

.asset-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  gap: 10px;
  min-width: 0;
}

.asset-list li span:first-child {
  color: #6b7280;
}

/* ✅ kv-list/kv-row: 라벨/값 밀림 방지 */
.kv-list .kv-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 0;
  min-width: 0;
}
.kv-list .kv-row > span:first-child {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}
.kv-list .kv-row > span:last-child {
  flex: 0 0 auto;
  white-space: nowrap; /* 숫자/단위는 한 줄 유지 */
  text-align: right;
}

.asset-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.form-label.compact {
  font-size: 0.78rem;
}

.input-sm {
  padding: 6px 8px;
  font-size: 0.8rem;
}

/* 자산 탭 버튼 */
.asset-tab-buttons {
  display: flex;
  gap: 8px;
  margin: 10px 0 12px;
  flex-wrap: wrap;
}

.asset-tab-btn {
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 999px;
}

.asset-tab-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* 패널 show/hide */
.asset-panel { display: none; }
.asset-panel.active { display: block; }

/* 김루트 입력 영역 숨김 (관리자용 예약) */
.asset-kimroot-edit-hidden { display: none; }

/* ROI 색상 */
.roi-positive { color: #ef4444; }
.roi-negative { color: #2563eb; }

.asset-list span.roi-positive { color: #ef4444 !important; }
.asset-list span.roi-negative { color: #2563eb !important; }

/* ✅ 모바일에서 자산 영역 2열 → 1열 */
@media (max-width: 900px){
  .asset-grid { grid-template-columns: 1fr; }
  .asset-grid-wallet-like{ grid-template-columns: 1fr; }
}

/* ===== NGY 거래소 가격 비교 카드 ===== */
.exchange-compare-box {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 18px 18px;
  margin-bottom: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.exchange-compare-box h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* 기존 compare-row(혹시 다른 곳에서 쓰면 유지) */
.compare-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

/* ✅ 너 HTML에서 넣은 compare-grid 전용: overflow 방지 */
.compare-row.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.compare-item {
  padding: 15px;
  border-radius: 10px;
  background: #f7f9fc;
  text-align: center;
  min-width: 0;
}

.compare-item .label {
  font-size: 14px;
  color: #555;
}

.compare-item .price,
.compare-item .diff {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 700;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.diff-box .diff.positive { color: #d9534f; }
.diff-box .diff.negative { color: #5cb85c; }

.compare-text {
  margin-top: 8px;
  text-align: center;
  font-size: 0.9rem;
  color: #4b5563;
}

.compare-desc {
  margin-top: 8px;
  text-align: center;
  font-size: 0.85rem;
  color: #6b7280;
}

/* ✅ 모바일에서 가격 비교 3칸 → 세로 스택 */
@media (max-width: 720px) {
  .compare-row.compare-grid {
    grid-template-columns: 1fr;
  }
  .compare-item .price,
  .compare-item .diff {
    font-size: 18px;
  }
}

/* ========================= */
/* [요청] 섹션 탭 + 목록 패널 */
/* ========================= */
.request-tab-buttons {
  display: flex;
  gap: 8px;
  margin: 10px 0 12px;
  flex-wrap: wrap;
}

.request-tab-btn {
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 999px;
}

.request-tab-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.request-panel {
  display: none;
  margin-top: 6px;
}

.request-panel.active {
  display: block;
}

.request-panel-title {
  margin: 6px 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
}

.request-sub-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.request-list-panel {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.request-list-panel.active {
  display: block;
}

/* ========================= */
/* ✅ 멤버십/소개/스테이킹 모달 (overlay) */
/* ========================= */
.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}
.modal-overlay.hidden{ display:none; }

.modal-card{
  width: min(980px, 100%);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  padding: 18px;
  max-height: 86vh;
  overflow: auto;
}

.modal-card-scroll{
  max-height: 86vh;
  overflow: auto;
}

/* ✅ (중요) modal-card 전용으로 범위 제한: 기존 .modal-header/.modal-close 덮어쓰기 방지 */
.modal-card .modal-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-card .modal-header h2{
  margin:0;
  font-size: 18px;
}

.modal-subtitle{
  margin:6px 0 0;
  font-size: 13px;
  color:#667085;
}

.modal-card .modal-close{
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}
.modal-card .modal-close:hover{ background:#f6f8fa; }

.membership-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.membership-tier{
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.tier-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.tier-name{
  font-weight: 800;
  font-size: 16px;
}
.tier-price{
  text-align:right;
}
.tier-price-label{
  display:block;
  font-size: 12px;
  color:#667085;
}
.tier-price-value{
  display:block;
  font-size: 18px;
  font-weight: 800;
}

.tier-cta{
  width:100%;
  margin: 6px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d0d7de;
  background: #fff;
  cursor:pointer;
  font-weight: 700;
}
.tier-cta:hover{ background:#f6f8fa; }
.tier-cta-primary{
  border-color: #1d4ed8;
  background: #2563eb;
  color: #fff;
}
.tier-cta-primary:hover{ background:#1d4ed8; }

.tier-features{
  margin: 0;
  padding-left: 18px;
  color:#334155;
  font-size: 13px;
  line-height: 1.6;
}

.modal-footer{
  margin-top: 10px;
}
.muted{ color:#667085; }

/* 반응형 */
@media (max-width: 980px){
  .membership-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px){
  .membership-grid{ grid-template-columns: 1fr; }
}

/* ========================= */
/* ✅ 김루트 소개 모달 내용 스타일 */
/* ========================= */
.intro-section{ margin-bottom: 18px; }
.intro-h3{
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
}
.intro-h4{
  margin: 14px 0 8px;
  font-size: 14px;
  font-weight: 800;
}
.intro-table th{
  width: 180px;
  background: #f8fafc;
}
.intro-quote{
  margin: 12px 0;
  padding: 12px 14px;
  border-left: 4px solid #2563eb;
  background: #f8fafc;
  border-radius: 10px;
  color: #0f172a;
  font-weight: 600;
}
.intro-p{
  margin: 10px 0;
  color: #0f172a;
  line-height: 1.7;
  font-size: 14px;
}
.intro-list{
  margin: 8px 0 0;
  padding-left: 18px;
  line-height: 1.7;
  color: #0f172a;
  font-size: 14px;
}

/* ========================= */
/* ✅ “나가야 월렛 느낌” 카드 */
/* ========================= */
.ngy-wallet-like{
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 20px rgba(15,23,42,.06);
  overflow: hidden;
}

.ngy-wallet-like__hero{
  height: 96px;
  background: linear-gradient(135deg, #6d28d9, #4f46e5);
  position: relative;
  display:flex;
  justify-content:center;
}

.ngy-wallet-like__coin{
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #ffe9a3, #f5b800);
  border: 2px solid rgba(255,255,255,.85);
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
  overflow: hidden;
  position: absolute;
  bottom: -32px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.ngy-wallet-like__coin img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display:block;
}

.ngy-wallet-like__body{
  padding: 44px 16px 14px;
}

.ngy-wallet-like__title{
  display:flex;
  align-items:center;
  gap: 8px;
  font-weight: 800;
  font-size: 14px;
  color: #0f172a;
  flex-wrap: wrap;
}

.ngy-wallet-like__status{
  font-weight: 700;
  font-size: 12px;
  color: #ef4444;
}

.ngy-wallet-like__balance{
  margin-top: 8px;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #111827;
  display:flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap; /* ✅ 아주 좁을 때 줄바꿈 허용 */
}

.ngy-wallet-like__unit{
  font-size: 16px;
  font-weight: 800;
  color: #475569;
}

.ngy-wallet-like__sub{
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

/* ✅ 스테이킹 현황 모달(두번째 캡처) 글씨 밀림 방지: 작은 화면에서 숫자 크기만 살짝 다운 */
@media (max-width: 420px){
  .ngy-wallet-like__balance{ font-size: 34px; }
}

.asset-edit-grid--single { grid-template-columns: 1fr; }

.pending-badge{
  display:inline-block;
  margin-left:8px;
  padding:4px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  background:rgba(255,180,0,.12);
  border:1px solid rgba(255,180,0,.35);
  color:#ffb400;
}

.hidden{ display:none !important; }

/* =========================
   리워드 히스토리 모달 가독성 개선
========================= */

/* ✅ (핵심) PC: 모달 폭 확장 - 충돌나던 1180px 오버라이드 제거하고 한 곳으로 통일 */
#rewardHistoryModal .modal-content,
#rewardHistoryModal .modal-panel,
#rewardHistoryModal .modal-card {
  width: min(1400px, 96vw) !important;
  max-width: none !important;
  max-height: 86vh !important;
  overflow: auto !important;
}

/* ✅ 금액 색상: + 빨강 / - 파랑 (요청대로) */
#rewardHistoryModal .rh-amt.plus {
  color: #ef4444;
  font-weight: 700;
}
#rewardHistoryModal .rh-amt.minus {
  color: #3b82f6;
  font-weight: 700;
}
#rewardHistoryModal .rh-amt.zero {
  color: #111827;
}

/* ✅ 일자는 검정 유지 */
#rewardHistoryModal .rh-date {
  color: #111827;
  font-weight: 600;
}

/* ✅ 표 레이아웃: 고정 + 컬럼 폭 분배 (메모 칸 넓히기) */
#rewardHistoryModal table {
  table-layout: fixed;
  width: 100%;
}

/* 날짜/금액은 한 줄 유지 + 메모는 줄바꿈 */
#rewardHistoryModal th:nth-child(1),
#rewardHistoryModal td:nth-child(1) {
  width: 230px;
  white-space: nowrap;
}

#rewardHistoryModal th:nth-child(2),
#rewardHistoryModal td:nth-child(2) {
  width: 150px;
  white-space: nowrap;
}

/* ✅ (요청) 메모 줄바꿈/가독성 개선: “안 밀리게” */
#rewardHistoryModal th:nth-child(3),
#rewardHistoryModal td:nth-child(3) {
  white-space: normal !important;
  word-break: keep-all;
  overflow-wrap: anywhere; /* 긴 영문/특수 문자열도 안전 */
}

/* 기본 셀 스타일(전체) */
#rewardHistoryModal td,
#rewardHistoryModal th {
  padding: 8px 10px;
  vertical-align: top;
}

/* ✅ 모바일: 표를 카드형으로 변환해서 "밀림" 제거 */
@media (max-width: 640px) {
  #rewardHistoryModal table thead {
    display: none;
  }

  #rewardHistoryModal table,
  #rewardHistoryModal tbody,
  #rewardHistoryModal tr,
  #rewardHistoryModal td {
    display: block;
    width: 100%;
  }

  #rewardHistoryModal tr {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #fff;
  }

  #rewardHistoryModal td {
    border: none !important;
    padding: 6px 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
  }

  #rewardHistoryModal td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #6b7280;
    flex: 0 0 auto;
  }

  /* 메모는 길어서 세로로 더 보기 좋게 */
  #rewardHistoryModal td.rh-memo {
    display: block;
  }
  #rewardHistoryModal td.rh-memo::before {
    display: block;
    margin-bottom: 4px;
  }
}
/* =========================
   김루트 소개 모달(kr-)
========================= */
.kr-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
}

.kr-modal.hidden { display: none; }

.kr-modal-card {
  width: min(980px, 100%);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  padding: 22px 22px 18px;
  position: relative;
}

.kr-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.kr-intro-header {
  margin-bottom: 14px;
}

.kr-intro-title {
  font-weight: 800;
  font-size: 22px;
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.kr-ver {
  font-weight: 700;
  font-size: 14px;
  color: #6b7280;
}

.kr-intro-sub {
  margin-top: 6px;
  color: #6b7280;
  font-size: 13px;
}

.kr-sec { margin-top: 16px; }

.kr-sec-title {
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 8px;
}

.kr-badge {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.kr-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.kr-table th,
.kr-table td {
  border-bottom: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  padding: 10px 12px;
  font-size: 13px;
  vertical-align: top;
}

.kr-table tr:last-child th,
.kr-table tr:last-child td { border-bottom: none; }

.kr-table th:last-child,
.kr-table td:last-child { border-right: none; }

.kr-table tbody th {
  width: 180px;
  background: #f8fafc;
  color: #111827;
  font-weight: 700;
}

.kr-table thead th {
  background: #f8fafc;
  font-weight: 800;
}

.kr-quote {
  margin-top: 16px;
  padding: 14px 14px;
  border-left: 4px solid #2563eb;
  background: #f8fafc;
  border-radius: 10px;
  font-weight: 800;
  color: #111827;
}

.kr-footnote {
  margin-top: 10px;
  color: #6b7280;
  font-size: 12px;
}

/* 모바일에서 표가 너무 빡빡하면 */
@media (max-width: 560px) {
  .kr-table tbody th { width: 120px; }
  .kr-modal-card { padding: 18px 14px 14px; }
}
.kr-modal-wide { width: min(880px, 92vw); }

.kr-staking-card{
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
}

.kr-staking-hero{
  height: 140px;
  background: linear-gradient(90deg,#6d28d9,#4f46e5);
  position: relative;
}

.kr-staking-coin{
  position:absolute;
  left:50%;
  bottom:-28px;
  transform:translateX(-50%);
  width:76px;
  height:76px;
  border-radius:50%;
  background: rgba(255,255,255,0.85);
  display:grid;
  place-items:center;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}

.kr-staking-coin img{
  width:64px;
  height:64px;
  object-fit:contain;
}

.kr-staking-body{ padding: 46px 28px 24px; }

.kr-staking-label{
  font-size:15px;
  color:#111827;
  margin-bottom:12px;
}

.kr-lock{
  color:#ef4444;
  font-weight:700;
  margin-left:6px;
}

.kr-staking-amount{
  display:flex;
  align-items:baseline;
  gap:10px;
  margin-bottom:10px;
}

.kr-staking-num{
  font-size:56px;
  line-height:1;
  font-weight:800;
  letter-spacing:-1px;
  color:#111827;
}

.kr-staking-unit{
  font-size:18px;
  font-weight:700;
  color:#374151;
}

.kr-staking-footnote{
  font-size:13px;
  color:#6b7280;
}
/* 멤버십 모달(v2.2) - 길어질 때 스크롤 */
.modal-card.membership-panel{
  max-width: 980px;
  max-height: 85vh;
  overflow: auto;
}

/* 섹션/테이블 */
.membership-sections{ margin-top: 16px; }
.ms-block{ margin-top: 16px; padding-top: 10px; border-top: 1px solid rgba(0,0,0,0.08); }
.ms-title{ font-weight: 800; margin: 8px 0 10px; }

.table-wrap{
  overflow-x: auto;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  background: #fff;
}

.benefit-table{
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.benefit-table th,
.benefit-table td{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  text-align: center;
  font-size: 13px;
}

.benefit-table thead th{
  background: rgba(0,0,0,0.03);
  font-weight: 800;
}

.benefit-table th:first-child,
.benefit-table td:first-child{
  text-align: left;
  font-weight: 800;
  width: 220px;
}

.ms-guide ul{
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
  font-size: 13px;
  color: rgba(0,0,0,0.75);
}

/* 현재 등급 강조(있으면 좋음) */
.membership-tier.is-current{
  outline: 2px solid rgba(37, 99, 235, 0.35);
  border-radius: 14px;
}
.topNavHost{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  justify-content:center;
  align-items:center;
  margin: 14px 0 10px;
}

/* 버튼 크기/정렬 통일 */
.topNavHost > button,
.topNavHost > a{
  flex: 0 1 210px;     /* ✅ 각 버튼이 일정 폭을 가지되, 화면에 따라 줄바꿈 */
  min-width: 180px;
  white-space: nowrap;
}

