/* ==========================================================================
   base — 초기화 · 페이지 뼈대 · 도우미
   ========================================================================== */
*,*::before,*::after{ box-sizing:border-box; }

html{ zoom:var(--ui-zoom); scroll-padding-top:calc(var(--header-h) + 20px); }
body{
  margin:0;
  min-width:var(--page-min);
  padding-top:var(--header-h);     /* 고정 헤더 높이만큼 */
  background:var(--page-tex), var(--bg);
  color:var(--text);
  font-family:var(--font);
  font-size:var(--fs-sm);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}

h1,h2,h3,h4,h5,p,figure,dl,dd{ margin:0; }
ul,ol{ margin:0; padding:0; list-style:none; }
img,svg,video{ display:block; max-width:100%; }
button{ font:inherit; color:inherit; background:none; border:0; padding:0; cursor:pointer; }
a{ color:inherit; text-decoration:none; }
input,select,textarea{ font:inherit; }
table{ border-collapse:collapse; width:100%; }

/* 키보드 초점 — 골드 테두리 */
:focus-visible{ outline:2px solid var(--accent-line); outline-offset:2px; }

/* 스크롤바 */
::-webkit-scrollbar{ width:8px; height:8px; }
::-webkit-scrollbar-track{ background:var(--bg-deep); }
::-webkit-scrollbar-thumb{ background:var(--surface-2); border-radius:var(--r-full); }
::-webkit-scrollbar-thumb:hover{ background:var(--surface-3); }

/* ---- 본문 컨테이너 : 모든 화면이 같은 폭 ------------------------------ */
.page{ min-height:calc(100 * var(--vh) - var(--header-h) - 400px); padding:var(--gap-xl) 0 var(--gap-2xl); }   /* 아래 40 + 파트너 띠 위 40 = 푸터까지 80 */
.inner{ width:var(--page-w); margin:0 auto; }

/* ---- 도우미 ---------------------------------------------------------- */
.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0;
}
.t-sub{ color:var(--text-sub); }
.t-gold{ color:var(--accent-fg); }
.t-danger{ color:var(--danger); }
.t-money{ color:var(--money); font-weight:var(--fw-bold); }
.ellipsis{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.scroll-x{ display:flex; overflow-x:auto; scrollbar-width:none; }
.scroll-x::-webkit-scrollbar{ display:none; }
[hidden]{ display:none !important; }

/* 모션을 줄여 달라는 설정이면 움직임을 끈다 */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{ transition-duration:0s !important; animation-duration:0s !important; }
}

/* ---- 휴대폰 : 아래 탭 자리만큼 밑을 비운다 · 옆 메뉴가 열리면 뒤는 멈춘다 ---------- */
@media (max-width:1023px){
  body{ padding-bottom:calc(var(--mtab-h) + env(safe-area-inset-bottom)); }
  html, body{ overflow-x:clip; }   /* 가로 줄이 화면 끝까지 붙어 나갈 때(좌우 -16px) 스크롤 막대 폭만큼 옆으로 밀리지 않게 */
  .page{ min-height:0; padding:var(--gap-md) 0 var(--gap-xl); }
  html.is-locked, html.is-locked body{ overflow:hidden; }
}
