/* 부가세 셀프신고 — 모양
   방향: 회색 바탕에 흰 카드, 굵고 큰 글씨, 둥근 모서리, 선 대신 여백. 어르신도 보기 쉽게 글자와 단추를 크게. */
:root {
  --bg:#f2f4f6; --card:#fff; --ink:#191f28; --sub:#4e5968; --weak:#8b95a1; --line:#e5e8eb; --fill:#f2f4f6; --soft:#f9fafb;
  --main:#2f6bff; --main-soft:#e8f0ff; --main-ink:#fff;
  --ok:#0a8f5b; --ok-soft:#e6f6ee; --bad:#e5383b; --bad-soft:#ffecec; --warn:#8a5a00; --warn-bg:#fff5db;
  --r-card:22px; --r-ctl:14px; --nav-h:68px;
}
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body {
  margin:0; background:var(--bg); color:var(--ink);
  font:17px/1.6 "Pretendard Variable",Pretendard,-apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Noto Sans KR","Malgun Gothic",system-ui,sans-serif;
  letter-spacing:-0.01em; word-break:keep-all; overflow-wrap:anywhere;
  padding-bottom:calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px);
  -webkit-font-smoothing:antialiased;
}
.vh { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* 위쪽 머리 */
.top { position:sticky; top:0; z-index:6; display:flex; gap:10px; align-items:center; justify-content:space-between; padding:12px 20px; background:rgba(242,244,246,.92); backdrop-filter:saturate(1.4) blur(10px); -webkit-backdrop-filter:saturate(1.4) blur(10px); }
.brand { font-weight:800; font-size:19px; letter-spacing:-0.03em; }
.beta { font-size:11px; font-weight:700; color:var(--weak); background:#e5e8eb; padding:2px 7px; border-radius:6px; vertical-align:2px; margin-left:4px; letter-spacing:0; }
.period select { padding:8px 30px 8px 14px; font-size:15px; font-weight:700; background-color:#fff; border-radius:999px; }

/* 아래 메뉴 줄 */
.tabs { position:fixed; left:0; right:0; bottom:0; z-index:7; display:flex; justify-content:center; background:rgba(255,255,255,.96); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px); border-top:1px solid var(--line); padding:6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)); }
.tabs button { flex:1 1 0; max-width:132px; min-height:56px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; border:0; background:none; color:var(--weak); font:inherit; font-size:12.5px; font-weight:700; cursor:pointer; border-radius:12px; -webkit-tap-highlight-color:transparent; }
.tabs svg { width:26px; height:26px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.tabs button.on { color:var(--ink); }
.tabs button.on svg { stroke-width:2.3; }
.tabs button:focus-visible, .btn:focus-visible, .steps button:focus-visible { outline:3px solid #9bbcff; outline-offset:2px; }

/* 본문 */
main { max-width:720px; margin:0 auto; padding:4px 16px 8px; }
.card { background:var(--card); border-radius:var(--r-card); padding:22px 20px; margin-bottom:12px; }
h2 { font-size:21px; font-weight:800; letter-spacing:-0.03em; margin:0 0 12px; line-height:1.35; }
h3 { font-size:16px; font-weight:800; margin:22px 0 8px; color:var(--sub); }
p { margin:8px 0; }
.sub { color:var(--sub); font-size:15px; line-height:1.6; }
.big { font-size:32px; font-weight:800; letter-spacing:-0.03em; margin:14px 0 4px; }
.pay { color:var(--bad); } .refund { color:var(--ok); }

/* 처음 화면의 큰 카드 */
.hero { background:var(--ink); color:#fff; border-radius:26px; padding:26px 22px 22px; margin-bottom:12px; }
.hero-k { margin:0; font-size:15px; font-weight:700; color:#b0b8c1; }
.hero-d { margin:4px 0 6px; font-size:44px; font-weight:800; letter-spacing:-0.04em; line-height:1.15; }
.hero-s { margin:0 0 18px; font-size:14px; color:#b0b8c1; line-height:1.55; }
.hero-s b { color:#fff; }
.hero-tax { display:flex; justify-content:space-between; align-items:baseline; gap:12px; flex-wrap:wrap; background:rgba(255,255,255,.1); border-radius:16px; padding:14px 16px; }
.hero-tax span { font-size:15px; color:#d1d6db; font-weight:600; }
.hero-tax b { font-size:26px; font-weight:800; letter-spacing:-0.03em; font-variant-numeric:tabular-nums; }

.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px; }
.stat { background:var(--soft); border-radius:16px; padding:14px 16px; font-size:15px; font-weight:700; color:var(--sub); }
.stat small { font-weight:500; color:var(--weak); font-size:13px; }
.stat b { display:block; font-size:22px; font-weight:800; color:var(--ink); letter-spacing:-0.03em; font-variant-numeric:tabular-nums; margin-top:2px; }

/* 단추 */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; font:inherit; font-size:17px; font-weight:700; min-height:54px; padding:12px 22px; border-radius:var(--r-ctl); border:0; background:var(--main); color:var(--main-ink); cursor:pointer; transition:transform .08s ease, filter .15s ease; -webkit-tap-highlight-color:transparent; }
.btn:active { transform:scale(.98); filter:brightness(.95); }
.btn.block { display:flex; width:100%; margin-top:12px; }
.btn.ghost { background:var(--fill); color:var(--ink); }
.btn.small { min-height:40px; padding:8px 14px; font-size:15px; border-radius:10px; }
.btn.danger { background:var(--bad-soft); color:var(--bad); }
.btn:disabled { opacity:.35; cursor:default; }
.row { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }

/* 입력 */
.field { display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.field > span { font-size:15px; font-weight:700; color:var(--sub); }
.field .hint { font-size:13px; color:var(--weak); font-weight:500; }
select, input[type=text], input[type=date], textarea { font:inherit; font-weight:600; padding:14px; border:2px solid transparent; border-radius:var(--r-ctl); background:var(--fill); color:var(--ink); max-width:100%; min-height:54px; outline:none; transition:border-color .15s, background .15s; }
select { appearance:none; -webkit-appearance:none; padding-right:38px; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M3 5l4 4 4-4' fill='none' stroke='%238b95a1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 14px center; }
select:focus, input[type=text]:focus, input[type=date]:focus, textarea:focus { border-color:var(--main); background-color:#fff; }
input[inputmode=numeric] { text-align:right; font-variant-numeric:tabular-nums; font-weight:700; }
textarea { width:100%; min-height:160px; font-size:14px; font-weight:500; }
::placeholder { color:var(--weak); font-weight:500; }

/* 둘 중 하나 고르기 */
.seg { display:inline-flex; background:var(--fill); border-radius:var(--r-ctl); padding:4px; gap:2px; }
.seg.wide { display:flex; }
.seg.wide label { flex:1; }
.seg label { position:relative; padding:11px 20px; cursor:pointer; font-weight:700; color:var(--sub); border-radius:11px; text-align:center; transition:background .15s, color .15s; }
.seg input { position:absolute; opacity:0; inset:0; }
.seg label:has(input:checked) { background:#fff; color:var(--ink); box-shadow:0 1px 3px rgba(0,0,0,.12); }
.seg label:has(input:focus-visible) { outline:3px solid #9bbcff; }

.check { display:flex; gap:12px; align-items:flex-start; padding:12px 0; border-bottom:1px solid var(--soft); cursor:pointer; }
.check input { appearance:none; -webkit-appearance:none; width:26px; height:26px; margin:1px 0 0; flex:0 0 auto; border-radius:8px; border:2px solid #c9cfd6; background:#fff; cursor:pointer; transition:background .12s, border-color .12s; }
.check input:checked { border-color:var(--main); background:var(--main) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.3l3 3 6-6.3' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
.check input:focus-visible { outline:3px solid #9bbcff; outline-offset:2px; }

/* 표 */
.tablewrap { overflow-x:auto; margin:0 -6px; padding:0 6px; }
table { width:100%; border-collapse:collapse; font-size:15px; }
th { font-size:13px; font-weight:700; color:var(--weak); padding:8px 8px; text-align:left; white-space:nowrap; border-bottom:1px solid var(--line); }
td { padding:13px 8px; border-bottom:1px solid var(--soft); text-align:left; white-space:nowrap; }
td.num, th.num { text-align:right; font-variant-numeric:tabular-nums; font-weight:700; }
th.num { font-weight:700; }
tr.total td { font-weight:800; background:var(--soft); border-bottom:0; }
tr.total td:first-child { border-radius:12px 0 0 12px; } tr.total td:last-child { border-radius:0 12px 12px 0; }
tr.click { cursor:pointer; }
tr.click:hover td { background:var(--main-soft); }
tr.sel td { background:var(--main-soft); }
.tag { display:inline-block; font-size:12.5px; font-weight:800; padding:3px 9px; border-radius:8px; }
.tag.sale { background:var(--ok-soft); color:var(--ok); }
.tag.buy { background:var(--bad-soft); color:var(--bad); }

.note { position:relative; background:var(--warn-bg); color:var(--warn); border-radius:16px; padding:13px 16px 13px 44px; font-size:15px; font-weight:600; margin:12px 0; line-height:1.55; }
.note::before { content:"!"; position:absolute; left:14px; top:13px; width:20px; height:20px; border-radius:50%; background:#f2a900; color:#fff; font-size:13px; font-weight:800; display:flex; align-items:center; justify-content:center; }
.note .btn { margin:8px 0 0; display:flex; width:fit-content; }
.empty { color:var(--weak); text-align:center; padding:36px 8px; font-weight:600; }

/* 처음 화면의 순서 목록 */
.steps { display:grid; gap:2px; margin:0 -8px; }
.steps button { display:flex; align-items:center; gap:14px; text-align:left; font:inherit; padding:12px 8px; border-radius:14px; border:0; background:none; color:var(--ink); cursor:pointer; -webkit-tap-highlight-color:transparent; }
.steps button:hover, .steps button:active { background:var(--soft); }
.steps i { flex:0 0 auto; width:36px; height:36px; border-radius:12px; background:var(--main-soft); color:var(--main); font-style:normal; font-weight:800; display:flex; align-items:center; justify-content:center; }
.steps button > span { flex:1; min-width:0; }
.steps b { display:block; font-size:17px; font-weight:700; }
.steps .sub { display:block; font-size:14px; color:var(--weak); }
.steps em { font-style:normal; color:#c9cfd6; font-size:24px; }

.disclaimer { max-width:720px; margin:0 auto; padding:8px 24px 16px; font-size:13px; color:var(--weak); line-height:1.6; }

/* 홈택스 따라하기 */
.step { scroll-margin-top:70px; }
.step h3 { margin:0 0 12px; font-size:20px; font-weight:800; color:var(--ink); display:flex; align-items:center; gap:10px; letter-spacing:-0.03em; line-height:1.35; }
.stepno { display:inline-flex; align-items:center; justify-content:center; min-width:32px; height:32px; padding:0 6px; border-radius:10px; background:var(--ink); color:#fff; font-size:16px; font-weight:800; flex:0 0 auto; }
.where { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:0 0 12px; }
.where span { background:var(--fill); border-radius:9px; padding:5px 10px; font-size:14px; font-weight:700; color:var(--sub); }
.where i { color:#c9cfd6; font-style:normal; font-weight:800; }
.fill { margin:0 0 12px; background:var(--soft); border-radius:18px; padding:4px 16px; }
.fill > div { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; padding:13px 0; border-bottom:1px solid var(--line); }
.fill > div:last-child { border-bottom:none; }
.fill dt { font-size:15px; font-weight:700; color:var(--sub); }
.fill dt small { display:block; font-weight:500; color:var(--weak); font-size:12.5px; }
.fill dd { margin:0 0 0 auto; font-size:22px; font-weight:800; letter-spacing:-0.03em; font-variant-numeric:tabular-nums; text-align:right; white-space:normal; overflow-wrap:anywhere; }
.step.done { opacity:.55; }
.step.done .stepno { background:var(--ok); }
.step.skip { background:transparent; padding:6px 20px; margin-bottom:8px; }
.step.skip h3 { font-size:15px; color:var(--weak); margin:0; font-weight:700; }
.step.skip p { margin:0; font-size:13px; color:var(--weak); }
.donebox { border-bottom:0; border-top:1px solid var(--soft); margin-top:10px; padding:14px 0 0; font-weight:700; }
details summary { cursor:pointer; color:var(--main); font-weight:700; padding:8px 0; }

.pic { display:block; width:100%; max-width:460px; height:auto; margin:0 auto 14px; border-radius:12px; }
.say { font-size:18px; line-height:1.7; margin:10px 0; color:var(--ink); }
.step.one h3 { font-size:24px; }
.step.one .stepno { min-width:38px; height:38px; font-size:19px; border-radius:12px; }
.step.one .fill dt { font-size:16px; }
.guidehead h2 { margin-bottom:4px; }
.bar { height:8px; background:var(--fill); border-radius:4px; overflow:hidden; margin:14px 0 8px; }
.bar i { display:block; height:100%; background:var(--main); border-radius:4px; transition:width .25s ease; }
.count { font-weight:800; font-size:17px; margin:0; color:var(--sub); }
.navrow { display:flex; gap:10px; margin:0 0 12px; position:sticky; bottom:calc(var(--nav-h) + env(safe-area-inset-bottom) + 4px); z-index:5; padding:10px 0; background:linear-gradient(to top, var(--bg) 70%, rgba(242,244,246,0)); }
.navrow .btn { flex:1; min-height:60px; font-size:19px; border-radius:16px; }
.navrow .btn.ghost { flex:0 0 32%; background:#fff; }

.brand { white-space:nowrap; }
.stat b { white-space:nowrap; }
@media (max-width:520px) {
  .top { padding:10px 14px; }
  .brand { font-size:17px; }
  .beta { display:none; }
  .period select { font-size:14px; padding:6px 28px 6px 12px; min-height:40px; background-position:right 10px center; }
  .stat { padding:12px 12px; }
  .stat b { font-size:19px; }
  body { font-size:16.5px; }
  .big { font-size:28px; }
  .hero-d { font-size:40px; }
  .card { padding:20px 18px; }
  main { padding:4px 12px 8px; }
}
@media (min-width:900px) {
  .hero { padding:32px 30px 26px; }
}
@media (prefers-reduced-motion:reduce) { * { transition:none !important; } }
@media print {
  .no-print { display:none !important; }
  body { background:#fff; font-size:12pt; padding:0; }
  .card { padding:0; border-radius:0; }
  main { max-width:none; padding:0; }
  tr.sel td, tr.click:hover td, tr.total td { background:none; }
  .note { background:none; padding-left:0; } .note::before { display:none; }
}

/* ---------- 장부 ---------- */
.leftover { display:flex; justify-content:space-between; align-items:baseline; gap:12px; flex-wrap:wrap; background:var(--ink); color:#fff; border-radius:16px; padding:14px 16px; margin-top:10px; }
.leftover span { font-weight:700; font-size:15px; color:#d1d6db; } .leftover small { font-weight:500; color:#8b95a1; font-size:13px; }
.leftover b { font-size:24px; font-weight:800; letter-spacing:-0.03em; font-variant-numeric:tabular-nums; } .leftover b.pay { color:#ff8a8a; }
.months { display:grid; gap:2px; margin:0 -8px; }
.mrow { display:flex; align-items:center; gap:10px; width:100%; padding:8px; border:0; background:none; font:inherit; color:var(--ink); border-radius:12px; cursor:pointer; text-align:left; -webkit-tap-highlight-color:transparent; }
.mrow:hover { background:var(--soft); } .mrow.on { background:var(--main-soft); }
.mname { flex:0 0 40px; font-weight:800; }
.mbars { flex:1; display:grid; gap:4px; min-width:0; }
.mbar { display:flex; align-items:center; gap:8px; }
.mbar i { display:block; height:10px; border-radius:5px; flex:0 0 auto; max-width:62%; }
.mbar.sale i { background:var(--ok); } .mbar.buy i { background:#ff8a8a; }
.mbar b { font-size:13.5px; font-weight:700; color:var(--sub); font-variant-numeric:tabular-nums; white-space:nowrap; }
.dot { display:inline-block; width:9px; height:9px; border-radius:50%; margin:0 2px 0 6px; } .dot.sale { background:var(--ok); margin-left:0; } .dot.buy { background:#ff8a8a; }
.cats { display:grid; gap:10px; padding:6px 0 4px; }
.cats div { position:relative; display:flex; justify-content:space-between; gap:10px; padding-bottom:9px; font-size:15px; font-weight:600; }
.cats b { font-variant-numeric:tabular-nums; }
.cats i { position:absolute; left:0; bottom:0; height:5px; border-radius:3px; background:#c9d7ff; min-width:4px; }
.addbtn { margin:0 0 12px; min-height:60px; font-size:19px; border-radius:18px; }
.bigin { font-size:26px !important; font-weight:800 !important; min-height:68px; letter-spacing:-0.02em; }
details.more { margin:-4px 0 10px; }
.okmsg { background:var(--ok-soft); color:var(--ok); border-radius:14px; padding:12px 16px; font-weight:700; font-size:15px; }
.listhead { display:grid; gap:10px; margin-bottom:6px; }
.listhead input { width:100%; }
.mgroup { margin-top:8px; }
.mhead { display:flex; justify-content:space-between; align-items:baseline; gap:10px; flex-wrap:wrap; padding:14px 2px 6px; border-bottom:1px solid var(--line); }
.mhead b { font-size:17px; font-weight:800; } .mhead span { font-size:13.5px; color:var(--weak); font-weight:600; font-variant-numeric:tabular-nums; }
.trow { display:flex; align-items:center; gap:12px; width:calc(100% + 16px); margin:0 -8px; padding:13px 8px; border:0; border-bottom:1px solid var(--soft); background:none; font:inherit; color:var(--ink); text-align:left; cursor:pointer; border-radius:12px; -webkit-tap-highlight-color:transparent; }
.trow:hover, .trow:active { background:var(--soft); }
.trow:focus-visible, .mrow:focus-visible { outline:3px solid #9bbcff; outline-offset:-2px; }
.tday { flex:0 0 38px; text-align:center; font-size:19px; font-weight:800; color:var(--sub); font-variant-numeric:tabular-nums; } .tday small { font-size:11px; font-weight:600; color:var(--weak); }
.tmain { flex:1; min-width:0; } .tmain b { display:block; font-size:16.5px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tmain small, .tamt small { display:block; font-size:12.5px; color:var(--weak); font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tamt { flex:0 0 auto; text-align:right; font-size:17px; font-weight:800; font-variant-numeric:tabular-nums; letter-spacing:-0.02em; white-space:nowrap; }
.tamt.sale { color:var(--ok); } .tamt.buy { color:var(--ink); }

/* 장부 보완 */
.rangeseg { margin:0 0 12px; }
.rangeseg label { padding:9px 8px; font-size:15px; }
.plist { display:grid; gap:2px; padding:4px 0; }
.plist div { display:flex; align-items:center; gap:10px; padding:9px 0; border-bottom:1px solid var(--soft); font-size:15px; }
.plist .pn { flex:1; min-width:0; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .plist small { color:var(--weak); font-weight:500; }
.plist b { font-variant-numeric:tabular-nums; white-space:nowrap; }
.ready { display:grid; gap:2px; margin:6px -8px 0; }
.ready button { display:flex; align-items:center; gap:12px; padding:11px 8px; border:0; background:none; font:inherit; font-weight:700; color:var(--ink); text-align:left; border-radius:12px; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.ready button:hover { background:var(--soft); }
.ready i { flex:0 0 auto; width:28px; height:28px; border-radius:50%; background:var(--fill); color:var(--weak); font-style:normal; font-weight:800; display:flex; align-items:center; justify-content:center; }
.ready .ok i { background:var(--ok); color:#fff; }
.ready span { flex:1; } .ready em { font-style:normal; color:#c9cfd6; font-size:22px; }
table.book { font-size:13.5px; } table.book th, table.book td { padding:8px 6px; }
table.book thead th { border-bottom:1px solid var(--line); vertical-align:bottom; }
@media print {
  table.book { font-size:9pt; } table.book th, table.book td { border:1px solid #999; padding:3px 4px; white-space:normal; }
  .tablewrap { overflow:visible; margin:0; padding:0; }
  /* 종이: 기본은 세로, 간편장부(칸이 많음)만 가로 */
  @page { size:A4 portrait; margin:12mm; }
  @page book { size:A4 landscape; margin:12mm; }
  .bookpage { page:book; }
}
