
/* 뉴스/랩 마크다운 본문 스타일 */
.news-md h1, .news-md h2, .news-md h3 { color: #16005C; margin: 18px 0 8px; line-height: 1.35; }
.news-md h1 { font-size: 18px; }
.news-md h2 { font-size: 16px; }
.news-md h3 { font-size: 14px; }
.news-md p { margin: 0 0 10px; }
.news-md ul, .news-md ol { padding-left: 22px; margin: 0 0 12px; }
.news-md li { margin: 4px 0; }
.news-md strong { color: #16005C; font-weight: 700; }
.news-md em { font-style: italic; color: #555; }
.news-md a { color: #F5A623; text-decoration: underline; }
.news-md code { background: rgba(22,0,92,0.06); padding: 2px 6px; border-radius: 4px; font-family: Consolas,Menlo,monospace; font-size: 12px; color: #6D4C00; }
.news-md pre { background: rgba(22,0,92,0.04); padding: 12px 14px; border-radius: 6px; overflow-x: auto; font-size: 12px; line-height: 1.55; margin: 0 0 12px; }
.news-md pre code { background: none; padding: 0; color: #16005C; }
.news-md blockquote { border-left: 3px solid #FFC107; margin: 8px 0; padding: 6px 12px; color: #555; background: rgba(255,193,7,0.06); border-radius: 0 6px 6px 0; }
.news-md hr { border: none; border-top: 1px dashed #ddd; margin: 16px 0; }
.news-md table { border-collapse: collapse; margin: 0 0 12px; font-size: 12px; }
.news-md th, .news-md td { border: 1px solid #ddd; padding: 6px 10px; }
.news-md th { background: #F5F5F7; color: #16005C; }

/* 트랜잭션 필터 적용 스피너 */
.tx-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: middle;
  animation: tx-spin 0.8s linear infinite;
}
#transfersBody .tx-spinner {
  border-color: #ddd;
  border-top-color: #16005C;
  width: 18px;
  height: 18px;
}
@keyframes tx-spin {
  to { transform: rotate(360deg); }
}

  :root {
    --mbc-navy:#16005C;
    --mbc-navy-dark:#0D0033;
    --mbc-navy-light:#2A1480;
    --mbc-blue:#2A3A8C;
    --mbc-accent:#4F3BFF;
    --mbc-gold:#F5A623;
    --green:#2E7D32;
    --red:#C62828;
    --gray:#666;
    --bg:#FFFFFF;
    --bg-soft:#F8F9FC;
    --card:#FFFFFF;
    --text:#1A1A2E;
    --text-sub:#6B6B80;
    --border:#E8EAF0;
    --sidebar-text:#C7C9D9;
    --sidebar-text-active:#FFFFFF;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, '맑은 고딕', sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
  a { color: inherit; }

  /* ── 헤더 (네이비 배경 + 흰색 텍스트) ── */
  header { background: var(--mbc-navy); border-bottom: 1px solid var(--mbc-navy-dark); padding: 0 28px; height: 68px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
  header .brand { flex: 1; display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; cursor: pointer; }
  header .brand:hover { opacity: 0.88; }
  .brand-logo { width: 44px; height: 44px; flex-shrink: 0; background: #fff; border-radius: 10px; padding: 4px; }
  header h1 { font-size: 19px; font-weight: 700; color: #fff; letter-spacing: -0.3px; line-height: 1.2; }
  header .sub { font-size: 11px; color: #C7C9D9; font-weight: 500; }
  header .nav { display: flex; align-items: center; gap: 4px; }
  header .nav a { color: #C7C9D9; font-size: 13px; text-decoration: none; padding: 8px 14px; border-radius: 6px; font-weight: 500; transition: background .2s, color .2s; cursor: pointer; }
  header .nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
  header .nav a.external::after { content: ' ↗'; font-size: 10px; opacity: 0.6; }

  /* 언어 토글 */
  .lang-toggle { display: flex; align-items: center; gap: 0; margin-right: 8px; border: 1.5px solid rgba(255,255,255,.25); border-radius: 6px; overflow: hidden; }
  .lang-toggle button { background: transparent; color: #C7C9D9; border: none; padding: 6px 12px; font-size: 12px; font-weight: 700; cursor: pointer; transition: background .15s, color .15s; }
  .lang-toggle button.active { background: var(--mbc-gold); color: var(--mbc-navy-dark); }
  .lang-toggle button:hover:not(.active) { background: rgba(255,255,255,.08); color: #fff; }

  /* ── 상단 sticky 광고 배너 (네이비) ── */
  .top-ad-bar { background: var(--mbc-navy-dark); border-bottom: 1px solid rgba(255,255,255,.1); padding: 8px 16px; position: sticky; top: 68px; z-index: 99; display: flex; justify-content: center; }
  .top-ad-bar .ad-inner { width: 100%; max-width: 970px; min-height: 90px; background: rgba(255,255,255,.05); border: 1.5px dashed rgba(255,255,255,.25); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 12px; color: #B0B6CC; font-size: 12px; }
  .top-ad-bar .ad-label { background: var(--mbc-gold); color: var(--mbc-navy-dark); padding: 2px 8px; border-radius: 3px; font-size: 10px; margin-bottom: 6px; letter-spacing: 1px; font-weight: 700; }

  /* ── 레이아웃 ── */
  .layout { display: flex; min-height: calc(100vh - 68px - 110px); }

  /* ── 사이드바 (네이비 배경) ── */
  .sidebar { width: 235px; min-width: 235px; background: var(--mbc-navy); color: var(--sidebar-text); display: flex; flex-direction: column; transition: width .25s; overflow: hidden; flex-shrink: 0; box-shadow: 2px 0 8px rgba(0,0,0,.08); }
  .sidebar.collapsed { width: 56px; min-width: 56px; }
  .sidebar-toggle { display: flex; align-items: center; justify-content: flex-end; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.08); cursor: pointer; }
  .sidebar-toggle:hover { background: rgba(255,255,255,.06); }
  .toggle-icon { font-size: 16px; color: var(--sidebar-text); }
  .menu-section { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
  .menu-label { font-size: 10px; font-weight: 700; color: #7A6FA0; padding: 10px 18px 6px; letter-spacing: 1.2px; white-space: nowrap; overflow: hidden; }
  .sidebar.collapsed .menu-label { opacity: 0; }
  .menu-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; cursor: pointer; text-decoration: none; color: var(--sidebar-text); font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; border-left: 3px solid transparent; transition: background .15s, color .15s; }
  .menu-item:hover { background: rgba(255,255,255,.08); color: var(--sidebar-text-active); }
  .menu-item.active { background: rgba(255,255,255,.12); color: var(--sidebar-text-active); border-left-color: var(--mbc-gold); font-weight: 700; }
  .menu-item .m-icon { font-size: 17px; min-width: 22px; text-align: center; }
  .menu-item .m-text { overflow: hidden; }
  .sidebar.collapsed .m-text { display: none; }

  .sidebar-footer { margin-top: auto; padding: 16px; font-size: 10px; color: #7A6FA0; text-align: center; border-top: 1px solid rgba(255,255,255,.08); }
  .sidebar.collapsed .sidebar-footer { display: none; }

  /* ── 메인 영역 ── */
  .main-wrap { flex: 1; display: flex; }
  .main-content { flex: 1; overflow-y: auto; background: var(--bg-soft); }
  .container { max-width: 1500px; margin: 0 auto; padding: 28px 24px; }
  .page-title { font-size: 22px; font-weight: 700; color: var(--mbc-navy); margin-bottom: 6px; display: flex; align-items: center; gap: 10px; letter-spacing: -0.3px; }
  .page-subtitle { font-size: 13px; color: var(--text-sub); margin-bottom: 24px; }

  /* ── 페이지 콘텐츠 영역 ── */
  .page-section { display: none; }
  .page-section.active { display: block; }

  /* ── 안내 박스 ── */
  .help-tip { background: #FFF8E1; border-left: 4px solid #FFA000; padding: 12px 16px; border-radius: 6px; font-size: 12px; color: #6D4C00; margin-bottom: 16px; line-height: 1.5; }

  /* ── 통계 카드 그리드 ── */
  .summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 22px; }
  .s-card { background: var(--card); border-radius: 10px; padding: 18px 16px; text-align: center; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,.04); border-top: 4px solid #ccc; }
  .s-card.navy { border-top-color: var(--mbc-navy); }
  .s-card.blue { border-top-color: var(--mbc-blue); }
  .s-card.green { border-top-color: var(--green); }
  .s-card.gold { border-top-color: var(--mbc-gold); }
  .s-card.gray { border-top-color: var(--gray); }
  .s-card .num { font-size: 26px; font-weight: 800; margin: 6px 0; }
  .s-card.navy .num { color: var(--mbc-navy); }
  .s-card.blue .num { color: var(--mbc-blue); }
  .s-card.green .num { color: var(--green); }
  .s-card.gold .num { color: var(--mbc-gold); }
  .s-card.gray .num { color: var(--gray); }
  .s-card .lbl { font-size: 12px; color: var(--text-sub); font-weight: 600; }
  .s-card .updated { font-size: 10px; color: #9AA1B0; margin-top: 4px; }

  /* ── 검색 카드 ── */
  .search-card { background: var(--card); border-radius: 10px; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,.04); padding: 20px; margin-bottom: 20px; }
  .search-card h3 { font-size: 14px; color: var(--mbc-navy); margin-bottom: 12px; font-weight: 700; }
  .search-box { display: flex; gap: 10px; }
  .search-box input { flex: 1; padding: 12px 14px; background: var(--bg-soft); border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; font-family: 'Consolas', 'Monaco', monospace; transition: border-color .2s, background .2s; outline: none; }
  .search-box input:focus { border-color: var(--mbc-accent); background: #fff; }
  .search-box button { padding: 12px 28px; background: var(--mbc-navy); color: #fff; border: none; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 14px; transition: background .15s; }
  .search-box button:hover { background: var(--mbc-accent); }

  /* ── 컨트롤 바 ── */
  .controls-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
  .control-info { font-size: 13px; color: var(--text-sub); }
  .control-info strong { color: var(--mbc-navy); }
  .btn-csv { background: #fff; color: var(--mbc-navy); border: 1.5px solid var(--mbc-navy); padding: 9px 18px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
  .btn-csv:hover { background: var(--mbc-navy); color: #fff; }

  /* ── 홀더 테이블 ── */
  .table-card { background: var(--card); border-radius: 10px; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,.04); overflow: hidden; }
  table { width: 100%; border-collapse: collapse; font-size: 13px; }
  thead th { background: var(--mbc-navy); color: #fff; padding: 12px 10px; text-align: left; font-weight: 600; font-size: 12px; letter-spacing: 0.3px; }
  thead th.center { text-align: center; }
  thead th.right { text-align: right; }
  tbody td { padding: 11px 10px; border-bottom: 1px solid #F0F0F5; vertical-align: middle; word-break: break-all; }
  tbody td.right { text-align: right; font-family: 'Consolas', monospace; }
  tbody td.center { text-align: center; }
  tbody tr:hover { background: var(--bg-soft); }
  tbody tr:last-child td { border-bottom: none; }
  .rank { font-weight: 700; color: var(--text-sub); font-size: 12px; min-width: 40px; }
  .rank.top { color: var(--mbc-gold); }
  .address { color: var(--mbc-navy); cursor: pointer; text-decoration: none; font-family: 'Consolas', 'Monaco', monospace; font-size: 13px; font-weight: 500; word-break: break-all; }
  .address:hover { text-decoration: underline; color: var(--mbc-accent); }
  .balance { font-weight: 700; color: var(--text); }
  .percent { color: var(--mbc-navy); font-weight: 600; }
  .token-badge { display: inline-block; background: var(--green); color: #fff; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; cursor: pointer; margin: 2px; transition: background .15s; }
  .token-badge:hover { background: #1B5E20; }

  /* ── 페이지네이션 ── */
  .pagination { display: flex; gap: 4px; margin: 20px 0; justify-content: center; flex-wrap: wrap; }
  .pagination button { padding: 8px 14px; min-width: 40px; font-size: 13px; background: var(--card); color: var(--mbc-navy); border: 1.5px solid var(--border); border-radius: 6px; cursor: pointer; font-weight: 600; transition: all .15s; }
  .pagination button:hover:not(:disabled) { border-color: var(--mbc-accent); color: var(--mbc-accent); }
  .pagination button.active { background: var(--mbc-navy); color: #fff; border-color: var(--mbc-navy); }
  .pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
  .pagination .pg-ellipsis { padding: 8px 4px; color: #999; }

  /* ── 정적 페이지 카드 ── */
  .static-card { background: var(--card); border-radius: 10px; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,.04); padding: 28px 32px; margin-bottom: 22px; }
  .static-card h2 { font-size: 18px; color: var(--mbc-navy); margin-bottom: 14px; font-weight: 700; }
  .static-card h3 { font-size: 14px; color: var(--mbc-navy); margin-top: 18px; margin-bottom: 8px; font-weight: 700; }
  .static-card p { font-size: 14px; color: var(--text); line-height: 1.7; margin-bottom: 10px; }
  .static-card ul, .static-card ol { margin-left: 22px; margin-bottom: 12px; }
  .static-card li { font-size: 14px; color: var(--text); line-height: 1.8; margin-bottom: 4px; }
  .static-card a { color: var(--mbc-accent); text-decoration: none; }
  .static-card a:hover { text-decoration: underline; }
  .static-card .info-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
  .static-card .info-row:last-child { border-bottom: none; }
  .static-card .info-row .label { min-width: 120px; color: var(--text-sub); font-weight: 600; }
  .static-card .info-row .value { color: var(--text); }
  .static-card code { background: var(--bg-soft); padding: 2px 6px; border-radius: 3px; font-family: 'Consolas', monospace; font-size: 12px; color: var(--mbc-navy); }
  .static-card .step-card { background: var(--bg-soft); border-left: 4px solid var(--mbc-navy); padding: 14px 18px; border-radius: 6px; margin: 14px 0; }
  .static-card .step-card strong { color: var(--mbc-navy); font-size: 14px; }
  .static-card .warn-box { background: #FFF8E1; border-left: 4px solid #FFA000; padding: 12px 16px; border-radius: 6px; font-size: 13px; color: #6D4C00; margin: 14px 0; line-height: 1.6; }

  /* ── 거래소 카드 그리드 (배너 스타일) ── */
  .exchange-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 20px; margin-top: 20px; }
  .exchange-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 0; transition: transform .2s, box-shadow .2s, border-color .2s; display: flex; flex-direction: column; position: relative; overflow: hidden; }
  .exchange-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(22,0,92,.15); border-color: var(--mbc-navy); }
  .exchange-card .ex-banner { width: 100%; aspect-ratio: 16/7; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; overflow: hidden; border-bottom: 1px solid var(--border); }
  .exchange-card .ex-banner img { max-width: 80%; max-height: 80%; object-fit: contain; }
  .exchange-card .ex-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
  .exchange-card .ex-badge { position: absolute; top: 12px; right: 12px; background: var(--mbc-gold); color: var(--mbc-navy-dark); padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.5px; z-index: 1; }
  .exchange-card .ex-badge.tier1 { background: var(--mbc-navy); color: #fff; }
  .exchange-card .ex-name { font-size: 18px; font-weight: 700; color: var(--text); }
  .exchange-card .ex-pairs { display: flex; flex-wrap: wrap; gap: 6px; }
  .exchange-card .ex-pair { background: var(--bg-soft); color: var(--mbc-navy); padding: 4px 10px; border-radius: 4px; font-size: 12px; font-family: 'Consolas', monospace; font-weight: 600; }
  .exchange-card .ex-info { font-size: 13px; color: var(--text-sub); line-height: 1.6; }
  .exchange-card .ex-btn { margin-top: auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--mbc-navy); color: #fff; padding: 11px 18px; border-radius: 8px; font-size: 14px; font-weight: 700; text-decoration: none; transition: background .15s; }
  .exchange-card .ex-btn:hover { background: var(--mbc-accent); }
  .exchange-card.coming-soon { opacity: 0.65; }
  .exchange-card.coming-soon .ex-btn { background: #999; cursor: not-allowed; pointer-events: none; }
  .exchange-card.coming-soon .ex-banner { background: linear-gradient(135deg, #F0F4FF, #FAFAFF); }
  .exchange-card.coming-soon .ex-banner-text { font-size: 32px; color: #BBC; font-weight: 800; letter-spacing: 2px; }

  /* ── 푸터 ── */
  footer { background: #fff; border-top: 1px solid var(--border); padding: 24px; text-align: center; font-size: 12px; color: var(--text-sub); }
  footer .links { margin-bottom: 10px; }
  footer .links a { color: var(--text-sub); text-decoration: none; margin: 0 10px; cursor: pointer; }
  footer .links a:hover { color: var(--mbc-navy); text-decoration: underline; }
  footer .disclaimer { color: #9AA1B0; font-size: 11px; margin-top: 12px; line-height: 1.6; }

  #donateBar .donate-inner { box-sizing: border-box; }
  #donateTabs { flex: 0 0 auto; }
  #donateAddr { min-width: 260px; }
  #donateNetwork, #donateOk { flex: 0 0 auto; }

  /* ── ⓘ 툴팁 ── */
  [data-tip] { position: relative; }
  [data-tip]:hover::after, [data-tip]:focus::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--mbc-navy-dark);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-line;
    min-width: 220px;
    max-width: 320px;
    text-align: left;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    pointer-events: none;
  }
  [data-tip]:hover::before, [data-tip]:focus::before {
    content: '';
    position: absolute;
    bottom: 124%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--mbc-navy-dark);
    z-index: 1000;
    pointer-events: none;
  }

  /* ── 모바일 ── */
  @media (max-width: 768px) {
    header { padding: 0 12px; height: 60px; }
    header h1 { font-size: 15px; }
    header .sub { display: none; }
    .brand-logo { width: 36px; height: 36px; }
    header .nav a { padding: 4px 8px; font-size: 12px; }
    .lang-toggle button { padding: 4px 8px; font-size: 11px; }

    .top-ad-bar { padding: 6px 8px; top: 60px; }
    .top-ad-bar .ad-inner { min-height: 50px; padding: 8px; }

    .sidebar { position: fixed; left: -260px; width: 240px; height: 100vh; z-index: 95; transition: left .25s; top: 0; box-shadow: 2px 0 12px rgba(0,0,0,.3); }
    .sidebar.mobile-open { left: 0; }
    .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 90; }
    .sidebar-overlay.active { display: block; }
    .mobile-menu-btn { display: block; background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; padding: 6px 10px; margin-right: 4px; }
    .mobile-menu-btn:active { background: rgba(255,255,255,.12); border-radius: 6px; }
    /* 모바일 사이드바 닫기 X 버튼 */
    .sidebar-close { display: flex; position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; align-items: center; justify-content: center; background: rgba(255,255,255,.1); border: none; border-radius: 50%; color: #fff; font-size: 20px; cursor: pointer; z-index: 1; }
    .sidebar-close:active { background: rgba(255,255,255,.25); }

    /* 모바일에서 헤더 nav(공식사이트/GitHub) 숨김 → 사이드바에서 접근 */
    header .nav { display: none; }
    /* KOR/ENG는 컴팩트하게 유지 */
    .lang-toggle button { padding: 4px 8px; font-size: 11px; }
    header h1 { font-size: 14px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }

    /* ── 모바일: 통계 카드 한 줄 압축 (가로 스크롤 가능) ── */
    .summary-grid {
      display: grid !important;
      grid-template-columns: repeat(5, minmax(120px, 1fr)) !important;
      gap: 6px !important;
      padding: 8px 0 !important;
      margin: -8px 0 10px !important;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: thin;
    }
    .summary-grid .s-card {
      padding: 8px 6px !important;
      border-top-width: 3px !important;
      min-width: 120px;
    }
    .summary-grid .s-card .lbl { font-size: 10px !important; line-height: 1.2 !important; margin-bottom: 2px !important; }
    .summary-grid .s-card .num { font-size: 14px !important; margin: 2px 0 !important; line-height: 1.2 !important; }
    .summary-grid .s-card .updated { font-size: 9px !important; line-height: 1.2 !important; margin-top: 2px !important; }

    .container { padding: 16px 12px; }
    .page-title { font-size: 17px; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .s-card { padding: 14px 10px; }
    .s-card .num { font-size: 20px; }

    .search-box { flex-direction: column; }
    .search-box input { font-size: 13px; }

    /* ── 모바일 테이블 가로 스크롤 (etherscan 스타일) ── */
    .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-card table { min-width: 720px; }
    table { font-size: 12px; }
    thead th, tbody td { padding: 9px 10px; white-space: nowrap; }
    tbody td.right { white-space: nowrap; }
    .address { font-size: 12px; white-space: nowrap; word-break: keep-all; }
    .token-badge { font-size: 10px; padding: 2px 6px; }

    /* 스크롤 가능 힌트 (그라데이션 페이드) */
    .table-card { position: relative; }
    .table-card::after {
      content: '';
      position: absolute;
      top: 0; right: 0; bottom: 0;
      width: 24px;
      background: linear-gradient(to right, transparent, rgba(0,0,0,.06));
      pointer-events: none;
    }

    .static-card { padding: 18px 20px; }
  }
  @media (min-width: 769px) {
    .mobile-menu-btn { display: none; }
    .sidebar-close { display: none !important; }
  }

  /* ════════════════════════════════════════════════════
     ▌ 모바일 퍼스트 리팩터링 (Samsung/Chrome/Safari 호환)
     - 페이지 전체 핀치 줌·가로 스크롤 막음
     - Header/Sidebar 고정 사이즈, 항상 같은 위치
     - 테이블만 overflow-x:auto (좌우 드래그)
     - 360~768 모바일, 769~1199 태블릿, 1200+ 데스크톱
     ════════════════════════════════════════════════════ */

  /* ── 1. 전역: 핀치 줌·가로 오버플로 차단 ── */
  html {
    overflow-x: hidden;
    width: 100%;
    -webkit-text-size-adjust: 100%;          /* iOS Safari 자동 확대 차단 */
    -ms-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0,0,0,0); /* iOS 탭 회색 박스 제거 */
    touch-action: pan-y;                     /* 페이지는 세로만 터치 스크롤 */
  }
  body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
    min-height: 100vh;
  }

  /* ── 2. Header: 고정 (sticky → fixed, 더 안정적) ── */
  header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 68px;
    z-index: 100;
  }

  /* ── 3. Top 광고: 헤더 바로 아래 고정 ── */
  .top-ad-bar {
    position: fixed !important;
    top: 68px;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 99;
  }

  /* ── 4. Layout: 블록 흐름, 헤더+광고 높이만큼 위 여백 확보 ── */
  .layout {
    display: block !important;
    min-height: auto;
    padding-top: 178px;       /* 68(header) + 110(ad bar) */
    position: relative;
  }

  /* ── 5. Sidebar: 데스크톱 항상 좌측 고정, 내부만 스크롤 ── */
  .sidebar {
    position: fixed !important;
    top: 178px;
    left: 0;
    width: 235px;
    height: calc(100vh - 178px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    z-index: 80;
    flex: none;
    transition: width .25s, left .25s;
  }
  .sidebar.collapsed { width: 56px; }

  /* ── 6. Main wrap: 사이드바 옆에 위치, 가로 오버플로 차단 ── */
  .main-wrap {
    display: flex;
    margin-left: 235px;
    width: calc(100% - 235px);
    max-width: calc(100vw - 235px);
    min-height: calc(100vh - 178px);
    transition: margin-left .25s, width .25s;
  }
  .sidebar.collapsed ~ .main-wrap,
  body.sidebar-collapsed .main-wrap {
    margin-left: 56px;
    width: calc(100% - 56px);
    max-width: calc(100vw - 56px);
  }
  .main-content {
    flex: 1;
    width: 100%;
    max-width: 100%;
    overflow-y: visible;
    overflow-x: hidden;
    background: var(--bg-soft);
  }
  .container {
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
  }

  /* ── 7. 테이블만 좌우 드래그 (etherscan 스타일) ── */
  .table-card {
    max-width: 100%;
    width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
  }
  .table-card table {
    min-width: 100%;
  }

  /* ── 8. 광고/이미지/코드 절대 가로 오버플로 안 함 ── */
  img, video, iframe, pre, code, .static-card {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* ────────────────────────────────────────────────
     ▌ 태블릿 (769px ~ 1199px)
     ──────────────────────────────────────────────── */
  @media (max-width: 1199px) and (min-width: 769px) {
    .sidebar { width: 200px; }
    .main-wrap {
      margin-left: 200px;
      width: calc(100% - 200px);
      max-width: calc(100vw - 200px);
    }
    .container { padding: 22px 18px; }
  }

  /* ────────────────────────────────────────────────
     ▌ 모바일 (≤768px) — Sidebar 슬라이드, Main 풀폭
     ──────────────────────────────────────────────── */
  @media (max-width: 768px) {
    header { height: 60px !important; padding: 0 12px; }
    .top-ad-bar { top: 60px !important; }
    #donateBar { padding: 8px 10px !important; }
    #donateBar .donate-inner {
      display: grid !important;
      grid-template-columns: auto 1fr auto;
      align-items: center !important;
      gap: 8px !important;
      font-size: 12px !important;
    }
    #donateBar .donate-title {
      white-space: nowrap;
    }
    #donateTabs {
      grid-column: 2 / 4;
      width: 100%;
      display: grid !important;
      grid-template-columns: repeat(3, 1fr);
    }
    #donateTabs .donate-tab {
      width: 100%;
      padding: 7px 8px !important;
      text-align: center;
    }
    #donateAddr {
      grid-column: 1 / 3;
      width: 100%;
      min-width: 0 !important;
      box-sizing: border-box;
      display: block;
      white-space: normal;
      overflow-wrap: anywhere;
      line-height: 1.35;
      padding: 8px 10px !important;
    }
    #donateNetwork {
      grid-column: 1 / 2;
      color: #9AA1B0;
      font-size: 10px !important;
      white-space: nowrap;
    }
    #donateBar .donate-copy-btn {
      grid-column: 3 / 4;
      grid-row: 3 / 4;
      align-self: stretch;
      min-width: 42px;
      padding: 8px 10px !important;
    }
    #donateOk {
      grid-column: 2 / 4;
      min-height: 14px;
      font-size: 10px !important;
    }
    .layout { padding-top: 140px !important; }  /* 60 + 80(ad bar) */

    .sidebar {
      top: 0 !important;
      left: -260px !important;
      width: 240px !important;
      height: 100vh !important;
      z-index: 110 !important;          /* 옵션 A: header(100)/ad(99)/donate(97) 모두 위로 */
      transition: left .25s ease;
      overflow-y: auto !important;       /* 모바일 사이드바 내부 스크롤 허용 — 관리자 버튼 노출 */
      overflow-x: hidden;
      -webkit-overflow-scrolling: touch;
      padding-bottom: calc(80px + env(safe-area-inset-bottom));  /* 하단 후원바·광고 여백 확보 */
      scrollbar-width: thin;
    }
    .sidebar-footer {
      display: block !important;
      background: var(--mbc-navy);
      margin-top: 12px;
      padding-bottom: 20px;
    }
    .sidebar.mobile-open { left: 0 !important; }
    .sidebar-overlay { z-index: 105 !important; } /* 사이드바 바로 아래, 그 외 모든 것 위에 */

    .main-wrap {
      display: block !important;
      margin-left: 0 !important;
      width: 100% !important;
      max-width: 100vw !important;
      min-height: calc(100vh - 140px);
    }
    .container { padding: 14px 10px; }

    /* 모바일 안전 영역 (iPhone X+ 노치) */
    header { padding-top: env(safe-area-inset-top); height: calc(60px + env(safe-area-inset-top)); }
    .top-ad-bar { top: calc(60px + env(safe-area-inset-top)) !important; }
    .layout { padding-top: calc(140px + env(safe-area-inset-top)) !important; }
  }

  /* ────────────────────────────────────────────────
     ▌ 작은 모바일 (≤480px) — 더 컴팩트
     ──────────────────────────────────────────────── */
  @media (max-width: 480px) {
    .container { padding: 12px 8px; }
    .summary-grid { gap: 6px !important; }
    .page-title { font-size: 16px; }
  }
