/* ========================================= */
/* Base Styles - Reset, Typography, Colors  */
/* ========================================= */

/* Reset & base */
/* 글 덩어리 기본 여백 0 — 간격은 부모 gap·여백 클래스로만 준다. 브라우저 기본값(제목 0.67em·문단 1em)이 상단 바 제목·빈 화면·상세 소개에 몰래 남아 있었다 (10-25). 세기 0 이라 어떤 규칙이든 이긴다 */
:where(h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd) { margin: 0; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-default);
  color: var(--fg-primary);
  font-family: var(--font-sans);
  overflow-x: hidden;
}
* { box-sizing: border-box; }
:where(b, strong) { font-weight: 600; }   /* 글 속 강조 = 600 (굵기 체계 10-20) — 브라우저 기본 bolder 가 부모 굵기에 따라 700·900 으로 튀던 것 막기. 클래스로 굵기를 준 곳은 그대로 */
/* 폼 요소는 글꼴을 상속하지 않는다 — 클래스가 따로 안 잡은 버튼·입력이 Arial 로 렌더됐다 (26-09-12: Continue·Find matching·페이지 번호) */
button, input, select, textarea { font-family: inherit; }

/* Typography (px + fixed line-height) — 규격은 tokens.css --t-* 와 동일. 신규 코드는 font: var(--t-*) 권장 */
.t11 { font-size: 11px; line-height: 14px; }
.t12 { font-size: 12px; line-height: 16px; }  /* 14→16, 4pt 스냅 (26-08-29) */
.t14 { font-size: 14px; line-height: 20px; }
.t16 { font-size: 16px; line-height: 24px; }
.t18 { font-size: 18px; line-height: 24px; }
.t20 { font-size: 20px; line-height: 28px; }
.t24 { font-size: 24px; line-height: 32px; }
.t32 { font-size: 32px; line-height: 40px; }

/* Font weights */
.w400 { font-weight: 400; }
.w500 { font-weight: 500; }
.w600 { font-weight: 600; }   /* 굵기 4종 400/500/600/700 — 600 = 목록 이름·금액 (10-20 재도입, 26-08-26 폐기 취소) */
.w700 { font-weight: 700; }
.w100 { width: 100%; }

/* Colors (text utilities) */
.primary { color: var(--fg-brand); }
.text-primary { color: var(--fg-brand); }
.text-strong { color: var(--fg-primary); }
.text { color: var(--fg-primary); }
.text-muted { color: var(--fg-secondary); }
.text-muted-gray { color: var(--fg-secondary); }
.text-muted-original { color: var(--fg-secondary); }
.text-subtle { color: var(--fg-tertiary); }
.text-description { color: var(--fg-primary); }
.text-inverse { color: var(--fg-inverse); }
.text-success { color: var(--fg-success); }
.text-warning { color: var(--fg-warning); }
.text-danger { color: var(--fg-brand); }   /* 팔레트 밖 #EF4444 → Primary Red 공용 (26-08-28) */

/* Background colors */
.bg-white { background: var(--bg-default); }
.bg-muted { background: var(--bg-muted); }
.bg-primary { background: var(--bg-brand); color: var(--fg-inverse); }

/* Border utilities */
.border { border: 1px solid var(--border-subtle); }
.border-strong { border: 1px solid var(--border-control); }

/* Placeholder text */
::placeholder { color: var(--fg-tertiary); }
.placeholder { color: var(--fg-tertiary); }

/* Spacing utilities — 스케일 4/8/12/16/20/24/32 (tokens.css 간격 참조). 20 은 기존 사용분 유지 */
.mt4 { margin-top: 4px; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mt20 { margin-top: 20px; }
.mt24 { margin-top: 24px; }
.mt32 { margin-top: 32px; }

.mb4 { margin-bottom: 4px; }
.mb8 { margin-bottom: 8px; }
.mb12 { margin-bottom: 12px; }
.mb16 { margin-bottom: 16px; }
.mb20 { margin-bottom: 20px; }
.mb24 { margin-bottom: 24px; }
.mb32 { margin-bottom: 32px; }

.p8 { padding: 8px; }
.p12 { padding: 12px; }
.p16 { padding: 16px; }
.p20 { padding: 20px; }
.p24 { padding: 24px; }
.p32 { padding: 32px; }

.px16 { padding-left: 16px; padding-right: 16px; }
.py12 { padding-top: 12px; padding-bottom: 12px; }

/* Section spacing */
.section-padding { padding: 16px; }

/* Section divider — 큰 덩어리 사이 8px 회색 띠(화면 끝까지). 슈퍼패스 sp-section 띠(26-08-31 사용자)와 같은 값을 앱 공통으로 (26-10-18).
   덩어리 안 구분은 지금처럼 1px 선(border-subtle) */
.section-divider {
  border: none;
  height: 8px;
  background-color: var(--bg-sunken);
  margin: 0;
}

/* Logo */
.logo { height: 36px; width: auto; display: block; }  /* 락업(워드마크+POWERED BY ZIVO, 857×208). 40→36 + 심볼만 92% (26-08-31 사용자) */

/* 드래그 스크롤 시 글자·이미지가 파랗게 선택되는 것 방지 — 앱 프로토타입은 텍스트 선택 불필요 (26-08-31 사용자) */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overflow-wrap: break-word; }   /* 다국어 (10-20): 칸을 넘칠 때만 끊는다 — 띄어쓰기 없는 일본어·번체가 keep-all 칸(알림 등)에서 화면 밖으로 나가던 것, 긴 링크도 같이 */
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }
img, svg { -webkit-user-drag: none; }

/* 넓은 화면(PC 브라우저) = 모바일 폭 430 한 줄로 가운데 (10-23 사용자 "매번 개발자 모드로 봐야 해서 귀찮다").
   폰(430 이하)에는 아무것도 바뀌지 않는다. 고정 바·팝업·시트도 같은 폭 안으로. 데스크톱 도구(카탈로그 = body.is-wide)는 제외.
   html 을 붙인 건 화면별 CSS(.bottom-action-bar 등 left:0)보다 이기려고 */
@media (min-width: 431px) {
  html:has(body:not(.is-wide)) { background: var(--bg-muted); }
  html body:not(.is-wide) { max-width: 430px; min-height: 100vh; margin: 0 auto; box-shadow: 0 0 0 1px var(--border-subtle); }   /* lint-allow: L2 앱 최대 폭 430(지원 360~430) */
  html body:not(.is-wide) :is(.appbar, .bottomnav, .fixed-tabs, .popup, .country-popup, .bottom-buttons, .pl-bar, .bottom-action-bar, .header, .wc-cta, .chat-sheet, .ps-sheet),
  html body.has-scroll-appbar:not(.is-wide) .fixed-tabs.is-stuck { left: calc(50% - 215px); right: calc(50% - 215px); }   /* lint-allow: L2 430 의 절반 */
  html body:not(.is-wide) .toast-notification { left: calc(50% - 199px); right: calc(50% - 199px); }   /* lint-allow: L2 430 − 좌우 16 */
  html body:not(.is-wide) :is(.fab-chat, .fab) { right: calc(50% - 199px); }   /* lint-allow: L2 앱 오른쪽 16 */
}
