/* 회원 화면 스타일 (모바일). 색은 전부 :root 변수에서 온다. 변수 값은 inc/layout.php 의 테마(env SITE_THEME)가 넣는다.
 *   --p 주색  --p2 주색 진한 쪽(그라데이션 끝)  --p-soft 주색 옅은 배경  --accent 강조(포인트 타일·배지)
 *   --bg 페이지 배경  --card 카드  --line 경계선  --text 글자  --muted 보조 글자
 */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: 'Pretendard', 'Noto Sans KR', -apple-system, 'Malgun Gothic', sans-serif;
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
p, h1, h2, h3 { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

.si_wrap { max-width: 768px; margin: 0 auto; min-height: 100vh; background: var(--bg); }
.si_body { padding: 16px 16px 28px; }
body.si_has_nav .si_body { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }

/* ---- 헤더 */
.si_header { position: sticky; top: 0; z-index: 800; height: 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px 0 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.si_header .si_title { position: absolute; left: 50%; transform: translateX(-50%); font-size: 17px; font-weight: 700; white-space: nowrap; }
.si_logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; }
.si_logo_mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--p), var(--p2)); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; }
.si_logo img { height: 30px; }
.si_head_btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 6px; background: var(--p-soft); color: var(--p);
  font-size: 12px; font-weight: 700; border: 0; cursor: pointer; }
.si_back { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-left: -10px; color: var(--text);
  background: none; border: 0; padding: 0; cursor: pointer; }

/* ---- 카드 */
.si_card { background: var(--card); border-radius: 16px; padding: 18px; margin-bottom: 14px; box-shadow: 0 2px 10px rgba(16, 24, 40, .06);
  border: 1px solid var(--line); }
.si_card_title { font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.si_card_title a { font-size: 13px; font-weight: 600; color: var(--p); }
.si_row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; }
.si_row > span:first-child { color: var(--muted); }
.si_row b { font-weight: 700; text-align: right; word-break: break-all; }

/* ---- 잔액(히어로) 카드 */
.si_hero { position: relative; display: block; border-radius: 18px; padding: 22px 20px; margin-bottom: 14px; color: #fff;
  background: linear-gradient(120deg, var(--p2) 0%, var(--p) 100%); box-shadow: 0 8px 22px color-mix(in srgb, var(--p) 35%, transparent); }
.si_hero_name { font-size: 16px; font-weight: 700; }
.si_hero_sub { font-size: 13px; opacity: .85; margin-top: 2px; }
.si_hero_amount { font-size: 30px; font-weight: 800; margin-top: 18px; letter-spacing: -.5px; }
.si_hero_amount small { font-size: 18px; font-weight: 700; margin-left: 4px; }
.si_hero_meta { display: flex; gap: 14px; margin-top: 10px; font-size: 13px; opacity: .9; flex-wrap: wrap; }
.si_hero_arrow { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); opacity: .9; }
.si_hero_rank { position: absolute; right: 18px; top: 18px; background: rgba(255,255,255,.18); padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }

/* ---- 공지 띠 */
.si_notice_bar { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  padding: 9px 14px; margin-bottom: 14px; box-shadow: 0 2px 10px rgba(16, 24, 40, .05); }
.si_notice_bar .si_pill { flex: none; }
.si_notice_bar span.t { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; }
.si_pill { display: inline-block; padding: 2px 10px; border-radius: 12px; background: var(--p); color: #fff; font-size: 12px; font-weight: 800; }
.si_pill.accent { background: var(--accent); }
.si_pill.soft { background: var(--p-soft); color: var(--p); }
.si_pill.gray { background: var(--line); color: var(--muted); }

/* ---- 메뉴 타일 */
.si_grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.si_tile { position: relative; display: flex; flex-direction: column; min-height: 118px; padding: 16px 14px; border-radius: 14px; background: var(--card);
  border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(16, 24, 40, .05); font-weight: 700; font-size: 15px; transition: transform .1s; }
.si_tile:active { transform: scale(.98); }
.si_tile small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.si_tile .si_tile_icon { position: absolute; right: 12px; bottom: 12px; width: 38px; height: 38px; border-radius: 10px; background: var(--p-soft);
  color: var(--p); display: flex; align-items: center; justify-content: center; }
.si_tile.accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent); }
.si_tile.accent .si_tile_icon { background: color-mix(in srgb, var(--accent) 18%, #fff); color: var(--accent); }
.si_tile.primary { background: linear-gradient(135deg, var(--p), var(--p2)); color: #fff; border: 0; }
.si_tile.primary small { color: rgba(255,255,255,.8); }
.si_tile.primary .si_tile_icon { background: rgba(255,255,255,.18); color: #fff; }

/* ---- 목록 */
.si_list > li { padding: 13px 0; border-bottom: 1px solid var(--line); }
.si_list > li:last-child { border-bottom: 0; }
.si_list .si_row { padding: 2px 0; }
.si_list .si_sub { font-size: 12.5px; color: var(--muted); }
.si_empty { text-align: center; color: var(--muted); padding: 30px 0; }
.si_plus { color: #16a34a; } .si_minus { color: #dc2626; }

/* ---- 칩 탭 */
.si_tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; }
.si_tabs a { flex: none; padding: 7px 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); font-size: 14px; color: var(--muted); font-weight: 600; }
.si_tabs a.on { background: var(--p); border-color: var(--p); color: #fff; }

/* ---- 폼 */
.si_field { margin-bottom: 14px; }
.si_label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.si_input { width: 100%; height: 48px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  box-shadow: 0 1px 4px rgba(16, 24, 40, .05); font-size: 15px; outline: none; }
textarea.si_input { height: auto; min-height: 160px; padding: 12px 14px; }
select.si_input { appearance: auto; }
.si_input:focus { border-color: var(--p); box-shadow: 0 0 0 3px var(--p-soft); }
.si_input[readonly], .si_input:disabled { background: var(--line); color: var(--muted); box-shadow: none; }
.si_inline { display: flex; gap: 8px; } .si_inline .si_input { flex: 1; } .si_inline .si_btn { width: auto; padding: 0 16px; height: 48px; }
.si_desc { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.si_btn { display: block; width: 100%; height: 50px; border-radius: 10px; border: 0; background: var(--p); color: #fff; font-size: 16px; font-weight: 700;
  cursor: pointer; text-align: center; line-height: 50px; padding: 0; }
.si_btn:disabled { opacity: .55; }
.si_btn.sub { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.si_btn.soft { background: var(--p-soft); color: var(--p); }
.si_check { display: flex; gap: 8px; align-items: center; font-size: 14px; padding: 4px 0; }
.si_check a { color: var(--p); text-decoration: underline; }
.si_badge_box { background: var(--p-soft); color: var(--p); border-radius: 10px; padding: 12px; text-align: center; font-weight: 700; margin-bottom: 16px; }

/* ---- 로그인 */
.si_login { padding-top: 8vh; }
.si_login .si_logo { justify-content: center; font-size: 26px; margin-bottom: 28px; }
.si_login .si_logo_mark { width: 46px; height: 46px; border-radius: 12px; font-size: 22px; }
.si_link_row { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.si_link_row a { color: var(--p); font-weight: 700; }

/* ---- 트리 */
.si_tree ul { padding-left: 16px; margin-left: 6px; border-left: 2px solid var(--p-soft); }
.si_tree li { margin: 8px 0; }
.si_tree .si_node { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: 8px; background: var(--bg); font-size: 14px; }
.si_tree .si_node.me { background: var(--p); color: #fff; font-weight: 700; }

/* ---- 게시글 본문 */
.si_content { font-size: 15px; line-height: 1.75; word-break: break-word; }
.si_content img { max-width: 100%; height: auto; }
details.si_faq { padding: 4px 0; }
details.si_faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; gap: 8px; }
details.si_faq summary::before { content: 'Q'; color: var(--p); font-weight: 800; }
details.si_faq[open] summary { color: var(--p); }

/* ---- 회사 정보 */
.si_company { text-align: center; font-size: 12px; color: var(--muted); line-height: 1.8; padding: 18px 0 6px; }
.si_company a { text-decoration: underline; }

/* ---- 페이지 번호 (pager()) */
.pagination { display: flex; justify-content: center; gap: 6px; padding: 14px 0; }
.pagination li a { display: inline-flex; min-width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 8px;
  background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.pagination li.pagination_item.active a { background: var(--p); color: #fff; border-color: var(--p); }
.pagination_prev a::before { content: '‹'; } .pagination_next a::before { content: '›'; }
.pagination_double_prev a::before { content: '«'; } .pagination_double_next a::before { content: '»'; }

/* ---- 하단 바 */
.si_nav { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 768px; z-index: 900; display: flex;
  background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(16, 24, 40, .06); padding-bottom: env(safe-area-inset-bottom); }
.si_nav a { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 72px;
  color: var(--muted); font-size: 13px; font-weight: 600; }
.si_nav a.on { color: var(--p); font-weight: 800; }
.si_nav a.on svg { stroke-width: 2.2; }

/* ---- SweetAlert 버튼을 테마색으로 */
.swal2-styled.swal2-confirm { background-color: var(--p) !important; }
