/* 넥슨 형식의 구조(흰 바탕, 가는 테두리, 4px 모서리, 밑줄형 탭)는 그대로 두고 색만 테마로 바꾼다.
 * 테마는 <html data-theme="...">로 고른다. 강조색 위의 흰 글자는 모두 명암비 4.5:1 이상. */
:root {
  --text: #1f1a1c; --sub: #666; --line: #e6e0e2; --bg: #fff;
  --accent: #d6336c; --accent-hover: #b82659; --soft: #fff3f7; --line-strong: var(--accent);
  --on-accent: #fff; --ink: var(--accent); /* on-accent: 강조색 위 글자, ink: 흰 바탕 위 강조 글자 */
  --blue: #0a5cd8; --green: #0a7d43; --amber: #9a5b00; --red: #d0021b; --r: 4px;
}
/* 요청받은 파스텔 핑크(#f3acd0)는 밝아서 흰 글자를 올릴 수 없다. 면에는 그대로 쓰고 글자는 짙은 자주색으로 둔다. */
[data-theme=blossom] { --accent: #f3acd0; --accent-hover: #ee97c4; --on-accent: #4a1230; --ink: #b02a76; --soft: #fdf1f7; --line: #f0dce6; }
/* 글씨체 후보. 한글은 어느 후보에서든 Pretendard로 나온다(앞의 두 글꼴에는 한글이 없다). */
:root { --font: "Plus Jakarta Sans", "Pretendard Variable", Pretendard, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif; }
[data-font=pretendard] { --font: "Pretendard Variable", Pretendard, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif; }
[data-font=nunito] { --font: Nunito, "Pretendard Variable", Pretendard, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif; }
[data-font=system] { --font: -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", Roboto, sans-serif; }
[data-theme=sky]    { --accent: #0b76b8; --accent-hover: #095f95; --soft: #eff7fc; --line: #dfe5e9; }
[data-theme=mint]   { --accent: #0b7f63; --accent-hover: #09684f; --soft: #eef8f5; --line: #dfe7e4; }
[data-theme=violet] { --accent: #6d45c4; --accent-hover: #5836a3; --soft: #f4f0fc; --line: #e3e0ea; }
[data-theme=mono]   { --accent: #111;    --accent-hover: #333;    --soft: #f7f7f7; --line: #e0e0e0; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.6 var(--font); }
a { color: inherit; text-decoration: none; }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0; }
p { margin: 0; }
small { color: var(--sub); font-size: 12px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-top: 32px; padding-bottom: 64px; min-height: 70vh; }
section + section { margin-top: 44px; }
.lead { color: var(--sub); }
.hint { color: var(--sub); font-size: 12px; margin-top: 10px; }
.hint.box { border: 1px dashed var(--line); border-radius: var(--r); padding: 14px; margin: 0 0 16px; }
.empty { border: 1px solid var(--line); border-radius: var(--r); padding: 32px; text-align: center; color: var(--sub); margin-top: 16px; }
.err { color: var(--red); font-size: 13px; min-height: 0; margin: 8px 0; }
.err:empty { display: none; }
.count { margin: 20px 0 10px; color: var(--sub); }

/* 상단 */
.top { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 5; }
.bar { display: flex; align-items: center; gap: 28px; height: 56px; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 800; font-size: 17px; letter-spacing: -.02em; white-space: nowrap; }
.nav { display: flex; gap: 22px; flex: 1; overflow-x: auto; align-self: stretch; scrollbar-width: none; }
.nav a { display: flex; align-items: center; white-space: nowrap; color: var(--sub); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.nav a:hover { color: var(--text); }
.nav a.on { color: var(--text); font-weight: 700; border-bottom-color: var(--line-strong); }
.themes { display: flex; gap: 6px; align-items: center; }
.themes button { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); padding: 0; cursor: pointer; }
.themes button.on { box-shadow: 0 0 0 2px var(--text); }
.langs { display: flex; gap: 10px; }
.langs .on { color: var(--ink); font-weight: 700; }
.jump { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; z-index: 6; border: 1px solid var(--line); border-radius: var(--r); background: #fff; overflow: hidden; }
.jump[hidden] { display: none; }
.jump button { width: 40px; height: 40px; border: 0; background: #fff; font-size: 16px; color: var(--text); cursor: pointer; }
.jump button + button { border-top: 1px solid var(--line); }
.jump button:hover { background: var(--soft); color: var(--ink); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.fonts { display: flex; gap: 12px; flex-wrap: wrap; }
.fonts .on { color: var(--ink); font-weight: 700; }
.foot { border-top: 1px solid var(--line); padding-top: 20px; padding-bottom: 28px; color: var(--sub); font-size: 12px; }

/* 버튼·링크 */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 18px; background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); border-radius: var(--r); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.line { background: #fff; color: var(--ink); border-color: #c4c4c4; }
.btn.line:hover { border-color: var(--ink); background: #fff; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; height: 46px; }
.link { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--sub); cursor: pointer; white-space: nowrap; }
.link:hover { color: var(--text); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* 구조 */
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head .right { flex-shrink: 0; }
.crumbs { font-size: 12px; color: var(--sub); margin-bottom: 14px; }
.crumbs a:hover { text-decoration: underline; color: var(--text); }
.crumbs i { margin: 0 6px; font-style: normal; color: #bbb; }
.sub { margin: 32px 0 12px; font-size: 15px; }
.sub small { font-weight: 400; }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin: 20px 0 0; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 0; color: var(--sub); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--text); font-weight: 700; border-bottom-color: var(--line-strong); }
.tabs + .panel, .tabs + .how, .tabs + .tbl, .tabs + .empty { margin-top: 24px; }
.dot { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-style: normal; text-align: center; line-height: 18px; }
.panel { border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.panel .lead { margin: -6px 0 14px; font-size: 13px; }
.two { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; align-items: start; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.grid3 .span { grid-column: span 2; }
.note { border: 1px solid var(--line); background: var(--soft); border-radius: var(--r); padding: 10px 14px; font-size: 13px; margin: 14px 0; }
.note b { margin-right: 6px; }

/* 홈 머리: 상호가 주인공 */
.hero { display: flex; align-items: center; gap: 20px; padding: 28px; border: 1px solid var(--line); border-radius: var(--r); background: var(--soft); }
.hero img { flex-shrink: 0; border-radius: var(--r); mix-blend-mode: multiply; }
.hero h1 { font-size: 34px; color: var(--ink); letter-spacing: -.02em; margin: 0; }
.hero p { color: var(--text); margin-top: 4px; }
.hero > div { flex: 1; min-width: 0; }
.hero .search { margin-top: 16px; max-width: 520px; }
.logo img { mix-blend-mode: multiply; }
.svc-grid + * { margin-top: 0; }

/* 서비스 카드 */
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.svc { border: 1px solid var(--line); border-radius: var(--r); padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.svc:hover { border-color: var(--line-strong); }
.svc h3 { font-size: 17px; }
.svc p { color: var(--sub); font-size: 13px; flex: 1; }
.svc .meta { margin-top: 14px; font-size: 13px; color: var(--sub); }
.svc .meta b { color: var(--text); }
.svc .more { font-size: 13px; font-weight: 600; color: var(--ink); }

/* 목록 행 */
.rows { border-top: 1px solid var(--line-strong); }
.row { display: grid; grid-template-columns: 1fr auto 90px 120px 20px; align-items: center; gap: 16px; padding: 16px 4px; border-bottom: 1px solid var(--line); }
.row:hover { background: var(--soft); }
.row b { display: block; }
.row .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--sub); }
.row .arrow { color: #bbb; }

/* 뱃지 */
.badge { display: inline-block; padding: 2px 8px; border: 1px solid var(--line); border-radius: 2px; font-size: 12px; line-height: 18px; white-space: nowrap; color: var(--sub); background: #fff; }
.badge.open, .badge.pay-pending { color: var(--blue); border-color: var(--blue); }
.badge.run { color: var(--amber); border-color: var(--amber); }
.badge.pay-paid { color: var(--green); border-color: var(--green); }
.badge.pay-rejected { color: var(--red); border-color: var(--red); }

/* 통계 */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: var(--r); }
.stat { padding: 14px 16px; border-left: 1px solid var(--line); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat span { display: block; color: var(--sub); font-size: 12px; }
.stat b { font-size: 18px; font-variant-numeric: tabular-nums; }

/* 단계 */
.steps { list-style: none; display: flex; margin: 20px 0; padding: 0; }
.steps li { flex: 1; position: relative; text-align: center; font-size: 12px; color: var(--sub); padding-top: 34px; min-width: 0; }
.steps li::before { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.steps li:first-child::before { display: none; }
.steps em { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: #fff; font-style: normal; font-size: 12px; line-height: 22px; z-index: 1; }
.steps li.done { color: var(--text); }
.steps li.done::before, .steps li.cur::before { background: var(--accent); }
.steps li.done em { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.steps li.cur { color: var(--text); font-weight: 700; }
.steps li.cur em { border-color: var(--accent); }

/* 표 */
.tbl { position: relative; border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }  /* relative: 표 안의 숨김 글자(.sr)가 페이지 폭을 늘리지 않게 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--soft); color: var(--sub); font-weight: 600; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
td a { text-decoration: underline; text-underline-offset: 2px; }
td.acts { display: flex; gap: 6px; }
table.edit td { padding: 6px 8px; }
table.edit input, table.edit select { height: 32px; min-width: 90px; }
table.edit td.miss input { border-color: var(--red); background: #fff5f5; }
td.src { color: var(--sub); }

/* 폼 */
.field { margin-bottom: 16px; min-width: 0; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field small { display: block; margin-top: 4px; }
input, select, textarea { width: 100%; height: 40px; padding: 0 12px; border: 1px solid #c4c4c4; border-radius: var(--r); font: inherit; background: #fff; color: var(--text); }
textarea { height: auto; padding: 10px 12px; resize: vertical; font-family: inherit; }
input[type=file] { padding: 8px; height: auto; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: 0; }
input[readonly], select:disabled { background: var(--soft); color: var(--sub); }
.inline { display: flex; gap: 8px; }
/* 파일 선택: 브라우저 기본 버튼은 브라우저 언어로만 나오므로 숨기고 직접 만든 버튼을 쓴다 */
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.file { display: flex; align-items: center; gap: 12px; min-width: 0; }
.field .file label { display: inline-flex; margin: 0; padding: 0 16px; flex-shrink: 0; font-weight: 600; font-size: 14px; }
.file span { color: var(--sub); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file input:focus-visible + label { outline: 2px solid var(--blue); outline-offset: 2px; }
.search { display: flex; gap: 8px; max-width: 560px; margin-top: 14px; }
.seg { display: inline-flex; border: 1px solid #c4c4c4; border-radius: var(--r); overflow: hidden; margin-bottom: 8px; }
.seg.wide { display: flex; margin-bottom: 0; }
.seg.mini { margin: 0; flex-shrink: 0; }
.seg.mini button { height: 26px; min-width: 34px; padding: 0 8px; }
.lab { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 28px; margin-bottom: 6px; }
.field .lab label { margin: 0; }
.grid2 .span2 { grid-column: 1 / -1; }
.seg button { flex: 1; height: 32px; padding: 0 12px; border: 0; border-left: 1px solid #c4c4c4; background: #fff; font: inherit; font-size: 13px; color: var(--sub); cursor: pointer; white-space: nowrap; }
.seg.wide button { height: 40px; min-width: 0; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; }
.two > * { min-width: 0; }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.seg button:disabled { cursor: default; }

/* 계산 내역 */
.brk { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.brk small { display: block; }
.brk span { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.total { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 4px; border-top: 2px solid var(--accent); margin-top: -1px; }
.total b { font-size: 22px; font-variant-numeric: tabular-nums; }
.amount { margin-bottom: 18px; }
.qr { display: flex; gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 18px; }
.qr canvas { width: 132px; height: 132px; flex-shrink: 0;  }
.qr p { font-size: 13px; color: var(--sub); margin: 4px 0; }

/* 조회 카드 */
.card { border: 1px solid var(--line); border-radius: var(--r); padding: 22px; margin-bottom: 14px; }
.card .head { margin-bottom: 0; }
.card h2 { margin: 2px 0; font-size: 16px; }
.sub-head { margin-top: 24px; }
.where { font-size: 13px; margin-bottom: 12px; }
.where a { text-decoration: underline; text-underline-offset: 2px; }

/* 안내 목록 */
.how { list-style: none; padding: 0; margin: 16px 0 0; border-top: 1px solid var(--line-strong); }
.how li { display: flex; gap: 16px; padding: 16px 4px; border-bottom: 1px solid var(--line); }
.how em { color: var(--ink); font-style: normal; font-weight: 700; width: 24px; flex-shrink: 0; }
.how p { color: var(--sub); font-size: 13px; }
.how a { font-size: 13px; font-weight: 600; display: inline-block; margin-top: 4px; }

/* 관리자 로그인 */
.login { max-width: 380px; margin: 32px auto; border: 1px solid var(--line); border-radius: var(--r); padding: 28px; }
.login .lead { margin-bottom: 20px; }
.btn:disabled { opacity: .6; cursor: default; }

/* 영수증 */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; overflow-y: auto; }
.receipt { position: relative; background: #fff; border-radius: var(--r); width: 100%; max-width: 380px; padding: 28px 24px 24px; }
.receipt .x { position: absolute; top: 8px; right: 10px; width: 32px; height: 32px; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--sub); }
.r-head { text-align: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.r-head b { display: block; font-size: 18px; }
.receipt dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 16px 0; font-size: 13px; }
.receipt dt { color: var(--sub); }
.receipt dd { margin: 0; text-align: right; }
.r-item { border-top: 1px solid var(--line); padding: 14px 0; font-size: 13px; }
.r-item small { display: block; }
.thanks { text-align: center; color: var(--sub); font-size: 12px; margin: 16px 0; }

@media (max-width: 760px) {
  .bar { gap: 0 14px; flex-wrap: wrap; height: auto; padding-top: 12px; }
  .logo { flex: 1; }
  .nav { order: 3; flex: 0 0 100%; gap: 18px; height: 42px; margin-top: 4px; }
  .two, .svc-grid, .grid3 { grid-template-columns: 1fr; }
  .grid3 .span { grid-column: auto; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { border-left: 0; border-top: 1px solid var(--line); }
  .stat:nth-child(-n+2) { border-top: 0; }
  .stat:nth-child(even) { border-left: 1px solid var(--line); }
  .row { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .row .num, .row .arrow { display: none; }
  .steps { flex-direction: column; gap: 10px; }
  .steps li { text-align: left; padding: 3px 0 3px 38px; }
  .steps li::before { display: none; }
  .steps em { left: 0; transform: none; }
  h1 { font-size: 21px; }
  /* 좁은 화면: 이동 버튼이 입력칸을 가리지 않게 화면 가장자리 여백 안으로 줄인다 */
  .jump { right: 4px; bottom: 12px; }
  .jump button { width: 34px; height: 34px; }
  .hero { padding: 20px; gap: 14px; }
  .hero h1 { font-size: 26px; }
  .hero { align-items: flex-start; }
  .hero img { width: 44px; height: 44px; }
}
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } .qr { flex-direction: column; align-items: flex-start; } }
