/* 색은 모두 배경 대비 4.5:1 이상(WCAG AA)이 되도록 고름 */
:root {
  --bg: #f3f5f9; --card: #fff; --text: #141a26; --muted: #4f596b; --line: #dfe4ec; --soft: #edf1f7;
  --primary: #1f56cc; --primary-soft: #e6eeff; --spend: #c4261d; --income: #0b7340; --refund: #0b7340; --warn: #9a4d00;
  --transfer: #5236c2; --radius: 14px; --shadow: 0 1px 2px rgba(20,30,60,.06), 0 2px 8px rgba(20,30,60,.04);
  --num: "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #10141b; --card: #192029; --text: #eef1f6; --muted: #aab3c3; --line: #2e3744; --soft: #222a35;
    --primary: #8db2ff; --primary-soft: #1d2a44; --spend: #ff8a80; --income: #5fd69a; --refund: #5fd69a; --warn: #ffb35c; --transfer: #b7a6ff; --shadow: none; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--num); padding-bottom: 84px;
  word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.spend { color: var(--spend); }
.income { color: var(--income); }
.refund { color: var(--refund); }
.transfer { color: var(--transfer); }
.hidden { display: none !important; }

/* 상단 바 */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 20px;
  background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; color: var(--text); font-size: 17px; }
.topnav { display: flex; gap: 4px; flex: 1; }
#netStatus { display: flex; gap: 6px; align-items: center; margin-left: auto; }
#netStatus:empty { display: none; }
.topnav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.topnav a.on { background: var(--primary-soft); color: var(--primary); }
.bottomnav { display: none; }
body.no-db .top-add, body.no-db .bottomnav, body.no-db .topnav { display: none !important; }

#app { max-width: 1240px; margin: 0 auto; padding: 16px 20px 40px; outline: none; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--line); background: var(--card);
  border-radius: 10px; padding: 8px 14px; cursor: pointer; font-weight: 600; min-height: 38px; white-space: nowrap; }
.btn:hover { border-color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.danger { color: var(--spend); }
.btn.danger.solid { background: var(--spend); border-color: var(--spend); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 4px 10px; min-height: 30px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.iconbtn { border: 1px solid var(--line); background: var(--card); border-radius: 8px; min-width: 34px; height: 34px; cursor: pointer; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; gap: 3px; color: var(--text); text-decoration: none; }
.iconbtn:hover { border-color: var(--primary); color: var(--primary); }
.linkbtn { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; font-weight: 600; text-align: left; }

/* 월 이동 */
.monthbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.monthbar .title { font-size: 22px; font-weight: 800; margin: 0 4px; }
.monthbar input[type=month] { border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; background: var(--card); min-height: 38px; }
.monthbar .spacer { flex: 1; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--muted); }
.badge.live { background: var(--primary-soft); color: var(--primary); }

/* 카드·섹션 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.sec { margin-bottom: 16px; }
.sec-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.sec-head .no { color: var(--primary); font-weight: 800; }
.sec-head .right { margin-left: auto; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.grid2 > *, .summary > *, .settings-layout > * { min-width: 0; }
.stack > * + * { margin-top: 12px; }

/* 요약 */
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); text-align: left; cursor: pointer; display: block; width: 100%; }
.stat:hover { border-color: var(--primary); }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; }
.stat .value { font-size: 24px; font-weight: 800; margin: 2px 0; }
.stat .cmp { font-size: 12.5px; color: var(--muted); }
.stat.open { border-color: var(--primary); }
.up { color: var(--spend); font-weight: 700; }
.down { color: var(--income); font-weight: 700; }
.breakdown { margin-top: 12px; }
.kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.kv.total { font-weight: 800; }

/* 카테고리 막대 */
.insight { display: block; width: 100%; text-align: left; background: var(--primary-soft); border: 1px solid transparent; border-radius: 12px; padding: 12px 14px; cursor: pointer; margin-bottom: 12px; }
.insight:hover { border-color: var(--primary); }
.insight strong { font-size: 15.5px; }
.catrow { display: grid; grid-template-columns: minmax(80px, 1.2fr) 2fr auto; gap: 4px 12px; align-items: center; padding: 8px 6px; border-radius: 10px; cursor: pointer; width: 100%; background: none; border: 0; text-align: left; }
.catrow:hover { background: var(--soft); }
.catrow .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catrow .amt { text-align: right; font-weight: 700; }
.catrow .meta { grid-column: 2 / 4; font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.bar { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.bar.over > i { background: var(--spend); }
.bar.warn > i { background: var(--warn); }
details.more > summary { cursor: pointer; color: var(--primary); font-weight: 700; padding: 8px 4px; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: '▸ '; }
details.more[open] > summary::before { content: '▾ '; }

/* 차트 */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }

/* 예산 */
.budget-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.budget-row:last-child { border-bottom: 0; }
.budget-row .top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.budget-row .top .n { font-weight: 700; }
.unset { color: var(--muted); font-size: 12.5px; background: var(--soft); padding: 1px 8px; border-radius: 99px; }
.rec { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rec:last-child { border-bottom: 0; }
.rec .when { width: 54px; font-size: 13px; color: var(--muted); }
.rec .n { flex: 1; min-width: 0; }
.pill { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.pill.done { background: #e3f6ec; color: #138a52; }
.pill.todo { background: #fff3df; color: #a86400; }
@media (prefers-color-scheme: dark) { .pill.done { background: #183a2a; color: #59d496; } .pill.todo { background: #3c2e14; color: #ffbc4f; } }

/* 가족 가계부 보기 */
.viewbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.viewbar button { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 14px; cursor: pointer; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.viewbar button.on { background: var(--text); color: var(--card); border-color: var(--text); }
.viewbar.cal-who { margin-bottom: 8px; }
.viewbar.cal-who button { padding: 4px 11px; font-size: 13px; }
.day .whodots { display: flex; gap: 2px; margin-top: auto; flex-wrap: wrap; }
.day .whodots .dot { width: 6px; height: 6px; }
.viewbar button.edit { border-style: dashed; color: var(--muted); font-weight: 600; }
.member-edit { display: grid; grid-template-columns: 40px minmax(0, 1fr) 80px auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.member-edit input[data-f=name], .member-edit select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: var(--card); min-height: 38px; width: 100%; }
.member-edit input[type=color] { width: 38px; height: 34px; border: 0; background: none; padding: 0; cursor: pointer; }
.member-edit label { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.mchip { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; margin-right: 4px; vertical-align: 1px;
  color: var(--mc); background: color-mix(in srgb, var(--mc) 14%, transparent); }
.quick.who button { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; font-weight: 600; }
.whoami { background: var(--primary-soft); padding: 10px 20px; display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 14px; }
.whoami button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 4px 12px; font-weight: 700; cursor: pointer; }
@media (max-width: 720px) { .viewbar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; } .viewbar button { white-space: nowrap; } }

/* 카드 실적 */
.perf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.perf { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.perf-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.perf-top .right { margin-left: auto; }
.perf-main { display: block; background: none; border: 0; padding: 4px 0; cursor: pointer; text-align: left; }
.perf-main .value { font-size: 22px; font-weight: 800; }
.perfbar { position: relative; height: 10px; background: var(--soft); border-radius: 99px; margin-top: 4px; }
.perfbar > i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.perfbar .tick { position: absolute; top: -3px; width: 2px; height: 16px; background: var(--muted); transform: translateX(-1px); }
.perfbar .tick.on { background: var(--income); }
.perfbar .tick em { position: absolute; top: 17px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11px; color: var(--muted); white-space: nowrap; }
.perfbar .tick:last-child em { left: auto; right: 0; transform: none; }
@media (max-width: 720px) { .perf-grid { grid-template-columns: minmax(0, 1fr); } }
.sync-badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--soft); color: var(--muted); border: 0; cursor: pointer; white-space: nowrap; }
.sync-badge.ok { color: var(--income); }
.sync-badge.warn { color: var(--warn); }
.sync-badge.err { color: var(--spend); }
.offline-badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: #fff3df; color: #a86400; }
@media (prefers-color-scheme: dark) { .offline-badge { background: #3c2e14; color: #ffbc4f; } }

/* 달력 */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.day > span { max-width: 100%; }
.cal .dow { text-align: center; font-size: 12px; color: var(--muted); font-weight: 700; padding: 2px 0; }
.cal .dow.sun { color: var(--spend); } .cal .dow.sat { color: var(--primary); }
.day { min-height: 70px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 6px; cursor: pointer; background: var(--card); text-align: left; display: flex; flex-direction: column; gap: 1px; font-size: 12px; }
.day:hover { border-color: var(--primary); }
.day.blank { visibility: hidden; }
.day.today { box-shadow: inset 0 0 0 2px var(--primary); }
.day.sel { background: var(--primary-soft); border-color: var(--primary); }
.day.future { opacity: .55; }
.day .d { font-weight: 700; font-size: 12.5px; }
.day .e, .day .i { font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day .e { color: var(--spend); } .day .i { color: var(--income); }

/* 거래 목록 */
.txlist { list-style: none; margin: 0; padding: 0; }
.tx { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.tx:last-child { border-bottom: 0; }
.tx:hover { background: var(--soft); }
.tx .date { width: 52px; flex: none; font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.tx .body { flex: 1; min-width: 0; }
.tx .t1 { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .t2 { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .amt { font-weight: 800; text-align: right; }
.tx .amt .sub { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.tx .acts { display: flex; gap: 4px; flex: none; }
.chip { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--soft); color: var(--muted); margin-right: 4px; vertical-align: 1px; }
.chip.refund { background: #e3f6ec; color: #138a52; }
.chip.transfer { background: #eeebff; color: #5a49c8; }
.chip.income { background: #e3f6ec; color: #138a52; }
@media (prefers-color-scheme: dark) { .chip.refund, .chip.income { background: #183a2a; color: #59d496; } .chip.transfer { background: #2b2650; color: #b3a8ff; } }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.tabs button { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 5px 12px; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.tabs button.on { background: var(--text); color: var(--card); border-color: var(--text); }
.rank { display: flex; justify-content: space-between; gap: 8px; padding: 8px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px; }
.rank:hover { background: var(--soft); }
.rank:last-child { border-bottom: 0; }

/* 필터 */
.filters { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; }
.filters .wide { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--card); min-height: 40px; width: 100%; }
.field textarea { min-height: 64px; resize: vertical; }
.field input[type=checkbox], .field input[type=radio] { width: auto; min-height: 0; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.field .err { color: var(--spend); font-size: 12.5px; }
.checks { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; min-height: 40px; }
.checks label { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; font-size: 14px; }
.resultbar { display: flex; gap: 10px 18px; flex-wrap: wrap; align-items: baseline; padding: 12px 14px; background: var(--primary-soft); border-radius: 12px; margin: 12px 0; }
.resultbar .scope { font-weight: 700; }
.resultbar .fchip { background: var(--card); border-radius: 99px; padding: 2px 10px; font-size: 12.5px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.resultbar .fchip button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0; }
.resultbar .sum { margin-left: auto; font-weight: 800; }
.compare-group { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }

/* 모달 */
.backdrop { position: fixed; inset: 0; background: rgba(15,20,30,.45); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--card); border-radius: 16px; width: min(620px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal.wide { width: min(980px, 100%); }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { flex: 1; }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.formgrid .full { grid-column: 1 / -1; }
.amount-input { font-size: 22px !important; font-weight: 800; text-align: right; }
.seg { display: flex; background: var(--soft); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: none; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.seg button:disabled { cursor: not-allowed; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.quick button { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 3px 10px; font-size: 13px; cursor: pointer; }
.quick button.on { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.optional { border: 1px dashed var(--line); border-radius: 12px; padding: 4px 12px 12px; }
.optional > summary { cursor: pointer; font-weight: 700; padding: 8px 0; color: var(--muted); }
.inline-new { display: flex; gap: 6px; margin-top: 6px; }
.inline-new input, .inline-new select { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; min-width: 0; background: var(--card); }
.detail-amount { font-size: 28px; font-weight: 800; }
.refund-box { background: var(--soft); border-radius: 12px; padding: 10px 14px; margin: 12px 0; }
.dl { display: grid; grid-template-columns: 100px 1fr; gap: 8px 12px; }
.dl dt { color: var(--muted); font-size: 13.5px; }
.dl dd { margin: 0; word-break: break-all; }
.notice { background: #fff8e6; border: 1px solid #f1d89a; color: #6d4d00; border-radius: 12px; padding: 10px 14px; font-size: 13.5px; }
.notice.info { background: var(--primary-soft); border-color: transparent; color: var(--text); }
@media (prefers-color-scheme: dark) { .notice { background: #3a2f12; border-color: #5c4917; color: #f3d48a; } }
#modeBanner .demo { background: #6b5bd6; color: #fff; padding: 8px 20px; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 14px; }
#modeBanner .demo button { background: #fff; color: #4a3bb5; border: 0; border-radius: 8px; padding: 4px 10px; font-weight: 700; cursor: pointer; }

/* 설정 */
.settings-layout { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: start; }
.side-tabs { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 70px; }
.side-tabs button { text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 10px; cursor: pointer; font-weight: 600; color: var(--muted); }
.side-tabs button.on { background: var(--card); color: var(--primary); box-shadow: var(--shadow); }
.item-row { display: flex; align-items: center; gap: 6px; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.item-row .n { flex: 1; min-width: 0; font-weight: 600; }
.item-row.sub { padding-left: 26px; }
.item-row.sub .n { font-weight: 500; }
.item-row.archived .n { color: var(--muted); text-decoration: line-through; }
.item-row input.rename { flex: 1; border: 1px solid var(--primary); border-radius: 8px; padding: 5px 8px; min-width: 0; }

/* 토스트 */
#toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: #1b2230; color: #fff; padding: 10px 18px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 80; max-width: calc(100% - 32px); text-align: center; }
#toast.show { opacity: 1; }

/* 웰컴 */
.welcome { max-width: 560px; margin: 40px auto; text-align: center; }
.welcome h1 { font-size: 26px; margin-bottom: 8px; }
.welcome .choices { display: grid; gap: 12px; margin-top: 24px; text-align: left; }
.welcome .choice { display: block; width: 100%; text-align: left; padding: 18px; cursor: pointer; }
.welcome .choice:hover { border-color: var(--primary); }

/* 반응형 */
@media (max-width: 1000px) {
  .summary { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .filters .wide { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  body { font-size: 15.5px; }
  .topbar { padding: 10px 14px; }
  .topnav, .top-add { display: none; }
  #app { padding: 12px 12px 30px; }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottomnav a, .bottomnav button { display: flex; flex-direction: column; align-items: center; font-size: 12.5px; color: var(--muted); font-weight: 600; background: none; border: 0; gap: 1px; cursor: pointer; }
  .bottomnav a span { font-size: 18px; line-height: 1.2; }
  .bottomnav a.on { color: var(--primary); }
  .bottomnav .fab { color: var(--primary); font-weight: 800; }
  .bottomnav .fab span { background: var(--primary); color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 26px; line-height: 44px; margin-top: -20px; box-shadow: 0 4px 12px rgba(47,107,237,.4); }
  .monthbar .title { font-size: 19px; }
  .monthbar .hide-m { display: none; }
  .stat .value { font-size: 19px; }
  .stat { padding: 12px; }
  .day { min-height: 56px; padding: 3px; font-size: 11.5px; border-radius: 8px; letter-spacing: -0.3px; }
  .day .d { font-size: 11px; }
  .tx { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "date body amt" "date acts amt"; column-gap: 8px; row-gap: 2px; align-items: start; }
  .tx .date { grid-area: date; width: auto; }
  .tx .body { grid-area: body; }
  .tx .amt { grid-area: amt; }
  .tx .acts { grid-area: acts; }
  .tx .acts .iconbtn { min-width: 30px; height: 28px; font-size: 13px; }
  .backdrop { align-items: flex-end; padding: 0; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .formgrid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .side-tabs { flex-direction: row; overflow-x: auto; position: static; }
  .side-tabs button { white-space: nowrap; }
  .dl { grid-template-columns: 84px 1fr; }
  .item-row { flex-wrap: wrap; }
  .tx .amt { max-width: 38vw; }
  .tx .amt .sub { white-space: normal; word-break: keep-all; line-height: 1.3; }
  .tx .t1 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: keep-all; overflow-wrap: anywhere; }
  .rec { flex-wrap: wrap; row-gap: 4px; }
  .rec .n { flex: 1 1 calc(100% - 70px); }
  .rec > .num { margin-left: 64px; }
  .item-row .n, .item-row input.rename { flex-basis: 100%; }
}

/* =========================================================
   스킨: 손그림 노트 (body.skin-sketch)
   흰 종이 + 굵은 검정 펜 테두리 + 손글씨 + 형광펜 강조
   ========================================================= */
body.skin-sketch {
  --bg: #fbfaf6; --card: #ffffff; --text: #1d1d1b; --muted: #5b5b57; --line: #1d1d1b; --soft: #f1efe8;
  --primary: #1e5ad8; --primary-soft: #e6eeff; --spend: #e03131; --income: #2b8a3e; --refund: #2b8a3e; --warn: #e8590c;
  --transfer: #6741d9; --shadow: none; --radius: 16px;
  --pen: 2.5px solid #1d1d1b; --pen-thin: 1.8px solid #1d1d1b; --marker: var(--accent, #ffe066); --marker-soft: var(--accent-soft, #fff4bf); --marker-strong: var(--accent-strong, #ffd43b);
  --num: "Gaegu", "Nanum Pen Script", "Malgun Gothic", cursive;
  color-scheme: light;
  font-family: "Gaegu", "Malgun Gothic", cursive; font-size: 17px; font-weight: 700; letter-spacing: -0.2px;
  background: var(--bg);
}
body.skin-sketch h1, body.skin-sketch h2, body.skin-sketch .brand, body.skin-sketch .monthbar .title,
body.skin-sketch .stat .value, body.skin-sketch .detail-amount, body.skin-sketch .perf-main .value, body.skin-sketch .welcome h1 {
  font-family: "Jua", "Gaegu", "Malgun Gothic", sans-serif; font-weight: 400; letter-spacing: -0.5px;
}
body.skin-sketch .num { font-variant-numeric: normal; }
/* 상단 바 */
body.skin-sketch .topbar { background: var(--card); border-bottom: var(--pen); }
body.skin-sketch .brand { font-size: 24px; }
body.skin-sketch .topnav a { color: var(--text); border: 2px solid transparent; }
body.skin-sketch .topnav a.on { background: var(--marker); color: var(--text); border: var(--pen-thin); }
/* 카드·섹션: 굵은 펜 테두리 */
body.skin-sketch .card, body.skin-sketch .stat, body.skin-sketch .modal, body.skin-sketch .perf, body.skin-sketch .compare-group {
  border: var(--pen); border-radius: 16px; box-shadow: none;
}
body.skin-sketch .modal { box-shadow: 5px 6px 0 rgba(29, 29, 27, .85); }
body.skin-sketch .modal-head, body.skin-sketch .modal-foot { border-color: var(--line); border-width: 2px; }
body.skin-sketch h2 { font-size: 22px; }
body.skin-sketch h3 { font-size: 18px; }
body.skin-sketch .sec-head h2 { background: linear-gradient(transparent 62%, var(--marker) 62%, var(--marker) 92%, transparent 92%); padding: 0 2px; }
body.skin-sketch .sec-head .no { color: var(--text); }
body.skin-sketch .muted, body.skin-sketch .stat .label, body.skin-sketch .stat .cmp, body.skin-sketch .field > span { color: var(--muted); }
/* 요약 카드 */
body.skin-sketch .stat .value { font-size: 28px; }
body.skin-sketch .stat:hover, body.skin-sketch .stat.open { border-color: var(--line); background: var(--marker-soft); }
/* 버튼: 흰 바탕 + 펜 테두리, 주요 버튼은 노란 형광펜 */
body.skin-sketch .btn, body.skin-sketch .iconbtn, body.skin-sketch .tabs button, body.skin-sketch .viewbar button, body.skin-sketch .quick button,
body.skin-sketch .whoami button, body.skin-sketch .side-tabs button {
  border: var(--pen-thin); background: var(--card); color: var(--text); font-family: inherit; font-weight: 700;
}
body.skin-sketch .btn.primary, body.skin-sketch .top-add { background: var(--marker); border: var(--pen); color: var(--text); }
body.skin-sketch .btn.primary:hover { background: var(--marker-strong); }
body.skin-sketch .btn.danger.solid { background: #ffa8a8; color: var(--text); border: var(--pen); }
body.skin-sketch .btn.danger { color: var(--spend); }
body.skin-sketch .btn.ghost { border-color: transparent; }
body.skin-sketch .tabs button.on, body.skin-sketch .viewbar button.on, body.skin-sketch .quick button.on, body.skin-sketch .side-tabs button.on {
  background: var(--marker); color: var(--text); border: var(--pen-thin); box-shadow: none;
}
body.skin-sketch .viewbar button.edit { border-style: dashed; }
body.skin-sketch .seg { background: var(--card); border: var(--pen-thin); }
body.skin-sketch .seg button { color: var(--muted); font-family: inherit; font-weight: 700; }
body.skin-sketch .seg button.on { background: var(--marker); color: var(--text); box-shadow: none; }
/* 입력 칸 */
body.skin-sketch .field input, body.skin-sketch .field select, body.skin-sketch .field textarea, body.skin-sketch .monthbar input[type=month],
body.skin-sketch .inline-new input, body.skin-sketch .inline-new select, body.skin-sketch .member-edit input[data-f=name], body.skin-sketch .member-edit select {
  border: var(--pen-thin); background: var(--card); font-family: inherit; font-weight: 700; font-size: 16px;
}
body.skin-sketch .field input:focus, body.skin-sketch .field select:focus, body.skin-sketch .field textarea:focus { outline: 3px solid var(--marker); border-color: var(--line); }
body.skin-sketch .optional { border: 2px dashed var(--line); }
/* 강조 상자: 노란 메모지 */
body.skin-sketch .insight, body.skin-sketch .notice.info, body.skin-sketch .resultbar, body.skin-sketch .refund-box, body.skin-sketch .whoami {
  background: var(--marker-soft); border: var(--pen-thin); border-radius: 14px;
}
body.skin-sketch .notice { background: #fff4bf; border: var(--pen-thin); color: var(--text); }
body.skin-sketch .resultbar .fchip { border: 1.5px solid var(--line); }
/* 막대·진행률: 펜 테두리 안에 색칠 */
body.skin-sketch .bar, body.skin-sketch .perfbar { border: 1.8px solid var(--line); background: var(--card); height: 12px; }
body.skin-sketch .bar > i, body.skin-sketch .perfbar > i { border-radius: 99px; }
body.skin-sketch .perfbar .tick { background: var(--line); }
/* 뱃지·칩 */
body.skin-sketch .badge, body.skin-sketch .chip, body.skin-sketch .pill, body.skin-sketch .unset { border: 1.5px solid var(--line); background: var(--card); color: var(--text); }
body.skin-sketch .badge.live { background: var(--marker); }
body.skin-sketch .pill.done, body.skin-sketch .chip.income, body.skin-sketch .chip.refund { background: #d3f9d8; color: #1b5e2a; }
body.skin-sketch .pill.todo { background: #ffe8cc; color: #8a3c00; }
body.skin-sketch .chip.transfer { background: #e5dbff; color: #4b2fa8; }
body.skin-sketch .mchip { border: 1.5px solid var(--mc); background: var(--card); }
body.skin-sketch .dot { box-shadow: 0 0 0 1.5px var(--line); }
/* 달력 */
body.skin-sketch .day { border: var(--pen-thin); border-radius: 10px; font-size: 13px; }
body.skin-sketch .day.today { box-shadow: inset 0 0 0 3px var(--marker); }
body.skin-sketch .day.sel { background: var(--marker-soft); border-color: var(--line); }
body.skin-sketch .cal .dow { color: var(--text); font-size: 14px; }
/* 목록 */
body.skin-sketch .tx { border-bottom: 1.5px dashed #b9b6ad; }
body.skin-sketch .tx:hover, body.skin-sketch .catrow:hover, body.skin-sketch .rank:hover { background: var(--marker-soft); }
body.skin-sketch .rank, body.skin-sketch .item-row, body.skin-sketch .budget-row, body.skin-sketch .rec, body.skin-sketch .kv { border-color: #b9b6ad; }
body.skin-sketch details.more > summary { color: var(--text); text-decoration: underline wavy var(--marker) 2px; text-underline-offset: 4px; }
/* 차트 */
body.skin-sketch .chart text { fill: var(--muted); font-family: "Gaegu", sans-serif; font-weight: 700; font-size: 13px; }
/* 하단 메뉴(휴대폰) */
body.skin-sketch .bottomnav { background: var(--card); border-top: var(--pen); }
body.skin-sketch .bottomnav a, body.skin-sketch .bottomnav button { color: var(--text); font-family: inherit; font-size: 12px; }
body.skin-sketch .bottomnav a.on { color: var(--text); text-decoration: underline 3px var(--marker); text-underline-offset: 3px; }
body.skin-sketch .bottomnav .fab span { background: var(--marker); color: var(--text); border: var(--pen); box-shadow: 2px 3px 0 var(--line); }
body.skin-sketch .bottomnav .fab { color: var(--text); }
body.skin-sketch #toast { background: var(--card); color: var(--text); border: var(--pen); box-shadow: 3px 4px 0 var(--line); }
body.skin-sketch #modeBanner .demo { background: #e5dbff; color: var(--text); border-bottom: var(--pen-thin); }
body.skin-sketch #modeBanner .demo button { border: var(--pen-thin); color: var(--text); }
body.skin-sketch .sync-badge { border: 1.5px solid var(--line); background: var(--card); font-family: inherit; }

/* 스킨 고르기 화면 */
.skin-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.skin-choice { text-align: left; padding: 12px; cursor: pointer; border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); font: inherit; }
.skin-choice.on { outline: 3px solid var(--primary); }
.skin-choice .prev { height: 92px; border-radius: 10px; margin-bottom: 8px; padding: 10px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.skin-choice .prev.basic { background: #f4f6fa; border: 1px solid #e3e7ef; }
.skin-choice .prev.basic span { display: block; background: #fff; border: 1px solid #e3e7ef; border-radius: 8px; height: 22px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.skin-choice .prev.sketch { background: #fbfaf6; border: 2.5px solid #1d1d1b; font-family: "Jua", "Gaegu", sans-serif; color: #1d1d1b; }
.skin-choice .prev.sketch b { font-size: 18px; font-weight: 400; background: linear-gradient(transparent 60%, var(--accent, #ffe066) 60%); align-self: flex-start; }
.accent-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.accent-choice { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); padding: 8px 10px; cursor: pointer; font: inherit; font-size: 14px; min-width: 64px; }
.accent-choice i { width: 34px; height: 22px; border-radius: 99px; border: 2px solid #1d1d1b; display: block; }
.accent-choice.on { outline: 3px solid var(--text); outline-offset: 1px; }
.skin-choice .prev.sketch span { display: block; border: 2px solid #1d1d1b; border-radius: 8px; height: 18px; background: #fff; }
/* 손글씨 글꼴은 같은 크기에서 작아 보여서 작은 글씨를 키운다 */
body.skin-sketch { font-size: 18px; }
body.skin-sketch .small, body.skin-sketch .muted.small { font-size: 15.5px; }
body.skin-sketch .stat .label { font-size: 16px; }
body.skin-sketch .stat .cmp { font-size: 15px; }
body.skin-sketch .tx .t1 { font-size: 18px; }
body.skin-sketch .tx .t2, body.skin-sketch .tx .amt .sub { font-size: 15px; }
body.skin-sketch .tx .date { font-size: 15px; }
body.skin-sketch .catrow .meta { font-size: 15px; }
body.skin-sketch .chip, body.skin-sketch .mchip, body.skin-sketch .badge, body.skin-sketch .pill, body.skin-sketch .unset { font-size: 14px; }
body.skin-sketch .field > span { font-size: 16px; }
body.skin-sketch .btn.sm, body.skin-sketch .tabs button, body.skin-sketch .viewbar button, body.skin-sketch .quick button { font-size: 16px; }
body.skin-sketch .day { font-size: 14.5px; }
body.skin-sketch .day .d { font-size: 15px; }
body.skin-sketch .legend { font-size: 15px; }
@media (max-width: 720px) {
  body.skin-sketch { font-size: 17px; }
  body.skin-sketch .day { font-size: 12px; }
  body.skin-sketch .day .d { font-size: 13px; }
  body.skin-sketch .stat .value { font-size: 23px; }
  body.skin-sketch .bottomnav a, body.skin-sketch .bottomnav button { font-size: 13px; }
}

/* =========================================================
   가독성 보강 (모든 스킨 공통 기본값 — 손그림 스킨은 자체 규칙이 우선)
   - 보조 글씨 최소 13px, 본문 16px, 숫자는 고정폭
   - 색 대비 WCAG AA(4.5:1) 이상
   ========================================================= */
.stat .label { font-size: 14px; }
.stat .cmp { font-size: 13.5px; line-height: 1.45; }
.stat .value { letter-spacing: -0.5px; overflow-wrap: normal; }
.stat { min-width: 0; overflow: hidden; }
.badge, .pill, .unset { font-size: 13px; }
.chip, .mchip { font-size: 13px; padding: 1px 8px; }
.tx { padding: 11px 6px; }
.tx .date { font-size: 13.5px; }
.tx .t1 { font-size: 16px; }
.tx .t2 { font-size: 14px; }
.tx .amt { font-size: 16px; }
.tx .amt .sub { font-size: 13px; }
.catrow .meta { font-size: 13.5px; }
.legend { font-size: 13.5px; }
.field > span { font-size: 14px; }
.btn.sm { font-size: 14px; min-height: 34px; }
.tabs button, .viewbar button { font-size: 14.5px; }
.quick button { font-size: 14px; padding: 4px 11px; }
.rec .when { font-size: 13.5px; }
.resultbar .fchip { font-size: 13.5px; }
.notice { font-size: 14.5px; line-height: 1.55; }
.dl dt { font-size: 14px; }
.day { font-size: 13px; }
.day .d { font-size: 13.5px; }
.perfbar .tick em { font-size: 12.5px; }
.sec-head .muted.small { line-height: 1.45; }
.monthbar .title { letter-spacing: -0.5px; }
/* 가족 이름표: 구성원 색을 진하게(밝은 화면) / 밝게(어두운 화면) 섞어 글자 대비 확보 */
.mchip { color: color-mix(in srgb, var(--mc) 62%, #000); background: color-mix(in srgb, var(--mc) 13%, transparent); }
.pill.done, .chip.income, .chip.refund { color: #0a6234; }
.pill.todo { color: #7f4300; }
.chip.transfer { color: #4a2fb0; }
.offline-badge { color: #7f4300; }
@media (prefers-color-scheme: dark) {
  .mchip { color: color-mix(in srgb, var(--mc) 50%, #fff); background: color-mix(in srgb, var(--mc) 22%, transparent); }
  .pill.done, .chip.income, .chip.refund { color: #7ee2ae; }
  .pill.todo, .offline-badge { color: #ffc46b; }
  .chip.transfer { color: #c9bcff; }
}
/* 키보드로 이동할 때 현재 위치가 잘 보이게 */
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
@media (max-width: 720px) {
  .tx .t1 { font-size: 15.5px; }
  .tx .t2 { font-size: 13.5px; }
  .stat .cmp { font-size: 13px; }
  .day { font-size: 11.5px; }
  .day .d { font-size: 12px; }
}

/* 손그림 스킨: 색 대비 보정 */
body.skin-sketch { --spend: #c4261d; --income: #17702f; --refund: #17702f; --primary: #1d4fc4; --transfer: #5236c2; --muted: #4d4d49; }
body.skin-sketch .mchip { color: color-mix(in srgb, var(--mc) 62%, #000); }
body.skin-sketch .pill.done, body.skin-sketch .chip.income, body.skin-sketch .chip.refund { color: #145226; }
/* 금액: 손글씨·주아 글꼴은 작은 크기에서 쉼표가 마침표처럼 보여(1,000 → 1.000) 쉼표가 분명한 글꼴 사용 */
body.skin-sketch .num { font-family: "Pretendard Variable", "Pretendard", "Malgun Gothic", sans-serif; font-weight: 700; letter-spacing: -0.3px; }
@media (max-width: 720px) {
  body.skin-sketch .day { font-size: 12.5px; }
}

/* 글자 크기 설정 (설정 › 화면) */
body.text-lg { zoom: 1.12; }
body.text-xl { zoom: 1.25; }
.cal .dow { font-size: 13px; }
.chart text { font-size: 12.5px; }
/* 글자를 크게 해도 버튼이 화면 밖으로 나가지 않게 */
.btn { max-width: 100%; white-space: normal; text-align: center; line-height: 1.3; }
.btn.sm, .iconbtn { white-space: nowrap; }

/* ---------- 자산·목표 (자산 · 머니 로드맵 · 머니 챌린지 · 연간 결산) ---------- */
:root { --k0: #2f6bed; --k1: #14a06a; --k2: #e0457b; --k3: #f0a020; --k4: #8a63d2; --k5: #0fa3b1; }
.stat.static { cursor: default; }
.stat.static:hover { border-color: var(--line); }
.money-tabs { margin-bottom: 14px; }
.stackbar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--soft); margin-bottom: 8px; }
.stackbar i { display: block; height: 100%; }
.asset-group .sec-head { margin-bottom: 6px; }
.asset-row { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.asset-row:first-of-type { border-top: 0; }
.asset-row.archived { opacity: .6; }
.asset-row .a-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.asset-row .a-side { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.asset-row .a-val { font-size: 18px; font-weight: 800; }
.asset-row .a-btns { display: flex; gap: 4px; }
.nwchart, .yearchart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; height: 170px; align-items: end; }
.nwchart .col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.nwchart .col i { display: block; width: 70%; background: var(--primary); border-radius: 5px 5px 0 0; }
.nwchart .col i.neg { background: var(--spend); }
.nwchart .v { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; max-width: 100%; }
.nwchart .m, .yearchart .m { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.yearchart .col { display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.yearchart .bars { flex: 1; width: 100%; display: flex; gap: 2px; align-items: flex-end; justify-content: center; }
.yearchart .bars i { display: block; width: 38%; border-radius: 4px 4px 0 0; min-height: 0; }
.yearchart .bars i.inc { background: var(--income); }
.yearchart .bars i.sp { background: var(--spend); }
.table-wrap { overflow-x: auto; margin-top: 12px; }
.ytable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ytable th, .ytable td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.ytable th:first-child, .ytable td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); }
.ytable th { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.ytable tr.total td { font-weight: 800; border-bottom: 0; }
.roadmap-year .ry { margin: 4px 0 8px; font-size: 15px; color: var(--muted); }
.goal { margin-bottom: 10px; }
.goal .bar { height: 12px; margin: 4px 0 6px; }
.goal.done { opacity: .75; }
.pledge { margin: 0 0 8px; font-weight: 700; color: var(--primary); }
.ch-cal .ch-day { border: 1px solid var(--line); border-radius: 8px; min-height: 46px; padding: 3px 5px; display: flex; flex-direction: column; font-size: 12px; }
.ch-cal .ch-day b { text-align: center; font-size: 15px; color: var(--muted); }
.ch-cal .ch-day.nospend { background: color-mix(in srgb, var(--income) 12%, transparent); border-color: color-mix(in srgb, var(--income) 40%, transparent); }
.ch-cal .ch-day.future { opacity: .55; }
.ch-cal .ch-day.today { outline: 2px solid var(--primary); }
.dash-challenge h2 { font-size: 17px; }
@media (max-width: 720px) {
  .asset-row { flex-direction: column; gap: 6px; }
  .asset-row .a-side { align-items: stretch; text-align: left; flex-direction: row; justify-content: space-between; width: 100%; }
  .nwchart, .yearchart { height: 140px; }
  .nwchart .v { display: none; }
}
body.skin-sketch .asset-row, body.skin-sketch .ytable th, body.skin-sketch .ytable td { border-color: #b9b6ad; }
body.skin-sketch .stackbar, body.skin-sketch .ch-cal .ch-day { border: var(--pen-thin); }
body.skin-sketch .pledge { color: var(--text); background: linear-gradient(transparent 60%, var(--marker) 60%); display: inline-block; }

/* ---------- 저축·투자·상환 · 머니보드 ---------- */
:root { --saving: #b8620a; }
@media (prefers-color-scheme: dark) { :root { --saving: #ffb35c; } }
.saving { color: var(--saving); }
.chip.saving { background: #fff1de; color: #8a4a00; }
@media (prefers-color-scheme: dark) { .chip.saving { background: #3d2b12; color: #ffc27a; } }
body.skin-sketch .chip.saving { background: #ffe8cc; color: #7a3e00; }
.cal .day .sv { font-size: 11px; color: var(--saving); font-weight: 700; white-space: nowrap; overflow: hidden; }
.moneyboard .mb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.moneyboard .mb-col { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.moneyboard .mb-head { display: flex; flex-direction: column; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 2px solid var(--line); }
.moneyboard .mb-head b { font-size: 21px; font-weight: 800; }
.moneyboard .mb-col .linkbtn { align-self: flex-start; margin-top: 4px; }
.moneyboard .mb-left { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--soft); }
.moneyboard .mb-left > b { font-size: 19px; margin-left: auto; }
.moneyboard .mb-left .small { flex-basis: 100%; text-align: right; }
@media (max-width: 720px) { .moneyboard .mb-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; } }

/* ---------- 생필품 ---------- */
.topnav { overflow-x: auto; scrollbar-width: none; }
.topnav a { white-space: nowrap; }
.badge.st-need { background: color-mix(in srgb, var(--spend) 15%, transparent); color: var(--spend); }
.badge.st-soon { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge.st-ok { background: color-mix(in srgb, var(--income) 14%, transparent); color: var(--income); }
.buylist .buy-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 0; border-top: 1px solid var(--line); }
.buylist .buy-row:first-of-type { border-top: 0; }
.buylist .buy-acts { display: flex; gap: 4px; margin-left: auto; }
.item-filter { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.item-filter .inline-new { max-width: 520px; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.item-card { display: flex; flex-direction: column; gap: 6px; }
.item-card.st-need { border-color: color-mix(in srgb, var(--spend) 45%, var(--line)); }
.item-card .ic-head { display: flex; align-items: center; gap: 6px; }
.item-card .ic-name { font-size: 17px; font-weight: 800; color: var(--text); }
.item-card .ic-head .right { margin-left: auto; }
.item-card .ic-sites { display: flex; flex-direction: column; gap: 4px; }
.item-card .site { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 14px; color: var(--text); text-decoration: none; }
.item-card a.site[href]:hover { border-color: var(--primary); }
.item-card .site.best { border-color: var(--income); background: color-mix(in srgb, var(--income) 7%, transparent); }
.item-card .ic-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.item-card .ic-foot .right { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.item-card .stock { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; }
.btn.on-buy { border-color: var(--spend); color: var(--spend); }
.site-edit { display: grid; grid-template-columns: 1fr 2fr 1fr 64px auto; gap: 6px; margin-bottom: 6px; }
.site-edit input { border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; min-width: 0; background: var(--card); }
@media (max-width: 720px) {
  .item-grid { grid-template-columns: minmax(0, 1fr); }
  .site-edit { grid-template-columns: 1fr 1fr auto; }
  .site-edit [data-f=url] { grid-column: 1 / -1; grid-row: 2; }
}
/* 더보기 메뉴 */
.more-menu { display: flex; flex-direction: column; gap: 8px; }
.more-link { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none; }
.more-link .mi { font-size: 22px; width: 32px; text-align: center; }
.more-link b { display: block; }

/* ---------- 부업 ---------- */
.gig-quick { display: flex; gap: 4px; flex-wrap: wrap; }
.timer-on { border-color: var(--spend); color: var(--spend); font-weight: 800; }
.gig-period .seg { flex: none; }
.gigchart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; height: 180px; align-items: end; }
.gigchart .col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.gigchart .stack { display: flex; flex-direction: column-reverse; width: 72%; border-radius: 4px 4px 0 0; overflow: hidden; min-height: 0; }
.gigchart .stack i { display: block; min-height: 1px; }
.gigchart .v { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.gigchart .m { font-size: 11px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.gigchart.month .m { font-size: 9.5px; }
.hbar { display: grid; grid-template-columns: 34px 1fr 130px; gap: 8px; align-items: center; padding: 4px 0; }
.hbar .k { font-weight: 700; font-size: 13.5px; }
.hbar .num { text-align: right; }
.settle-week { padding: 8px 0; border-top: 1px solid var(--line); }
.settle-week:first-of-type { border-top: 0; }
.settle-week .kv span:last-child { display: flex; gap: 6px; align-items: center; }
@media (max-width: 720px) {
  .gig-quick { width: 100%; }
  .gigchart.month .m { display: none; }
  .hbar { grid-template-columns: 30px 1fr 110px; }
  .settle-week .kv { flex-wrap: wrap; }
}
body.skin-sketch .item-card .site, body.skin-sketch .more-link { border: var(--pen-thin); }
@media (max-width: 720px) { .gig-period .seg { flex-basis: 100%; } }

/* ---------- 깔끔한 기본 스킨 다듬기 (2026.11) ---------- */
:root { --bg: #f2f4f7; --line: #e3e7ee; --radius: 18px; --shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 14px rgba(16,24,40,.04); }
@media (prefers-color-scheme: dark) { :root { --bg: #0f1318; --line: #2a323d; } }
body:not(.skin-sketch) .card, body:not(.skin-sketch) .stat { border-color: transparent; }
@media (prefers-color-scheme: dark) { body:not(.skin-sketch) .card, body:not(.skin-sketch) .stat { border-color: var(--line); } }
body:not(.skin-sketch) .stat:hover { border-color: var(--primary); }
body:not(.skin-sketch) .stat.static:hover { border-color: transparent; }
body:not(.skin-sketch) .sec-head h2 { font-size: 17px; letter-spacing: -0.2px; }
body:not(.skin-sketch) .topbar { border-bottom-color: transparent; box-shadow: 0 1px 0 var(--line); }
body:not(.skin-sketch) .btn { border-radius: 12px; }
body:not(.skin-sketch) .btn.sm { border-radius: 9px; }
.sec { margin-bottom: 18px; }
/* 하단 메뉴 아이콘 */
.bottomnav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 1px; }
.bottomnav a.on svg { stroke-width: 2.2; }
/* 한눈에 보기 */
.hero { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 24px; align-items: center; }
body.skin-sketch .hero { border: var(--pen); box-shadow: 3px 4px 0 var(--line); }
@media (prefers-color-scheme: dark) { body:not(.skin-sketch) .hero { border: 1px solid var(--line); } }
.hero-label { color: var(--muted); font-weight: 700; font-size: 14px; }
.hero-value { font-size: 34px; font-weight: 800; letter-spacing: -1px; line-height: 1.2; margin: 2px 0 8px; }
.hero-bar { height: 10px; max-width: 520px; }
.hero-sub { font-size: 14.5px; margin-top: 6px; }
.hero-mini { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.hero-mini b { color: var(--text); margin-left: 2px; }
.hero-mini b.income { color: var(--income); } .hero-mini b.saving { color: var(--saving); }
.hero-actions { display: grid; grid-template-columns: repeat(4, 72px); gap: 8px; }
.qa { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--text); padding: 4px 0; }
.qa .qi { width: 48px; height: 48px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; }
.qa:hover .qi { background: var(--primary); color: #fff; }
body.skin-sketch .qa .qi { border: var(--pen-thin); background: var(--marker-soft); color: var(--text); }
.hero-freq { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.chip-btn { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 5px 12px; cursor: pointer; font-size: 14px; font-weight: 600; }
.chip-btn:hover { border-color: var(--primary); color: var(--primary); }
.chip-btn .num { color: var(--muted); font-weight: 500; }
.dash-edit { text-align: center; margin: 8px 0 4px; }
@media (max-width: 720px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding: 18px 16px; }
  .hero-value { font-size: 30px; }
  .hero-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero-freq { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .chip-btn { white-space: nowrap; }
}
/* 입력 폼: 계산기 · 자주 쓰는 내역 */
.calc-row { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.calc-row button { width: 40px; height: 34px; border: 1px solid var(--line); background: var(--soft); border-radius: 9px; cursor: pointer; font-size: 17px; font-weight: 700; }
.calc-row .calc-preview { margin-left: auto; font-weight: 800; color: var(--primary); }
.quick.freq button { border-radius: 10px; padding: 5px 10px; }
/* 문자로 입력 */
#smsText { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card); font-size: 14px; resize: vertical; }
.sms-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.sms-row { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.sms-row.off { opacity: .55; }
.sms-row .sms-check input { width: 20px; height: 20px; margin-top: 6px; }
.sms-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sms-line1 { display: flex; gap: 8px; align-items: center; }
.sms-line1 input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 6px 9px; font-weight: 700; background: var(--card); }
.sms-line1 b { font-size: 17px; }
.sms-line2 { display: grid; grid-template-columns: 140px 1fr 1fr; gap: 6px; }
.sms-line2 input, .sms-line2 select { border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; min-width: 0; background: var(--card); }
@media (max-width: 720px) { .sms-line2 { grid-template-columns: 1fr 1fr; } .sms-line2 input[type=date] { grid-column: 1 / -1; } }
/* 통계 */
.donut-wrap { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; align-items: center; }
.donut { width: 180px; height: 180px; }
.donut .d1 { font-size: 10px; fill: var(--muted); font-weight: 600; }
.donut .d2 { font-size: 15px; fill: var(--text); font-weight: 800; }
.insight-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.trend { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; height: 200px; align-items: end; }
.trend .col { display: flex; flex-direction: column; align-items: center; height: 100%; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit; min-width: 0; }
.trend .bars { flex: 1; width: 100%; display: flex; gap: 3px; align-items: flex-end; justify-content: center; }
.trend .bars i { display: block; width: 22%; max-width: 18px; border-radius: 5px 5px 0 0; }
.trend .bars i.inc { background: var(--income); } .trend .bars i.sp { background: var(--spend); } .trend .bars i.sv { background: var(--saving); }
.trend .m { font-size: 12.5px; color: var(--muted); margin-top: 4px; font-weight: 600; }
.trend .m.on { color: var(--primary); font-weight: 800; }
.trend .v { font-size: 11.5px; color: var(--muted); }
.hbar.wide { grid-template-columns: 96px 1fr 110px; }
.hbar.wide .k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) { .donut-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; } .donut-legend { width: 100%; } .trend { height: 160px; } }
/* 앱 잠금 */
#lockScreen { position: fixed; inset: 0; z-index: 1000; background: var(--bg); display: flex; align-items: center; justify-content: center; outline: none; }
body.is-locked > :not(#lockScreen) { visibility: hidden; }
.lock-box { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lock-title { font-size: 22px; font-weight: 800; }
.lock-dots { display: flex; gap: 14px; margin: 14px 0 4px; }
.lock-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--primary); }
.lock-dots i.on { background: var(--primary); }
.lock-err { min-height: 20px; }
.lock-pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px; }
.lock-pad button { height: 64px; border-radius: 50%; border: 0; background: var(--card); box-shadow: var(--shadow); font-size: 24px; font-weight: 700; cursor: pointer; }
.lock-pad button:active { background: var(--primary-soft); }
.hero-freq > .small { flex: none; white-space: nowrap; }
.title-pick { border: 0; background: none; cursor: pointer; padding: 0; color: inherit; font: inherit; }
.title-pick:hover { color: var(--primary); }
@media (max-width: 720px) {
  .monthbar input[type=month] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
  .monthbar .title-pick::after { content: ' ▾'; font-size: 14px; color: var(--muted); }
}
.qa .qi svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 카드 등록 · 카드값 ---------- */
#ciText { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card); font-size: 14px; resize: vertical; }
.ci-rows { display: flex; flex-direction: column; gap: 6px; }
.ci-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 76px 96px 90px; gap: 6px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 12px; }
.ci-row.off { opacity: .5; }
.ci-row input[type=checkbox] { width: 18px; height: 18px; }
.ci-row input[data-ci=name], .ci-row select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; min-width: 0; background: var(--card); }
.ci-row .ci-note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) { .ci-row { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr); } .ci-row input[data-ci=name] { grid-column: 2 / -1; } .ci-row select[data-ci=kind] { grid-column: 2; } .ci-row .ci-note { grid-column: 2 / -1; } }
.card-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); background: none; padding: 10px 2px; cursor: pointer; color: inherit; font: inherit; }
.card-row:first-of-type { border-top: 0; }
.card-row:hover b { color: var(--primary); }
.card-row.zero { opacity: .6; }
.card-row .cr-chip { flex: none; width: 34px; height: 46px; border-radius: 6px; display: flex; align-items: flex-end; justify-content: center; font-size: 10.5px; font-weight: 800; padding-bottom: 4px;
  background: linear-gradient(160deg, var(--primary-soft), color-mix(in srgb, var(--primary) 35%, var(--card))); color: var(--primary); }
.card-row .cr-chip.check { background: linear-gradient(160deg, color-mix(in srgb, var(--income) 14%, var(--card)), color-mix(in srgb, var(--income) 35%, var(--card))); color: var(--income); }
.card-row .cr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card-row .cr-body b { font-size: 17px; }
.card-row .cr-body .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.idle summary { cursor: pointer; padding: 8px 0 2px; }
.cards-hero .hero-mini .mchip { margin-right: 4px; }
.af-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; cursor: pointer; }
.af-row input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.af-row.unknown { opacity: .8; border-style: dashed; }
.af-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.af-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.af-memo { color: var(--text); line-height: 1.5; }
.warn-text { color: var(--warn); font-weight: 600; }
.card-row .cr-memo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.excel-tips { margin: 4px 0 10px; padding-left: 18px; }
.excel-tips li { margin: 2px 0; }
.excel-tips code, .excel-box code { background: var(--soft); padding: 0 5px; border-radius: 5px; font-size: 13px; }
.import-table td label { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.sync-badge.err { color: var(--spend); }
.gs-steps ol { padding-left: 20px; margin: 0 0 12px; }
.gs-steps li { margin-bottom: 10px; line-height: 1.6; }
#gsCode { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--soft); }

/* =========================================================
   손그림 노트 — 읽기 쉬운 글꼴 (기본)
   본문·숫자·버튼은 또렷한 고딕(Pretendard), 제목·큰 금액만 둥근 손글씨(주아).
   펜 테두리·형광펜 같은 '노트' 느낌은 그대로 두고 글씨만 읽기 쉽게.
   설정 › 화면에서 '손글씨'를 고르면 예전처럼 본문까지 손글씨(body.sketch-hand).
   ========================================================= */
body.skin-sketch:not(.sketch-hand) {
  --num: "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --muted: #4a4944;
  font-family: var(--num); font-size: 16px; font-weight: 500; letter-spacing: -0.2px; line-height: 1.6;
}
body.skin-sketch:not(.sketch-hand) .num { font-variant-numeric: tabular-nums; }
body.skin-sketch:not(.sketch-hand) h1, body.skin-sketch:not(.sketch-hand) h2, body.skin-sketch:not(.sketch-hand) h3,
body.skin-sketch:not(.sketch-hand) .brand, body.skin-sketch:not(.sketch-hand) .monthbar .title,
body.skin-sketch:not(.sketch-hand) .stat .value, body.skin-sketch:not(.sketch-hand) .hero-value, body.skin-sketch:not(.sketch-hand) .detail-amount,
body.skin-sketch:not(.sketch-hand) .perf-main .value, body.skin-sketch:not(.sketch-hand) .welcome h1, body.skin-sketch:not(.sketch-hand) .mb-head b,
body.skin-sketch:not(.sketch-hand) .ic-name, body.skin-sketch:not(.sketch-hand) .a-val {
  font-family: "Jua", "Pretendard Variable", "Pretendard", "Malgun Gothic", sans-serif; font-weight: 400; letter-spacing: 0;
}
body.skin-sketch:not(.sketch-hand) h2 { font-size: 21px; }
body.skin-sketch:not(.sketch-hand) h3 { font-size: 17.5px; }
/* 글씨 크기: 기본 스킨과 같은 단계로 (손글씨용으로 키웠던 값 되돌림) */
body.skin-sketch:not(.sketch-hand) .small, body.skin-sketch:not(.sketch-hand) .muted.small { font-size: 14px; }
body.skin-sketch:not(.sketch-hand) .stat .label { font-size: 14px; font-weight: 600; }
body.skin-sketch:not(.sketch-hand) .stat .cmp { font-size: 13.5px; }
body.skin-sketch:not(.sketch-hand) .tx .t1 { font-size: 16px; font-weight: 600; }
body.skin-sketch:not(.sketch-hand) .tx .t2, body.skin-sketch:not(.sketch-hand) .tx .amt .sub, body.skin-sketch:not(.sketch-hand) .tx .date { font-size: 13.5px; }
body.skin-sketch:not(.sketch-hand) .tx .amt .num { font-weight: 700; }
body.skin-sketch:not(.sketch-hand) .catrow .meta, body.skin-sketch:not(.sketch-hand) .legend { font-size: 13.5px; }
body.skin-sketch:not(.sketch-hand) .chip, body.skin-sketch:not(.sketch-hand) .mchip, body.skin-sketch:not(.sketch-hand) .badge,
body.skin-sketch:not(.sketch-hand) .pill, body.skin-sketch:not(.sketch-hand) .unset { font-size: 12.5px; font-weight: 700; }
body.skin-sketch:not(.sketch-hand) .field > span { font-size: 13.5px; font-weight: 600; }
body.skin-sketch:not(.sketch-hand) .btn, body.skin-sketch:not(.sketch-hand) .tabs button, body.skin-sketch:not(.sketch-hand) .viewbar button,
body.skin-sketch:not(.sketch-hand) .quick button, body.skin-sketch:not(.sketch-hand) .seg button, body.skin-sketch:not(.sketch-hand) .side-tabs button,
body.skin-sketch:not(.sketch-hand) .topnav a, body.skin-sketch:not(.sketch-hand) .chip-btn, body.skin-sketch:not(.sketch-hand) .qa { font-weight: 700; letter-spacing: -0.2px; }
body.skin-sketch:not(.sketch-hand) .btn.sm, body.skin-sketch:not(.sketch-hand) .tabs button, body.skin-sketch:not(.sketch-hand) .viewbar button,
body.skin-sketch:not(.sketch-hand) .quick button { font-size: 14px; }
body.skin-sketch:not(.sketch-hand) .day { font-size: 12.5px; }
body.skin-sketch:not(.sketch-hand) .day .d { font-size: 13px; font-weight: 700; }
body.skin-sketch:not(.sketch-hand) .bottomnav a, body.skin-sketch:not(.sketch-hand) .bottomnav button { font-size: 12px; font-weight: 700; }
body.skin-sketch:not(.sketch-hand) .chart text { font-family: var(--num); font-weight: 600; font-size: 12px; }
body.skin-sketch:not(.sketch-hand) .stat .value { font-size: 26px; }
body.skin-sketch:not(.sketch-hand) .hero-value { font-size: 34px; }
/* 구분선은 조금 옅게, 보조 글씨는 더 진하게 */
body.skin-sketch:not(.sketch-hand) .tx { border-bottom-color: #d6d3c9; }
body.skin-sketch:not(.sketch-hand) .kv, body.skin-sketch:not(.sketch-hand) .item-row, body.skin-sketch:not(.sketch-hand) .rank { border-color: #d6d3c9; }
body.skin-sketch:not(.sketch-hand) input, body.skin-sketch:not(.sketch-hand) select, body.skin-sketch:not(.sketch-hand) textarea { font-family: var(--num); font-weight: 500; }
@media (max-width: 720px) {
  body.skin-sketch:not(.sketch-hand) { font-size: 15.5px; }
  body.skin-sketch:not(.sketch-hand) .stat .value { font-size: 21px; }
  body.skin-sketch:not(.sketch-hand) .hero-value { font-size: 30px; }
  body.skin-sketch:not(.sketch-hand) .day { font-size: 11px; }
  body.skin-sketch:not(.sketch-hand) .day .d { font-size: 12px; }
}
.rec-group { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; cursor: pointer; line-height: 1.7; }
.rec-group input { width: 18px; height: 18px; margin-top: 4px; flex: none; }
.rec-group.done { opacity: .6; cursor: default; }
body.skin-sketch .rec-group { border: var(--pen-thin); }

/* 대시보드 카드 실적: 한 줄 요약 + 눌러서 펼치기 */
.perf-list { display: flex; flex-direction: column; gap: 6px; }
.perf-row { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.perf-row.open { border-color: var(--primary); }
.perf-sum { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) auto auto 14px; gap: 10px; align-items: center; width: 100%; padding: 9px 12px; background: none; border: 0; cursor: pointer; text-align: left; color: inherit; font: inherit; }
.perf-sum:hover { background: var(--soft); }
.ps-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-bar { position: relative; height: 8px; background: var(--soft); border-radius: 99px; }
.ps-bar i { display: block; height: 100%; border-radius: 99px; background: var(--warn); }
.perf-row.ok .ps-bar i { background: var(--income); }
.ps-bar em { position: absolute; top: -2px; width: 2px; height: 12px; background: var(--muted); opacity: .6; }
.ps-val { font-weight: 800; font-size: 14.5px; }
.ps-val .muted { font-weight: 500; font-size: 12.5px; }
.ps-arrow { color: var(--muted); font-size: 12px; }
.perf-row .perf { border: 0; border-top: 1px dashed var(--line); border-radius: 0; }
.perf-unset { margin-top: 8px; }
.perf-unset summary { cursor: pointer; }
@media (max-width: 720px) {
  .perf-sum { grid-template-columns: minmax(0, 1fr) auto auto 12px; row-gap: 6px; }
  .ps-bar { grid-column: 1 / -1; grid-row: 2; }
}
body.skin-sketch .perf-row { border: var(--pen-thin); }
body.skin-sketch .perf-row.open { background: var(--marker-soft); }
body.skin-sketch .ps-bar { border: 1.5px solid var(--line); background: var(--card); height: 10px; }
.ps-name { display: flex; align-items: center; gap: 4px; }
.ps-name .mchip { flex: none; margin-right: 0; }
.ps-name b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  .perf-sum { grid-template-columns: minmax(0, 1fr) auto auto 12px; row-gap: 6px; }
  .perf-sum .ps-name { grid-column: 1 / 4; grid-row: 1; }
  .perf-sum .ps-arrow { grid-column: 4; grid-row: 1; }
  .perf-sum .ps-bar { grid-column: 1; grid-row: 2; }
  .perf-sum .ps-val { grid-column: 2; grid-row: 2; }
  .perf-sum .pill { grid-column: 3 / 5; grid-row: 2; justify-self: end; }
}
