/* ============================================================
   돈봉투 가계부 — 화면 스타일
   · 따뜻한 종이 바탕(#FAF8F3) 위에 흰 종이(#FFFFFF) 한 장.
   · 선은 1px 헤어라인, 그림자는 팝오버에만. 그라데이션 없음.
   · 포인트는 딥 슬레이트 그린 한 색. 넘친 금액만 벽돌색.
   · 숫자는 tabular-nums, 큰 금액은 크게·보조는 한 톤 낮게.
   · 외부 폰트·CDN 없음. 시스템 폰트와 인라인 SVG만 쓴다.
   ============================================================ */

/* 손글씨 — 나눔손글씨 펜(OFL). 외부 CDN 없이 로컬 서브셋만 불러온다. */
@font-face {
  font-family: 'Nanum Pen Script';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/nanum-pen-subset.woff2') format('woff2');
}

:root {
  --paper: #faf8f3;
  --paper-2: #f2eee4;
  --surface: #ffffff;
  --ink: #201e1a;
  --ink-2: #4c483f;
  --ink-3: #6b6459;
  --ink-4: #8d877c;
  --line: #e7e1d4;
  --line-2: #f0ebdf;
  --line-strong: #d8d1c1;
  --accent: #2f4f4f;
  --accent-deep: #24403f;
  --accent-tint: #edf2f0;
  --over: #b2453a;
  --over-tint: #f9ecea;
  --warn: #9a6b2f;
  --warn-tint: #f8f1e3;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-pop: 0 22px 48px -24px rgba(32, 30, 26, 0.35), 0 2px 6px rgba(32, 30, 26, 0.06);
  --shell: 920px;
  --header-h: 62px;
  --tabbar-h: 58px;
  /* 손글씨는 제목·브랜드 같은 포인트에만. 금액·표·입력칸은 고딕 고정. */
  --font-hand: 'Nanum Pen Script', 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Noto Sans CJK KR', 'Malgun Gothic', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.012em;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, p, ul, ol, figure, details { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
img, svg { display: block; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon { flex: none; }

.num, .tabular { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.neg { color: var(--over); }
.pos { color: var(--ink); }
.muted { color: var(--ink-3); }

/* ------------------------------------------------------------ 머리 */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250, 248, 243, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.topbar__in {
  max-width: var(--shell);
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 30px;
}

.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; flex: none; }
.brand__mark { color: var(--accent); margin-top: -1px; }
.brand__name {
  font-family: var(--font-hand);
  font-size: 21px; font-weight: 400; letter-spacing: 0.005em; line-height: 1;
}

.tabs { display: flex; align-items: center; gap: 1px; }
.tabs button {
  position: relative;
  border: 0; background: none;
  padding: 9px 12px 10px;
  font-size: 14px; font-weight: 500; color: var(--ink-3);
  border-radius: 8px;
  transition: color 0.14s ease;
}
.tabs button:hover { color: var(--ink); }
.tabs button.is-active { color: var(--ink); font-weight: 600; }
.tabs button.is-active::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 3px;
  height: 1.5px; background: var(--ink); border-radius: 2px;
}

.monthnav { margin-left: auto; display: flex; align-items: center; gap: 1px; flex: none; }
.monthnav__arrow {
  border: 0; background: none; width: 28px; height: 30px;
  display: grid; place-items: center; border-radius: 7px; color: var(--ink-3);
}
.monthnav__arrow:hover { background: var(--paper-2); color: var(--ink); }
.monthnav__center { position: relative; }
.monthnav__label {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; background: none; border-radius: 7px;
  padding: 5px 7px; font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
.monthnav__label:hover { background: var(--paper-2); color: var(--ink); }
.monthnav__label svg { color: var(--ink-4); }
.monthnav__today {
  border: 0; background: none; color: var(--accent);
  font-size: 12px; font-weight: 500; padding: 5px 7px; border-radius: 6px;
}
.monthnav__today:hover { background: var(--accent-tint); }

.month-menu {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: 216px; padding: 5px; z-index: 45;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-pop);
}
.month-menu__item {
  display: flex; flex-direction: column; gap: 1px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 7px; background: none; text-align: left;
}
.month-menu__item span { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.month-menu__item em { font-style: normal; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.month-menu__item:hover { background: var(--paper); }
.month-menu__item.is-active { background: var(--accent-tint); }
.month-menu__item.is-active span { color: var(--accent-deep); }

.main {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 38px 24px 130px;
}

.view { animation: fade 0.18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.tabbar { display: none; }

/* ------------------------------------------------------------ 공통 조각 */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
}
.card + .card { margin-top: 16px; }

.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.card__head > div { min-width: 0; }
.card__head .ghost-btn, .card__head .primary-btn { flex: none; white-space: nowrap; }
.card__head h2, .card__head h3 { font-size: 15.5px; font-weight: 600; letter-spacing: -0.02em; }
.card__head p { margin-top: 4px; color: var(--ink-3); font-size: 12.5px; line-height: 1.6; max-width: 560px; }

.page-lead {
  margin: 0 0 18px; color: var(--ink-3); font-size: 13px; line-height: 1.6;
}
.page-title { font-size: 23px; font-weight: 600; letter-spacing: -0.035em; margin-bottom: 5px; }
.page-title + .page-lead { margin-bottom: 18px; }
.page-lead b { color: var(--ink-2); font-weight: 600; }
.page-lead .count-pill { vertical-align: 1px; }

.primary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 15px; border: 1px solid var(--ink); border-radius: 9px;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 500;
  letter-spacing: -0.01em;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.primary-btn:hover { background: #35322b; border-color: #35322b; }
.primary-btn:active { transform: translateY(1px); }
.primary-btn:disabled { background: var(--paper-2); border-color: var(--line); color: var(--ink-4); cursor: not-allowed; }
.primary-btn--sm { padding: 7px 12px; font-size: 12.5px; border-radius: 8px; }

.ghost-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 13px; border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-weight: 500;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.ghost-btn:hover { background: var(--paper); border-color: #c7bfae; }
.ghost-btn--sm { padding: 6px 10px; font-size: 12px; border-radius: 7px; }

.danger-btn, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 13px; border: 1px solid #edcfc9; border-radius: 9px;
  background: var(--surface); color: var(--over); font-size: 12.5px; font-weight: 500;
}
.danger-btn:hover, .btn-danger:hover { background: var(--over-tint); }
.btn-danger { background: var(--over); border-color: var(--over); color: #fff; }
.btn-danger:hover { background: #9d3a30; }

.btn-ok {
  display: inline-flex; padding: 9px 14px; border-radius: 9px; border: 1px solid var(--ink);
  background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 500;
}

.icon-btn {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border: 0; border-radius: 7px;
  background: none; color: var(--ink-4);
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink-2); }

/* 배지·칩은 알약이 아니라 작은 글씨로만 쓴다 */
.chip, .badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 0; border-radius: 0; background: none;
  color: var(--ink-4); font-size: 11px; font-weight: 500; letter-spacing: 0;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.chip--up { color: var(--over); }
.chip--auto, .chip--learn, .chip--manual { color: var(--ink-3); }
.chip--un { color: var(--warn); }
.chip--dup, .chip--warn, .chip--fixed { color: var(--ink-4); }
.badge--ok, .badge--idle, .badge--warn, .badge--over { color: var(--ink-4); }
.chip + .chip::before { content: '·'; margin-right: 4px; color: var(--line-strong); }

.dot { width: 8px; height: 8px; border-radius: 3px; background: var(--dot, #cfc8b9); flex: none; display: inline-block; }
.dot-inline { width: 7px; height: 7px; border-radius: 2px; background: var(--dot, #cfc8b9); display: inline-block; flex: none; }

.count-pill {
  display: inline-grid; place-items: center; min-width: 20px; height: 19px; padding: 0 6px;
  border-radius: 999px; background: var(--paper-2); color: var(--ink-3);
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}

.segmented { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--paper-2); }
.segmented button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.segmented button.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(32, 30, 26, 0.08); }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.field input, .field select {
  height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); font-size: 13.5px; min-width: 0;
}
.field input::placeholder { color: var(--ink-4); }
.field input:focus, .field select:focus, .paste:focus, .search:focus-within,
.money-field input:focus, .kw-add input:focus, .rule-test__form input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 79, 79, 0.1);
}
.field--wide { grid-column: span 2; }

.select {
  height: 32px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--surface); font-size: 12.5px; max-width: 100%; color: var(--ink-2);
}
.select--cat { width: 100%; min-width: 84px; }

.money-field { position: relative; display: flex; align-items: center; }
.money-field input {
  width: 100%; height: 32px; padding: 0 22px 0 9px; text-align: right;
  border: 1px solid var(--line); border-radius: 7px; background: var(--surface);
  font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 500;
}
.money-field span { position: absolute; right: 8px; font-size: 11px; color: var(--ink-4); pointer-events: none; }
.money-field--lg input { height: 46px; font-size: 19px; padding-right: 30px; letter-spacing: -0.02em; }
.money-field--lg span { font-size: 12px; right: 12px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.switch-row:last-of-type { border-bottom: 0; }
.switch-row__text { display: flex; flex-direction: column; gap: 2px; }
.switch-row__text strong { font-size: 13.5px; font-weight: 500; }
.switch-row__text small { color: var(--ink-3); font-size: 11.5px; }
.switch { position: relative; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch__track { display: block; width: 38px; height: 22px; border-radius: 999px; background: #ddd6c8; transition: background 0.18s ease; pointer-events: none; }
.switch__thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(32, 30, 26, 0.18); transition: transform 0.18s ease; pointer-events: none; }
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid rgba(47, 79, 79, 0.3); outline-offset: 2px; }

.empty { padding: 40px 16px; text-align: center; color: var(--ink-3); }
.empty__icon { width: 40px; height: 40px; margin: 0 auto 10px; border-radius: 10px; display: grid; place-items: center; background: var(--paper); color: var(--ink-3); }
.empty h3 { color: var(--ink); font-size: 14px; font-weight: 600; margin-bottom: 5px; letter-spacing: -0.02em; }
.empty p { font-size: 12.5px; max-width: 400px; margin: 0 auto 14px; line-height: 1.6; }

/* ------------------------------------------------------------ 이번 달 */

.month { display: flex; flex-direction: column; }

.balance {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 30px;
  padding: 4px 2px 20px;
}
.balance__text { min-width: 0; }
.balance__label {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; padding: 0; text-align: left;
  font-family: var(--font-hand); font-size: 18px; line-height: 1.35; color: var(--ink-3);
}
.balance__label:hover { color: var(--ink-2); }
.balance__info {
  display: inline-grid; place-items: center; flex: none;
  width: 15px; height: 15px; border-radius: 50%;
  border: 1px solid var(--line-strong); color: var(--ink-4);
  font-family: 'Pretendard', system-ui, sans-serif; font-size: 9px; font-weight: 600; line-height: 1;
}
.balance__amount {
  margin-top: 7px;
  font-size: 46px; font-weight: 600; letter-spacing: -0.05em; line-height: 1.02;
  font-variant-numeric: tabular-nums;
}
.balance__amount span { font-size: 21px; font-weight: 500; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.balance__sub { margin-top: 9px; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.balance__gauge {
  margin-top: 15px; width: min(420px, 100%); height: 4px; border-radius: 2px;
  background: var(--paper-2); overflow: hidden;
}
.balance__gauge i { display: block; height: 100%; border-radius: 2px; background: var(--accent); transition: width 0.4s ease; }
.balance.is-over .balance__amount { color: var(--over); }
.balance.is-over .balance__gauge i { background: var(--over); }
.balance__included { margin-top: 8px; }
.balance__included button {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border: 0; border-radius: 999px;
  background: var(--warn-tint); color: var(--warn);
  font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.balance__included button:hover { background: #f3e8d2; }
.balance__included em { font-style: normal; text-decoration: underline; text-underline-offset: 2px; }
.balldiff {
  margin-top: 10px; padding: 9px 11px; border-radius: 9px;
  background: var(--warn-tint); color: var(--ink-2); font-size: 12.5px; line-height: 1.6;
}

/* 첫 방문 — 예시 장부임을 알리고 내 장부로 시작하게 한다 */
.samplebar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin: 0 0 20px; padding: 12px 14px;
  border: 1px solid #e6d9bd; border-radius: 12px; background: #fbf6ea;
}
.samplebar__body { display: flex; flex-direction: column; gap: 2px; flex: 1 1 240px; min-width: 0; }
.samplebar__tag {
  align-self: flex-start; padding: 2px 8px; border-radius: 999px;
  background: #f0e2c4; color: #6f5524; font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em;
}
.samplebar__body p { font-size: 12px; color: var(--ink-3); line-height: 1.55; overflow-wrap: anywhere; }
.samplebar__acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: none; }
.samplebar__dismiss {
  border: 0; background: none; padding: 6px 2px; font-size: 11.5px; color: var(--ink-4);
  text-decoration: underline; text-underline-offset: 2px;
}
.samplebar__dismiss:hover { color: var(--ink-2); }

.who { display: flex; flex: none; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); margin-top: 4px; }
.who button {
  border: 0; background: none; padding: 6px 12px; border-radius: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-3); white-space: nowrap;
}
.who button:hover { color: var(--ink); }
.who button.is-on { background: var(--ink); color: #fff; font-weight: 600; }

.tidy { margin: -2px 0 30px; padding: 0 2px; font-size: 13px; }
.tidy button {
  border: 0; background: none; padding: 0 0 1px; color: var(--accent);
  font-size: 13px; font-weight: 500;
  border-bottom: 1px solid rgba(47, 79, 79, 0.28);
}
.tidy button:hover { border-bottom-color: var(--accent); }

.sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 26px 14px;
}

.bhead {
  display: grid; grid-template-columns: minmax(0, 1fr) 112px 112px; gap: 12px;
  padding: 2px 2px 9px; border-bottom: 1px solid var(--line-2);
  font-size: 11.5px; color: var(--ink-4);
}
.bhead span:nth-child(2), .bhead span:nth-child(3) { text-align: right; }

.brow {
  display: grid; grid-template-columns: minmax(0, 1fr) 112px 112px; gap: 12px;
  width: 100%; padding: 13px 2px 8px;
  border: 0; background: none; text-align: left; border-radius: 8px;
  transition: background 0.12s ease;
}
.brow:hover { background: var(--paper); }
.brow__name { font-size: 14.5px; font-weight: 500; letter-spacing: -0.015em; align-self: center; }
.brow__annual { font-style: normal; margin-left: 7px; font-size: 10.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.brow__spent { text-align: right; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; align-self: center; }
.brow__left { text-align: right; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; align-self: center; }
.brow__left.is-neg { color: var(--over); }
.brow__bar {
  grid-column: 1 / -1; height: 3px; border-radius: 2px; margin-top: 7px;
  background: var(--line-2); overflow: hidden;
}
.brow__bar i { display: block; height: 100%; border-radius: 2px; background: #cec6b6; }
.brow.is-over .brow__bar i { background: var(--over); }

.sheet__foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  margin-top: 6px; padding: 11px 2px 4px; border-top: 1px solid var(--line-2);
  font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.sheet__foot b { color: var(--ink-2); font-weight: 600; }

.panels {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px; margin-top: 44px;
}
.panel { min-width: 0; }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.panel__head h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.panel__meta { font-size: 12px; color: var(--ink-4); }
.panel__note { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; margin: -2px 0 8px; }

.moves li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--line-2);
  font-size: 13.5px;
}
.moves b { font-variant-numeric: tabular-nums; font-weight: 600; }
.moves .up { color: var(--over); }
.moves .down { color: var(--ink-2); }
.moves .move-label { color: var(--ink-4); font-size: 11.5px; margin-left: 6px; }
.panel .warn-line { margin-top: 10px; font-size: 12px; color: var(--warn); }
.panel .btn-row { margin-top: 16px; }
.panel .quiet { font-size: 13px; color: var(--ink-3); padding: 4px 0 6px; }

.recent li {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: baseline;
  padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px;
}
.recent__date { color: var(--ink-4); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.recent li.recent__empty { display: block; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-3); }
.recent__merchant { overflow-wrap: anywhere; color: var(--ink-2); }
.recent__amount { font-variant-numeric: tabular-nums; color: var(--ink-2); text-align: right; }
.recent__amount.neg { color: var(--over); }
.linkbtn { border: 0; background: none; padding: 12px 0 0; font-size: 12.5px; color: var(--ink-3); }
.linkbtn:hover { color: var(--ink); }

.coach { margin-top: 44px; border-top: 1px solid var(--line); padding-top: 16px; }
.coach > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; color: var(--ink-2); font-weight: 500;
}
.coach > summary::-webkit-details-marker { display: none; }
.coach > summary::before { content: '+'; width: 13px; font-size: 15px; color: var(--ink-4); font-weight: 400; }
.coach[open] > summary::before { content: '−'; }
.coach > summary em { font-style: normal; font-size: 12px; color: var(--ink-4); }
.coach__note { font-size: 12.5px; color: var(--ink-3); margin: 10px 0 2px; }
.coach__list { margin-top: 4px; }
.pick {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  width: 100%; padding: 11px 2px; border: 0; border-bottom: 1px solid var(--line-2);
  background: none; text-align: left;
}
.pick:hover { background: var(--paper); }
.pick__mark {
  width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--ink-4);
  display: grid; place-items: center; color: #fff; flex: none;
}
.pick.is-on .pick__mark { background: var(--accent); border-color: var(--accent); }
.pick__body { min-width: 0; }
.pick__top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pick__name { font-size: 13.5px; font-weight: 500; }
.pick__meta { font-size: 11.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.pick__tip { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); line-height: 1.55; }
.pick__est { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.coach__picked { padding: 12px 2px 2px; font-size: 12.5px; color: var(--ink-2); }
.coach__picked b { font-weight: 600; }
.coach__empty { font-size: 12.5px; color: var(--ink-3); padding: 10px 2px 2px; }

/* ------------------------------------------------------------ 넘친 봉투 · 마감 */

.cover-line { margin: 14px 0 0; padding: 0 2px; }
.cover-line button {
  border: 0; background: none; padding: 0 0 1px; color: var(--over);
  font-size: 12.5px; font-weight: 500; border-bottom: 1px solid rgba(178, 69, 58, 0.28);
}
.cover-line button:hover { border-bottom-color: var(--over); }

.closing { margin-top: 44px; border-top: 1px solid var(--line); padding-top: 18px; }
.closing__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.closing__title { font-family: var(--font-hand); font-size: 23px; font-weight: 400; line-height: 1.2; }
.closing__state { font-size: 11.5px; color: var(--ink-3); }
.closing__list { display: flex; flex-direction: column; }
.closing__step {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--line-2);
}
.closing__step:last-child { border-bottom: 0; }
.closing__num { font-family: var(--font-hand); font-size: 19px; color: var(--accent); line-height: 1.25; }
.closing__step.is-done .closing__num { color: var(--ink-4); }
.closing__body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.closing__body b { font-size: 13.5px; font-weight: 500; }
.closing__step.is-done .closing__body b { color: var(--ink-3); }
.closing__body small { font-size: 11px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.closing__act button {
  border: 0; background: none; padding: 4px 2px; color: var(--accent);
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.closing__act button:hover { text-decoration: underline; }
.closing__ok { display: inline-grid; place-items: center; width: 20px; height: 20px; color: var(--accent); }
.closing__help { margin-top: 12px; }
.closing__help button { border: 0; background: none; padding: 2px 0; font-size: 11.5px; color: var(--ink-4); }
.closing__help button:hover { color: var(--ink); }

@media (max-height: 880px) {
  .quick__paste { min-height: 96px; }
  .quick { gap: 12px; }
}

/* ------------------------------------------------------------ 사용법 */

.guide { max-width: 660px; margin: 0 auto; }
.guide__head { padding: 6px 0 26px; border-bottom: 1px solid var(--line); }
.guide__eyebrow { font-size: 11.5px; letter-spacing: 0.06em; color: var(--ink-4); }
.guide__title {
  font-family: var(--font-hand); font-size: 40px; font-weight: 400;
  line-height: 1.3; letter-spacing: 0.005em; margin: 8px 0 14px; color: var(--ink);
}
.guide__lead { font-size: 15px; line-height: 1.9; color: var(--ink-2); }
.guide__lead b { color: var(--ink); font-weight: 600; }

/* 사용법 상단 — 슬로건과 4칸 요약(처음 보는 사람이 차이를 바로 알도록) */
.guide__head--hero { padding-bottom: 0; border-bottom: 0; }
.hero {
  margin-top: 10px; padding: 18px 18px 15px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
}
.hero__brand { font-family: var(--font-hand); font-size: 34px; line-height: 1.15; letter-spacing: 0.005em; }
.hero__sub { margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.hero__slogan {
  margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line-2);
  font-size: 20px; font-weight: 700; line-height: 1.45; letter-spacing: -0.03em; color: var(--ink);
}
.hero__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.hero__cell { min-width: 0; padding: 12px 12px 11px; background: var(--paper); border-radius: 12px; }
.hero__ico { display: block; color: var(--accent); margin-bottom: 7px; }
.hero__cell b { display: block; font-size: 13.5px; font-weight: 600; letter-spacing: -0.02em; }
.hero__desc { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.55; color: var(--ink-3); }
.hero__diff {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px;
  margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line-2);
  font-size: 11.5px; color: var(--ink-3);
}
.hero__diff b { color: var(--accent-deep); font-weight: 600; }
.guide__head--hero .guide__lead { margin-top: 16px; }

.guide__section { padding: 30px 0; border-bottom: 1px solid var(--line-2); }
.guide__section:last-child { border-bottom: 0; padding-bottom: 8px; }
.guide__section h2 {
  font-family: var(--font-hand); font-size: 27px; font-weight: 400;
  line-height: 1.35; letter-spacing: 0.005em; margin-bottom: 12px;
}
.guide__section p { font-size: 14px; line-height: 1.9; color: var(--ink-2); margin-bottom: 12px; }
.guide__section p b { color: var(--ink); font-weight: 600; }
.guide__note {
  font-size: 12.5px; line-height: 1.75; color: var(--ink-3);
  padding: 12px 14px; background: var(--paper-2); border-radius: 10px; margin-bottom: 12px;
}
.guide__note b { color: var(--ink-2); font-weight: 600; }

.guide__compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0 14px; }
.guide__compare-col { padding: 15px 16px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.guide__compare-col h3 { font-family: var(--font-hand); font-size: 21px; font-weight: 400; margin-bottom: 5px; }
.guide__compare-col p { font-size: 12.5px; line-height: 1.75; color: var(--ink-3); margin-bottom: 9px; }
.guide__compare-col small { font-size: 10.5px; color: var(--ink-4); }
.guide__compare-col.is-ours { border-color: rgba(47, 79, 79, 0.35); background: var(--accent-tint); }
.guide__compare-col.is-ours h3 { color: var(--accent-deep); }
.guide__compare-col.is-ours p { color: var(--accent-deep); }

.guide__goal {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 16px 0;
}
.guide__goal > div { display: flex; flex-direction: column; gap: 4px; padding: 13px 14px; background: var(--surface); }
.guide__goal span { font-size: 10.5px; color: var(--ink-4); }
.guide__goal b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

.guide__principles, .guide__steps { display: flex; flex-direction: column; gap: 18px; margin: 4px 0 6px; }
.guide__principles li, .guide__steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
.guide__pnum { font-family: var(--font-hand); font-size: 22px; color: var(--accent); line-height: 1.35; }
.guide__principles h3, .guide__steps h3 { font-size: 14px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 4px; }
.guide__principles p, .guide__steps p { font-size: 13.5px; line-height: 1.85; color: var(--ink-2); margin-bottom: 0; }
.guide__principles small {
  display: inline-block; margin-top: 7px; padding: 4px 9px; border-radius: 6px;
  font-size: 11px; color: var(--accent-deep); background: var(--accent-tint);
}
.guide__list { display: flex; flex-direction: column; gap: 9px; margin: 4px 0 14px; }
.guide__list li { position: relative; padding-left: 13px; font-size: 13.5px; line-height: 1.8; color: var(--ink-2); }
.guide__list li::before { content: ''; position: absolute; left: 2px; top: 10px; width: 4px; height: 4px; border-radius: 50%; background: var(--ink-4); }
.guide__list b { color: var(--ink); font-weight: 600; }
.guide__cta { margin-top: 14px; }
.guide__privacy {
  display: flex; gap: 7px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2);
  font-size: 11.5px; color: var(--ink-3); line-height: 1.75;
}
.guide__privacy .icon { margin-top: 3px; flex: none; color: var(--ink-4); }
.guide__table { font-size: 12.5px; }
.guide__table td { vertical-align: top; line-height: 1.65; }
.guide__table td:first-child { width: 32%; color: var(--ink-3); }
.guide__table td b { font-weight: 600; }

/* ------------------------------------------------------------ 가져오기 */

.import__grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.import-box { display: flex; flex-direction: column; gap: 12px; }
.import-box__badge { font-size: 11.5px; color: var(--ink-4); white-space: nowrap; }
.paste {
  width: 100%; min-height: 196px; resize: vertical;
  padding: 14px 15px; border: 1px dashed var(--line-strong); border-radius: 11px;
  background: var(--paper); font-family: ui-monospace, SFMono-Regular, 'Menlo', 'Consolas', monospace;
  font-size: 12px; line-height: 1.8; color: var(--ink-2); white-space: pre;
}
.paste::placeholder { color: var(--ink-4); }
.import__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.import__actions .primary-btn { margin-left: auto; }
.file-btn {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px; border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--surface); font-size: 12.5px; font-weight: 500; color: var(--ink-2); cursor: pointer;
}
.file-btn:hover { background: var(--paper); }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.privacy {
  display: flex; gap: 7px; font-size: 11.5px; color: var(--ink-3); line-height: 1.65;
  padding-top: 11px; border-top: 1px solid var(--line-2);
}
.privacy .icon { margin-top: 2px; color: var(--ink-4); }

.import-guide { display: flex; flex-direction: column; gap: 13px; }
.rule-line { font-size: 12.5px; color: var(--ink-3); line-height: 1.7; }
.rule-line b { color: var(--ink-2); font-weight: 500; }
.import-examples h4 { font-size: 11.5px; color: var(--ink-4); font-weight: 500; margin-bottom: 7px; }
.import-examples ul { display: flex; flex-direction: column; gap: 7px; }
.import-examples li { font-size: 12px; color: var(--ink-3); line-height: 1.6; overflow-wrap: anywhere; }
.import-examples code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; background: var(--paper); padding: 1px 5px; border-radius: 4px; color: var(--ink-2); }
.import-examples em { font-style: normal; color: var(--ink-4); }
.sms-note { display: flex; gap: 8px; font-size: 12px; color: var(--ink-3); line-height: 1.65; }
.sms-note .icon { margin-top: 2px; color: var(--accent); flex: none; }
.sms-note b { color: var(--ink-2); font-weight: 500; }

.preview { margin-top: 18px; scroll-margin-top: 84px; }
.preview .table-wrap { margin-top: 10px; }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th { text-align: left; font-size: 11px; font-weight: 500; color: var(--ink-4); padding: 7px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 9px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--paper); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tfoot td { border-top: 1px solid var(--line); border-bottom: 0; font-weight: 500; padding-top: 11px; }

.pv-table th:nth-child(1) { width: 34px; }
.pv-table th:nth-child(2) { width: 62px; }
.pv-table th:nth-child(4) { width: 84px; }
.pv-table th:nth-child(5) { width: 92px; }
.pv-table th:nth-child(6) { width: 122px; }
.pv-check input { width: 15px; height: 15px; accent-color: var(--accent); }
.pv-date { color: var(--ink-4); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pv-merchant { min-width: 0; }
.pv-merchant__name { display: block; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.pv-merchant__meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.pv-method { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }
.pv-amount { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
.pv-row.is-duplicate { opacity: 0.45; }
.preview__skipped { margin-top: 9px; font-size: 11.5px; color: var(--ink-4); }
.preview__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.preview__sum { font-size: 13px; }
.preview__sum b { font-weight: 600; font-variant-numeric: tabular-nums; }
.preview__hint { display: block; font-size: 11px; color: var(--ink-4); margin-top: 2px; }

/* ------------------------------------------------------------ 내역 */

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 4px; }
.search {
  position: relative; display: flex; align-items: center; gap: 6px; flex: 1 1 200px; min-width: 160px;
  height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink-4); background: var(--surface);
}
.search input { border: 0; outline: none; background: none; width: 100%; font-size: 12.5px; color: var(--ink); }
.search input::placeholder { color: var(--ink-4); }
.toolbar .primary-btn--sm { margin-left: auto; }

.ledger-table th:nth-child(1) { width: 76px; }
.ledger-table th:nth-child(3) { width: 106px; }
.ledger-table th:nth-child(4) { width: 84px; }
.ledger-table th:nth-child(5) { width: 132px; }
.ledger-table th:nth-child(6) { width: 40px; }
.tx-date { color: var(--ink-4); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-date__year { display: block; font-size: 9.5px; color: var(--ink-4); }
.tx-merchant { min-width: 0; }
.tx-merchant__name { display: block; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.tx-merchant__line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tx-owner {
  display: inline-flex; align-items: center; padding: 0; border-radius: 0;
  background: none; color: var(--ink-4); font-size: 10.5px; font-weight: 500; white-space: nowrap;
}
.tx-owner::before { content: '·'; margin-right: 4px; color: var(--line-strong); }
.tx-owner--spouse { color: var(--ink-4); }
.tx-merchant__memo { display: block; font-size: 11px; color: var(--ink-3); margin-top: 1px; overflow-wrap: anywhere; }
.tx-method { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }
.tx-cat { display: flex; align-items: center; gap: 5px; }
.tx-cat .select { flex: 1; min-width: 0; }
.tx-del { text-align: right; }
tr.is-unmatched .tx-merchant__name::after {
  content: '미분류'; margin-left: 6px; padding: 0; color: var(--warn); font-size: 10px; font-weight: 500; vertical-align: 1px;
}
.add-form { margin: 14px 0 16px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.add-form__grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.add-form__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* ------------------------------------------------------------ 미분류 */

.um-list { display: flex; flex-direction: column; margin-top: 6px; }
.um { padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.um:last-child { border-bottom: 0; }
.um__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.um__who { min-width: 0; }
.um__merchant { display: block; font-size: 13.5px; font-weight: 500; overflow-wrap: anywhere; }
.um__meta { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ink-4); }
.um__amount { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.um__cats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font-size: 11.5px; font-weight: 500; color: var(--ink-2);
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.cat-chip:hover { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-deep); }
.um__note { display: flex; gap: 7px; margin-top: 16px; font-size: 11.5px; color: var(--ink-3); line-height: 1.65; }
.um__note .icon { margin-top: 1px; color: var(--ink-4); }

/* ------------------------------------------------------------ 설정 */

.subnav { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.subnav button {
  position: relative; border: 0; background: none;
  padding: 8px 4px 11px; margin-right: 22px;
  font-size: 13px; font-weight: 500; color: var(--ink-3);
}
.subnav button:hover { color: var(--ink-2); }
.subnav button.is-active { color: var(--ink); font-weight: 600; }
.subnav button.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1.5px; background: var(--ink); border-radius: 2px 2px 0 0;
}

.settings > .card + .card { margin-top: 16px; }
.budget-table th:nth-child(1) { width: 30%; }
.budget-table th:nth-child(2) { width: 22%; }
.budget-table th:nth-child(3), .budget-table th:nth-child(4) { width: 14%; }
.budget-table th:nth-child(5) { width: 108px; }
.bt__name { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.bt__input { min-width: 120px; }
.budget-table th.num { text-align: right; }
.budget-table .money-field { max-width: 180px; margin-left: auto; }
.budget-table td.num { font-variant-numeric: tabular-nums; }
.bt__carry .mini-switch { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-3); cursor: pointer; }
.mini-switch input { width: 14px; height: 14px; accent-color: var(--accent); }
.budget__summary { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.budget__summary b { color: var(--ink); font-weight: 600; }
.settings-note h4 { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; margin-bottom: 8px; color: var(--ink-2); }
.settings-note ul { display: flex; flex-direction: column; gap: 6px; }
.settings-note li { position: relative; padding-left: 12px; font-size: 12px; color: var(--ink-3); line-height: 1.65; }
.settings-note li::before { content: ''; position: absolute; left: 2px; top: 8px; width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }
.settings-note b { color: var(--ink-2); font-weight: 500; }

.rules__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 10px; margin-top: 14px; }
.rule-card { padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.rule-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rule-card h4 { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; }
.rule-card h4 .rule-card__pri { font-size: 10px; color: var(--ink-4); font-weight: 400; }
.rule-card__count { font-size: 10.5px; color: var(--ink-4); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 9px 0; }
.kw { display: inline-flex; align-items: center; gap: 1px; padding: 1px 3px 1px 6px; border-radius: 5px; background: var(--paper); font-size: 10.5px; color: var(--ink-2); }
.kw__del { border: 0; background: none; color: var(--ink-4); font-size: 11px; line-height: 1; padding: 1px 3px; border-radius: 3px; }
.kw__del:hover { background: var(--over-tint); color: var(--over); }
.rule-card__ex { font-size: 10.5px; color: var(--ink-4); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 8px; }
.rule-card__ex b { color: var(--warn); font-weight: 500; }
.rule-card__ex span { background: var(--warn-tint); color: var(--warn); padding: 1px 6px; border-radius: 4px; }
.kw-add { display: flex; gap: 6px; }
.kw-add input { flex: 1; min-width: 0; height: 29px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font-size: 12px; }

.rule-test__form { display: flex; gap: 8px; margin-top: 12px; }
.rule-test__form input { flex: 1; min-width: 0; height: 37px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px; }
.rule-test__result { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 11px; padding: 11px 13px; border-radius: 8px; font-size: 12.5px; }
.rule-test__result.is-hit { background: var(--accent-tint); color: var(--accent-deep); }
.rule-test__result.is-miss { background: var(--warn-tint); color: var(--warn); }
.rule-test__result span { color: var(--ink-2); }

.learned__list { display: flex; flex-direction: column; margin-top: 8px; }
.learned__list li { display: flex; align-items: center; gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.learned__list li:last-child { border-bottom: 0; }
.learned__merchant { font-weight: 500; overflow-wrap: anywhere; }
.learned__arrow { color: var(--ink-4); }
.learned__cat { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); }
.learned__list .icon-btn { margin-left: auto; width: 26px; height: 26px; }

.data__stats { display: flex; flex-wrap: wrap; gap: 20px; margin: 14px 0; }
.data__stats li { display: flex; flex-direction: column; gap: 1px; font-size: 11px; color: var(--ink-4); }
.data__stats b { font-size: 12.5px; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.data__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.data__warn { margin-top: 10px; font-size: 11px; }

/* 설정 › 데이터 — 백업·복원 */
.backup__steps { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 0; }
.backup__steps li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 11px 12px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--paper);
}
.backup__no { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-tint); color: var(--accent-deep); }
.backup__body { flex: 1 1 190px; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.backup__body b { font-size: 13px; font-weight: 600; }
.backup__body small { font-size: 11px; line-height: 1.55; color: var(--ink-3); }
.backup__pick { cursor: pointer; margin-left: auto; }
.backup__steps .ghost-btn { flex: none; margin-left: auto; }

.share__banner {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 9px; background: var(--paper);
  font-size: 12.5px; color: var(--ink-2);
}
.share__banner .icon { color: var(--ink-4); }
.share__banner .chip { color: var(--ink-4); }
.member-list { display: flex; flex-direction: column; margin-top: 12px; }
.member {
  display: grid; grid-template-columns: minmax(0, 1fr) 100px 92px auto;
  align-items: center; gap: 14px; padding: 13px 2px; border-top: 1px solid var(--line-2);
}
.member:first-child { border-top: 0; }
.member__who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.member__avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); font-size: 11px; font-weight: 600; color: var(--ink-2); }
.member__who strong { display: block; font-size: 13px; font-weight: 500; }
.member__who em { font-style: normal; font-size: 11px; color: var(--ink-4); }
.member__num { text-align: right; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.member__num span { display: block; font-size: 10.5px; color: var(--ink-4); font-weight: 400; }
.share__foot { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.share__foot p { font-size: 11.5px; color: var(--ink-3); max-width: 460px; line-height: 1.6; }

/* ------------------------------------------------------------ 빠른 기록 */

[hidden] { display: none !important; }

.quickbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -4px 0 24px; padding: 0 2px; }
.quickbar__btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border: 1px dashed var(--line-strong); border-radius: 9px;
  background: transparent; color: var(--ink-2); font-size: 12.5px; font-weight: 500;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}
.quickbar__btn .icon { color: var(--ink-4); }
.quickbar__btn:hover { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-deep); }
.quickbar__btn:hover .icon { color: var(--accent); }
.quickbar__add {
  display: inline-flex; align-items: center; gap: 4px;
  border: 0; background: none; padding: 8px 2px;
  color: var(--ink-3); font-size: 12.5px; font-weight: 500;
}
.quickbar__add:hover { color: var(--ink); }

.clip-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 13px; border: 1px solid var(--accent); border-radius: 9px;
  background: var(--accent-tint); color: var(--accent-deep); font-size: 12.5px; font-weight: 500;
  transition: background 0.14s ease;
}
.clip-btn:hover { background: #e3ebe8; }

.import__auto { display: flex; gap: 6px; align-items: flex-start; font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }
.import__auto .icon { margin-top: 2px; color: var(--accent); flex: none; }
.import__auto b { color: var(--ink-2); font-weight: 500; }
.import__actions .import__reparse { margin-left: auto; }

.modal--quick { max-width: 560px; padding: 24px 26px 22px; display: flex; flex-direction: column; max-height: 90vh; overflow: hidden; }
.quick { display: flex; flex-direction: column; gap: 14px; flex: 1 1 auto; min-height: 0; }
.quick__head h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.03em; margin: 3px 0 5px; }
.quick__head p { font-size: 12.5px; color: var(--ink-3); line-height: 1.65; }

.quick__seg { display: flex; gap: 2px; padding: 3px; background: var(--paper-2); border-radius: 10px; }
.quick__seg button {
  flex: 1; border: 0; background: none; padding: 7px 10px; border-radius: 8px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-3);
}
.quick__seg button:hover { color: var(--ink-2); }
.quick__seg button.is-on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(32, 30, 26, 0.08); }

.quick__panel { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.quick__panel[data-quick-panel="paste"] { flex: 1 1 auto; }
.quick__panel[data-quick-panel="manual"] { overflow-y: auto; min-height: 0; }
.quick__paste { min-height: 128px; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
[data-quick="preview"] { min-height: 0; overflow-y: auto; flex: 1 1 auto; }
[data-quick="preview"]:empty { flex: none; }
.quick__bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.quick__link {
  border: 0; background: none; padding: 4px 2px; color: var(--ink-3); font-size: 12px;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong);
}
.quick__link:hover { color: var(--ink); }
.quick__auto { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-4); }
.quick__auto .icon { color: var(--accent); }

.quick__notice { font-size: 11.5px; color: var(--warn); background: var(--warn-tint); border-radius: 7px; padding: 8px 10px; line-height: 1.6; }
.quick__privacy { display: flex; gap: 6px; font-size: 11px; color: var(--ink-4); line-height: 1.6; }
.quick__privacy .icon { margin-top: 2px; flex: none; }

.qp { border-top: 1px solid var(--line-2); padding-top: 3px; }
.qp__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 6px 0 2px; }
.qp__head b { font-size: 12.5px; font-weight: 600; }
.qp__head span { font-size: 11px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.qp__list { display: flex; flex-direction: column; }
.qp__row {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) auto;
  column-gap: 9px; row-gap: 3px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--line-2);
}
.qp__row:last-child { border-bottom: 0; }
.qp__row.is-dup { opacity: 0.5; }
.qp__check { grid-column: 1; grid-row: 1 / span 2; width: 15px; height: 15px; accent-color: var(--accent); }
.qp__name { grid-column: 2; grid-row: 1; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.qp__amt { grid-column: 3; grid-row: 1; text-align: right; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qp__meta { grid-column: 2; grid-row: 2; font-size: 10.5px; color: var(--ink-4); overflow-wrap: anywhere; }
.qp__cat { grid-column: 3; grid-row: 2; width: 104px; height: 29px; font-size: 11.5px; padding: 0 4px; }
.qp__skipped { font-size: 10.5px; color: var(--ink-4); padding: 8px 0 2px; }
.qp__hint { font-size: 11px; color: var(--ink-4); padding: 8px 0 2px; }

.quick__fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.quick__fields .field:last-child { grid-column: 1 / -1; }
.quick__fields .money-field input { height: 38px; }
.quick__picks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.quick__picks-label { font-size: 11px; color: var(--ink-4); margin-right: 2px; }
.pick-chip {
  padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-2); font-size: 11.5px; font-weight: 500;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pick-chip:hover { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-tint); }
.quick__hint { font-size: 11px; color: var(--ink-4); line-height: 1.6; }
.quick__foot { flex: none; margin-top: 2px; padding-top: 12px; border-top: 1px solid var(--line-2); }

.annual { display: flex; flex-direction: column; gap: 9px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.annual__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.annual__head strong { font-size: 12.5px; font-weight: 600; }
.annual__head span { font-size: 10.5px; color: var(--ink-4); }
.annual__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.annual__row .button, .annual__row .ghost-btn { height: 32px; }
.annual__note { font-size: 11px; color: var(--ink-3); line-height: 1.6; }

.cover { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 2px; }
.cover select {
  height: 38px; width: 100%; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); font-size: 13px; color: var(--ink-2);
}
.cover__note { font-size: 11.5px; color: var(--ink-3); line-height: 1.65; }
.cover__note b { color: var(--ink-2); font-weight: 600; }
.cover__empty { font-size: 12.5px; color: var(--ink-3); line-height: 1.75; margin: 12px 0 4px; }

/* ------------------------------------------------------------ 모달 */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(32, 30, 26, 0.4);
  animation: fade 0.14s ease;
}
.modal {
  width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto;
  background: var(--surface); border-radius: 16px; padding: 22px;
  box-shadow: var(--shadow-pop);
  animation: pop 0.16s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.99); } to { opacity: 1; transform: none; } }
.modal__head { margin-bottom: 16px; }
.modal__eyebrow { font-size: 11.5px; color: var(--ink-4); }
.modal__head h3 { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; margin: 3px 0; letter-spacing: -0.03em; }
.modal__head p { font-size: 12px; color: var(--ink-3); }
.modal__form { display: flex; flex-direction: column; gap: 14px; }
.modal__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.modal__stats li { display: flex; flex-direction: column; gap: 1px; padding: 9px 11px; border-radius: 8px; background: var(--paper); font-size: 11px; color: var(--ink-3); }
.modal__stats b { font-size: 12.5px; font-variant-numeric: tabular-nums; font-weight: 500; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.modal__body h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.02em; }
.modal__body p { font-size: 13px; color: var(--ink-2); line-height: 1.65; }
.modal__body b { color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------ 토스트 */

.toast-wrap { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 15px; border-radius: 9px;
  background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 500;
  box-shadow: var(--shadow-pop);
  animation: toastIn 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
.toast--error { background: #7b2c25; }
.toast.is-out { opacity: 0; transform: translateY(6px); transition: opacity 0.3s ease, transform 0.3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.noscript { padding: 24px; text-align: center; }

/* ------------------------------------------------------------
   봉투 가계부 핵심 기능 4종 — 미배정 · 목표 · 카드값 · 내 돈 여유
   ------------------------------------------------------------ */

.toplines {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px;
  margin-top: 12px; font-size: 12px; color: var(--ink-3);
}
.topline {
  border: 0; background: none; padding: 0; text-align: left;
  font-size: 12px; color: var(--ink-3); line-height: 1.5;
}
.topline b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.topline:hover b { border-bottom: 1px solid var(--line-strong); }
.topline.is-over b { color: var(--over); }
.toplines__sep { color: var(--ink-4); }

.cardhold { margin: 12px 0 0; padding: 0 2px; }
.cardhold button {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px;
  border: 0; background: none; padding: 0; text-align: left;
  font-size: 12.5px; color: var(--ink-2); line-height: 1.55;
}
.cardhold__label { color: var(--ink-3); }
.cardhold b { font-weight: 600; font-variant-numeric: tabular-nums; }
.cardhold em { font-style: normal; font-size: 11.5px; color: var(--ink-4); }
.cardhold button:hover b { border-bottom: 1px solid var(--line-strong); }

/* 봉투 줄 — 남은 돈이 주인공, 쓴 돈은 보조 */
.brow__left { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }
.brow__spent { font-size: 13px; color: var(--ink-3); }
.brow__goal {
  display: block; margin-top: 3px; font-style: normal;
  font-size: 10.5px; color: var(--ink-4); font-variant-numeric: tabular-nums;
}

/* 설정 › 예산 — 이번 달 쓸 수 있는 돈 */
.ready-card__state {
  flex: none; font-size: 11.5px; padding: 4px 9px; border-radius: 7px; white-space: nowrap;
}
.ready-card__state.is-ok { color: var(--accent-deep); background: var(--accent-tint); }
.ready-card__state.is-over { color: var(--over); background: var(--over-tint); }
.ready-card__state.is-none { color: var(--warn); background: var(--warn-tint); }
.ready-card__body {
  display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr);
  gap: 18px; align-items: end; margin-top: 14px;
}
.ready-card__nums {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.ready-card__nums > div { background: var(--surface); padding: 9px 12px; }
.ready-card__nums dt { font-size: 10.5px; color: var(--ink-4); }
.ready-card__nums dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ready-card__calc {
  margin-top: 12px; font-size: 11.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums; line-height: 1.6;
}
.ready-card__calc b { color: var(--ink-2); font-weight: 600; }

/* 봉투 금액 조정 모달 — 목표 모으기 */
.goal {
  display: flex; flex-direction: column; gap: 10px;
  padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper);
}
.goal__head { display: flex; flex-direction: column; gap: 1px; }
.goal__head strong { font-size: 13px; font-weight: 600; }
.goal__head span { font-size: 11px; color: var(--ink-3); line-height: 1.5; }
.goal__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.goal__row select {
  height: 38px; width: 100%; padding: 0 8px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); font-size: 12.5px; color: var(--ink-2);
}
.goal__calc { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.goal__calc p {
  min-width: 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
.goal__calc button { flex: none; }

/* 봉투 상세 시트 — 쓸 수 있던 돈에서 −금액이 빠져나간 순서 */
.modal--sheet { max-width: 520px; }
.csh__head h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.03em; margin-top: 3px; }
.csh__left {
  margin-top: 8px; font-size: 32px; font-weight: 600; letter-spacing: -0.04em;
  line-height: 1.1; font-variant-numeric: tabular-nums;
}
.csh__left span { margin-left: 4px; font-size: 14px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.csh__left.is-neg { color: var(--over); }
.csh__calc {
  margin-top: 8px; font-size: 11.5px; color: var(--ink-3); line-height: 1.65;
  font-variant-numeric: tabular-nums;
}
.csh__calc b { color: var(--ink-2); font-weight: 600; }
.csh__goal {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px;
  margin-top: 12px; padding: 9px 11px; border-radius: 9px;
  background: var(--accent-tint); font-size: 11.5px; color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}
.csh__goal em { font-style: normal; color: var(--ink-3); }
.csh__list { margin-top: 14px; border-top: 1px solid var(--line-2); max-height: 44vh; overflow-y: auto; }
.csh__row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: baseline;
  padding: 9px 2px; border-bottom: 1px solid var(--line-2); font-size: 13px;
}
.csh__row--start { color: var(--ink-3); }
.csh__date { font-size: 11px; color: var(--ink-4); font-variant-numeric: tabular-nums; white-space: nowrap; }
.csh__merchant { min-width: 0; overflow-wrap: anywhere; color: var(--ink-2); }
.csh__merchant em { display: block; font-style: normal; font-size: 10.5px; color: var(--ink-4); }
.csh__amount { text-align: right; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.csh__row--start .csh__amount { color: var(--ink-2); font-weight: 600; }
.csh__empty { padding: 18px 2px; text-align: center; font-size: 12.5px; color: var(--ink-3); line-height: 1.75; }
.csh__foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 11px 2px 2px; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.csh__foot b { color: var(--ink); font-weight: 600; }
.csh__actions { flex-wrap: wrap; margin-top: 12px; }
.csh__mini { margin-top: 12px; border-top: 1px solid var(--line-2); }
.csh__mini li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 8px 2px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-2);
}
.csh__mini b { font-variant-numeric: tabular-nums; }
.modal__note { margin-top: 12px; font-size: 11.5px; color: var(--ink-3); line-height: 1.7; }

/* ============================================================
   반응형 — 980 / 760 / 430
   ============================================================ */

@media (max-width: 980px) {
  .main { padding: 30px 20px calc(var(--tabbar-h) + 66px); }
  .topbar__in { padding: 0 20px; gap: 18px; }
  .tabs button { padding: 9px 9px 10px; }
  .tabs button.is-active::after { left: 9px; right: 9px; }
  .import__grid { perspective: none; }
}

@media (max-width: 820px) {
  .import__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .topbar__in { height: 56px; padding: 0 16px; }
  .brand__name { font-size: 18px; }
  .tabs { display: none; }
  .monthnav { gap: 0; }
  .monthnav__arrow { width: 26px; }
  .main { padding: 22px 16px calc(var(--tabbar-h) + 112px + env(safe-area-inset-bottom, 0px)); }
  .samplebar { padding: 11px 12px; margin-bottom: 16px; }
  .samplebar__acts { width: 100%; }
  .samplebar__acts .primary-btn { flex: 1 1 62%; padding: 10px 14px; }
  .samplebar__dismiss { padding: 10px 6px; }
  .samplebar__body p { font-size: 11.5px; }

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: rgba(255, 255, 255, 0.97); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px));
  }
  .tabbar__item {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
    border: 0; background: none; padding: 4px 2px; border-radius: 8px;
    color: var(--ink-4); font-size: 10.5px; font-weight: 500;
  }
  .tabbar__item.is-active { color: var(--ink); }
  .tabbar__item.is-active .icon { color: var(--accent); }
  .toast-wrap { bottom: calc(var(--tabbar-h) + 14px); }

  .card { padding: 18px 16px; border-radius: 14px; }
  .card__head { gap: 12px; flex-wrap: wrap; }
  .card__head > div:first-child { flex: 1 1 200px; }
  .card__head h2, .card__head h3 { font-size: 14.5px; }
  .card__head p { font-size: 12px; }

  .balance { flex-direction: column; align-items: stretch; gap: 14px; padding: 2px 2px 18px; }
  .balance__amount { font-size: 36px; }
  .balance__amount span { font-size: 17px; }
  .balance__sub { font-size: 12px; }
  .balance__gauge { margin-top: 12px; }
  .who { align-self: flex-start; margin-top: 0; }
  .who button { padding: 6px 14px; }

  .tidy { margin-bottom: 22px; font-size: 12.5px; }

  .sheet { padding: 14px 16px 8px; border-radius: 14px; }
  .bhead { grid-template-columns: minmax(0, 1fr) 82px 82px; gap: 8px; font-size: 11px; }
  .brow { grid-template-columns: minmax(0, 1fr) 82px 82px; gap: 8px; padding: 12px 2px 7px; }
  .brow__name { font-size: 13.5px; }
  .brow__spent, .brow__left { font-size: 13px; }
  .sheet__foot { font-size: 11px; flex-wrap: wrap; gap: 4px; }

  .panels { grid-template-columns: minmax(0, 1fr); gap: 32px; margin-top: 34px; }

  .coach { margin-top: 34px; }

  .page-lead { font-size: 12.5px; margin-bottom: 14px; }
  .page-title { font-size: 20px; }
  .primary-btn { padding: 9px 14px; font-size: 12.5px; }
  .ghost-btn { padding: 8px 12px; }

  .import__actions { justify-content: flex-start; }
  .import__actions .primary-btn { margin-left: 0; flex: 1 1 100%; }
  .paste { min-height: 150px; font-size: 11.5px; padding: 12px 13px; }
  .preview__foot { flex-direction: column; align-items: stretch; gap: 10px; }
  .preview__foot .primary-btn { width: 100%; }

  .toolbar { gap: 6px; }
  .toolbar > * { min-width: 0; max-width: 100%; }
  .search { flex-basis: 100%; order: -1; }
  .toolbar .select { flex: 1 1 30%; min-width: 0; padding: 0 4px; }
  .toolbar .segmented { flex: 1 1 100%; }
  .toolbar .primary-btn--sm { margin-left: 0; flex: 1 1 46%; }
  .toolbar .toolbar__paste { margin-left: 0; flex: 1 1 46%; padding: 7px 8px; }
  .add-form { padding: 14px; }
  .add-form__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field--wide { grid-column: span 2; }

  .um { padding: 13px 0; }
  .cat-chip { padding: 5px 9px; font-size: 11px; }

  .subnav { overflow-x: auto; margin-bottom: 16px; scrollbar-width: none; }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav button { margin-right: 18px; white-space: nowrap; flex: none; }

  .table-wrap { overflow-x: visible; }
  /* 내역 — 390px에서 금액·삭제 버튼이 화면 밖으로 나가지 않도록 폭을 묶는다 */
  .ledger, .ledger .card, .ledger .table-wrap { min-width: 0; max-width: 100%; }
  .ledger-table { min-width: 0; max-width: 100%; table-layout: fixed; }
  .ledger-table, .ledger-table tbody, .ledger-table tr, .ledger-table td { display: block; width: 100%; min-width: 0; max-width: 100%; }
  .ledger-table thead { display: none; }
  .ledger-table tr {
    position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto;
    align-items: end; column-gap: 10px; row-gap: 1px;
    padding: 12px 0; border-bottom: 1px solid var(--line-2);
  }
  .ledger-table tr:last-child { border-bottom: 0; }
  .ledger-table td { padding: 0; border: 0; }
  .ledger-table .tx-merchant__line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .ledger-table .tx-cat { display: flex; align-items: center; gap: 6px; }
  .ledger-table .tx-cat .dot-inline { display: none; }
  .tx-date { grid-column: 1; grid-row: 1; font-size: 10.5px; color: var(--ink-4); }
  .tx-date__year { display: none; }
  .ledger-table td.num { grid-column: 2; grid-row: 1; text-align: right; font-size: 14px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
  .tx-merchant { grid-column: 1; grid-row: 2; min-width: 0; }
  .tx-merchant__name { font-size: 13.5px; }
  .tx-merchant__memo { font-size: 10.5px; }
  .tx-method { grid-column: 1; grid-row: 3; font-size: 10.5px; color: var(--ink-4); }
  .tx-cat { grid-column: 1; grid-row: 4; margin-top: 6px; }
  .tx-cat .select { width: auto; min-width: 0; max-width: 100%; height: 31px; font-size: 12px; }
  .tx-del { grid-column: 2; grid-row: 4; align-self: center; text-align: right; }
  .tx-del .icon-btn { width: 30px; height: 30px; }
  .ledger-table .tx-date, .ledger-table .tx-merchant, .ledger-table .tx-method { min-width: 0; overflow-wrap: anywhere; }

  .pv-table, .pv-table thead { display: block; }
  .pv-table thead { display: none; }
  .pv-table tbody, .pv-table tr { display: block; width: 100%; }
  .pv-table tr {
    position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 10px; row-gap: 2px; padding: 12px 0 12px 26px; border-bottom: 1px solid var(--line-2);
  }
  .pv-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .pv-check { position: absolute; left: 0; top: 14px; }
  .pv-check input { width: 17px; height: 17px; }
  .pv-date { grid-column: 1; grid-row: 1; font-size: 10.5px; }
  .pv-merchant { grid-column: 1; grid-row: 2; }
  .pv-merchant__name { font-size: 13.5px; }
  .pv-merchant__meta { display: flex; margin-top: 4px; }
  .pv-method { grid-column: 1; grid-row: 3; font-size: 10.5px; }
  .pv-amount { grid-column: 2; grid-row: 1; text-align: right; font-size: 14px; font-weight: 600; }
  .pv-cat { grid-column: 1 / span 2; grid-row: 4; margin-top: 8px; }
  .pv-cat .select { width: 100%; height: 33px; }

  .budget-table, .budget-table tbody, .budget-table tfoot, .budget-table tr, .budget-table td { display: block; width: 100%; }
  .budget-table thead { display: none; }
  .budget-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) 128px; align-items: center;
    gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2);
  }
  .budget-table td { padding: 0; border: 0; }
  .budget-table .bt__name { display: flex; align-items: center; gap: 8px; }
  .budget-table td:nth-child(3) { display: none; }
  .budget-table td:nth-child(5) { grid-column: 2; grid-row: 2; justify-self: end; }
  .budget-table td:nth-child(5) .mini-switch span { font-size: 10.5px; }
  .bt__name { grid-column: 1; grid-row: 1; font-size: 12.5px; }
  .bt__input { grid-column: 2; grid-row: 1; min-width: 0; }
  .bt__input .money-field { max-width: none; }
  .budget-table td:nth-child(4) { grid-column: 1 / span 2; grid-row: 2; text-align: left; font-size: 11px; color: var(--ink-3); }
  .budget-table td:nth-child(4)::before { content: '사용가능 '; }
  .budget-table td:nth-child(4)::after { content: '원'; }
  .budget-table tfoot tr { border-bottom: 0; border-top: 1px solid var(--line); padding-top: 12px; }
  .budget-table tfoot td:nth-child(1) { font-weight: 600; }
  .budget__summary { gap: 10px; font-size: 11px; }

  .rules__grid { grid-template-columns: minmax(0, 1fr); }
  .learned__list li { flex-wrap: wrap; }

  .member { grid-template-columns: minmax(0, 1fr) 76px auto; gap: 10px; }
  .member__num:nth-of-type(2) { display: none; }

  .modal { padding: 18px; border-radius: 14px; }

  .quickbar { margin-bottom: 20px; gap: 8px; }  .quickbar__btn { flex: 1 1 auto; justify-content: center; }
  .modal--quick { padding: 18px; max-height: 92vh; }
  .quick__head h3 { font-size: 16.5px; }
  .quick__fields { grid-template-columns: minmax(0, 1fr); }
  .quick__fields .field:last-child { grid-column: auto; }
  .qp__cat { width: 96px; }
  .quick__auto { display: none; }
  .quick__foot .primary-btn { flex: 1; }
  .import__actions .import__reparse { margin-left: 0; }

  .guide__title { font-size: 31px; }
  .guide__section { padding: 24px 0; }
  .guide__section h2 { font-size: 24px; }
  .guide__section p { font-size: 13.5px; line-height: 1.85; }
  .guide__lead { font-size: 14px; line-height: 1.85; }
  .guide__goal { grid-template-columns: minmax(0, 1fr); }
  .guide__compare { grid-template-columns: minmax(0, 1fr); }
  .guide__principles li, .guide__steps li { grid-template-columns: 26px minmax(0, 1fr); gap: 8px; }
  .closing__title { font-size: 21px; }
  .closing__step { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; }
  .cover-line button { font-size: 12px; }
}

@media (max-width: 430px) {
  .balance__amount { font-size: 33px; }
  .balance__amount span { font-size: 16px; }
  .bhead { grid-template-columns: minmax(0, 1fr) 76px 76px; }
  .brow { grid-template-columns: minmax(0, 1fr) 76px 76px; }
  .brow__spent, .brow__left { font-size: 12.5px; }
  .brow__annual { display: block; margin-left: 0; }
  .brand__name { font-size: 17px; }
  .monthnav__label { font-size: 13px; padding: 5px 5px; }
  .monthnav__today { display: none; }
  .card { padding: 16px 14px; }
  .sheet { padding: 12px 14px 6px; }
  .member__avatar { display: none; }
  .guide__title { font-size: 27px; }
  .guide__section h2 { font-size: 22px; }
  .guide__compare { grid-template-columns: minmax(0, 1fr); }
  .guide__goal { grid-template-columns: minmax(0, 1fr); }
  /* 설정 탭 4개 — 390px에서 글자가 잘리지 않도록 같은 폭으로 나눠 놓는다 */
  .subnav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; overflow: visible; }
  .subnav button { margin-right: 0; padding: 8px 2px 11px; text-align: center; font-size: 12.5px; letter-spacing: -0.02em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ------------------------------------------------------------
   봉투 가계부 핵심 기능 4종 · 봉투 상세 — 모바일 우선 보정
   ------------------------------------------------------------ */

@media (max-width: 760px) {
  .bhead { display: none; }
  .brow {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name left" "goal spent" "bar bar";
    column-gap: 10px; row-gap: 3px;
    padding: 13px 2px 9px;
  }
  .brow__name { grid-area: name; align-self: center; font-size: 14px; font-weight: 600; }
  .brow__left { grid-area: left; font-size: 17px; font-weight: 600; letter-spacing: -0.025em; }
  .brow__spent { grid-area: spent; font-size: 10.5px; color: var(--ink-4); text-align: right; }
  .brow__spent::before { content: '쓴 돈 '; }
  .brow__goal { grid-area: goal; margin-top: 0; }
  .brow__bar { grid-area: bar; margin-top: 7px; }
  .brow__annual { display: inline; margin-left: 6px; font-size: 10px; }

  .toplines { margin-top: 10px; gap: 6px; }
  .topline { font-size: 11.5px; }
  .cardhold { margin-top: 10px; }
  .cardhold button { font-size: 12px; gap: 5px; }
  .cardhold em { flex-basis: 100%; font-size: 11px; }

  .ready-card__body { grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 12px; }
  .ready-card__nums > div { padding: 8px 9px; }
  .ready-card__nums dd { font-size: 12.5px; }

  .goal__row { grid-template-columns: minmax(0, 1fr); }
  .goal__calc { flex-direction: column; align-items: stretch; gap: 8px; }
  .goal__calc button { width: 100%; }

  .modal--sheet { max-width: none; max-height: 92vh; }
  .csh__left { font-size: 28px; }
  .csh__list { max-height: 40vh; }
  .csh__actions .primary-btn { flex: 1 1 100%; }
}

@media (max-width: 430px) {
  .brow__name { font-size: 13.5px; }
  .brow__left { font-size: 16px; }
  .brow__annual { font-size: 9.5px; }
  .ready-card__state { font-size: 10.5px; padding: 3px 7px; }
  .csh__row { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 8px; }
}

/* ------------------------------------------------------------
   이번 달 — 요약 세 칸 · 돈봉투 카드 · 바로 붙여넣기
   ------------------------------------------------------------ */

.summary {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  margin: 0 0 24px; background: var(--line); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
}
.sum {
  display: flex; flex-direction: column; gap: 1px; align-items: flex-start;
  padding: 11px 14px; border: 0; background: var(--surface); text-align: left;
}
.sum:hover { background: var(--paper); }
.sum__label { font-size: 10.5px; color: var(--ink-4); line-height: 1.4; }
.sum__value {
  font-size: 16px; font-weight: 600; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; line-height: 1.3;
}
.sum__note { font-size: 10.5px; color: var(--ink-3); line-height: 1.45; }
.sum.is-over .sum__value { color: var(--over); }

.envelopes { margin-top: 2px; }
.envelopes__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.env {
  position: relative; display: flex; flex-direction: column; gap: 3px;
  min-height: 120px; padding: 12px 13px 11px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
}
.env:hover { border-color: var(--line-strong); background: #fffdf7; transform: translateY(-1px); }
.env:active { transform: none; }
.env__top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.env__emoji { font-size: 15px; line-height: 1; flex: none; }
.env__name {
  min-width: 0; font-size: 12.5px; font-weight: 600; letter-spacing: -0.012em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.env__flap {
  display: block; height: 5px; margin: 5px 1px 3px;
  border-top: 1px dashed var(--line-strong);
  border-radius: 60% 60% 0 0 / 100% 100% 0 0;
  opacity: 0.75;
}
.env__left {
  font-size: 21px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.env__left em {
  margin-left: 2px; font-style: normal; font-size: 10.5px; font-weight: 500;
  color: var(--ink-4); letter-spacing: 0;
}
.env__left.is-neg { color: var(--over); }
.env__bar {
  display: block; height: 3px; margin-top: 3px; border-radius: 2px;
  background: var(--line-2); overflow: hidden;
}
.env__bar i { display: block; height: 100%; border-radius: 2px; background: #cec6b6; }
.env.is-over .env__bar i { background: var(--over); }
.env__meta {
  font-size: 10px; color: var(--ink-4); line-height: 1.45;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.env__goal {
  align-self: flex-start; margin-top: 1px; padding: 2px 5px; border-radius: 5px;
  background: var(--accent-tint); color: var(--accent-deep);
  font-size: 10px; line-height: 1.4; font-variant-numeric: tabular-nums;
}
.envelopes__foot { margin-top: 10px; padding: 0 2px; font-size: 11.5px; color: var(--ink-4); }

.qzone {
  margin-top: 26px; padding: 16px 16px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.qzone__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.qzone__head h2 { font-size: 14px; font-weight: 600; letter-spacing: -0.02em; }
.qzone__acts { display: flex; gap: 6px; flex: none; }
.qzone__acts .ghost-btn--sm { padding: 6px 10px; font-size: 11.5px; }
.qzone__area {
  width: 100%; min-height: 76px; resize: vertical; padding: 11px 12px;
  border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--paper);
  font-family: ui-monospace, SFMono-Regular, 'Menlo', 'Consolas', monospace;
  font-size: 11.5px; line-height: 1.75; color: var(--ink-2);
}
.qzone__area::placeholder { color: var(--ink-4); }
.qzone__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 9px; }
.qzone__link {
  border: 0; background: none; padding: 0; font-size: 11.5px; color: var(--ink-4);
  text-decoration: underline; text-underline-offset: 2px;
}
.qzone__link:hover { color: var(--ink-2); }
.qzone__auto {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; color: var(--ink-4);
}
.qzone__auto .icon { color: var(--accent); }
.qzone__privacy { display: flex; gap: 6px; margin-top: 8px; font-size: 10.5px; color: var(--ink-4); line-height: 1.6; }
.qzone__privacy .icon { margin-top: 2px; flex: none; }

.dqp { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.dqp__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12px; }
.dqp__head b { font-weight: 600; }
.dqp__head span { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dqp__list { margin-top: 6px; }
.dqp__list li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: baseline;
  padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 12px;
}
.dqp__name { min-width: 0; overflow-wrap: anywhere; }
.dqp__cat { font-style: normal; font-size: 10.5px; color: var(--ink-4); }
.dqp__amt { font-variant-numeric: tabular-nums; font-weight: 500; }
.dqp__more, .dqp__skip { margin-top: 6px; font-size: 10.5px; color: var(--ink-4); line-height: 1.5; overflow-wrap: anywhere; }
.dqp__foot { display: flex; justify-content: flex-end; margin-top: 10px; }

.danger-btn--sm { padding: 8px 12px; font-size: 12px; margin-right: auto; }

@media (max-width: 760px) {
  .summary { margin-bottom: 18px; }
  .sum { padding: 9px 10px; }
  .sum__note { display: none; }
  .sum__value { font-size: 14px; }
  .envelopes__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .env { min-height: 108px; padding: 11px 11px 10px; }
  .env__left { font-size: 19px; }
  .env__flap { margin: 4px 1px 2px; }
  .envelopes__foot { font-size: 11px; }
  .qzone { margin-top: 20px; padding: 14px 13px 12px; }
  .qzone__auto { margin-left: 0; flex-basis: 100%; }
  .qzone__area { min-height: 72px; font-size: 11px; }
}

@media (max-width: 430px) {
  .sum__label { font-size: 9.5px; }
  .sum__value { font-size: 13px; }
  .env__name { font-size: 12px; }
  .env__left { font-size: 18px; }
  .env__meta { font-size: 9.5px; }
  .qzone__head { flex-wrap: wrap; }
}

/* ------------------------------------------------------------
   선저축 흐름 · 저축 봉투 · 목표 기간(년/개월)
   ------------------------------------------------------------ */

.split { margin: -8px 0 22px; padding: 0 2px; }
.split button {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px;
  border: 0; background: none; padding: 0; text-align: left;
  font-size: 12px; color: var(--ink-3); line-height: 1.5;
}
.split button:hover b { border-bottom: 1px solid var(--line-strong); }
.split__step { display: inline-flex; align-items: baseline; gap: 5px; }
.split__step i {
  font-style: normal; font-size: 9.5px; font-weight: 600; color: var(--accent-deep);
  background: var(--accent-tint); border-radius: 999px; padding: 1px 5px;
}
.split__step b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.split__arrow { color: var(--ink-4); }
.split__note { color: var(--ink-4); font-size: 11px; }

.env__tag {
  flex: none; margin-left: auto; padding: 1px 5px; border-radius: 5px;
  background: var(--accent-tint); color: var(--accent-deep);
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.01em;
}

.chip--saving { color: var(--accent-deep); }
.bt__goal {
  display: block; flex-basis: 100%; margin-top: 1px;
  font-size: 10.5px; color: var(--ink-4); font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.savesteps {
  display: flex; flex-direction: column; gap: 1px; margin-top: 14px;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--line);
}
.savesteps li {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 9px 12px; background: var(--surface);
}
.savesteps li.is-ready { background: var(--accent-tint); }
.savesteps__no {
  font-family: var(--font-hand); font-size: 18px; line-height: 1; color: var(--accent);
}
.savesteps__body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.savesteps__body b { font-size: 12.5px; font-weight: 600; letter-spacing: -0.01em; }
.savesteps__body small { font-size: 10.5px; color: var(--ink-4); }
.savesteps__amt { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.savesteps li.is-ready .savesteps__amt { color: var(--accent-deep); }
.savesteps li.is-ready .savesteps__amt.neg { color: var(--over); }

.goal__term { display: grid; grid-template-columns: minmax(0, 64px) minmax(0, 1fr); gap: 6px; }
.goal__term input {
  width: 100%; height: 38px; padding: 0 8px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); font-size: 13px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.goal__term select {
  height: 38px; width: 100%; padding: 0 6px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); font-size: 12px; color: var(--ink-2);
}
.goal__presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.goal__presets > span { font-size: 10.5px; color: var(--ink-4); margin-right: 2px; }
.goal__chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 4px 10px; font-size: 11px; font-weight: 500; color: var(--ink-2);
}
.goal__chip:hover { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-tint); }
.goal__inst {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end;
  padding-top: 10px; border-top: 1px dashed var(--line);
}
.goal__inst .ghost-btn { height: 38px; white-space: nowrap; }

@media (max-width: 760px) {
  .split { margin-top: -6px; }
  .split button { gap: 5px; font-size: 11.5px; }
  .split__note { flex-basis: 100%; }
  .savesteps li { padding: 8px 10px; gap: 8px; }
  .savesteps__body b { font-size: 12px; }
  .savesteps__amt { font-size: 12.5px; }
  .goal__presets { gap: 5px; }
  .goal__chip { padding: 4px 8px; font-size: 10.5px; }
  .goal__inst { grid-template-columns: minmax(0, 1fr); }
  .goal__inst .ghost-btn { width: 100%; }
}

/* ------------------------------------------------------------
   모임 회비 모드 · 사진(OCR) · 요금 안내
   ------------------------------------------------------------ */

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 15px; border: 1px solid var(--accent); border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 600;
}
.btn-primary:hover { background: var(--accent-deep); }

.mode-card { margin-bottom: 16px; }
.mode-switch {
  display: inline-flex; gap: 3px; margin-top: 12px; padding: 3px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.mode-switch button {
  border: 0; background: none; padding: 7px 16px; border-radius: 7px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-3); white-space: nowrap;
}
.mode-switch button:hover { color: var(--ink); }
.mode-switch button.is-on { background: var(--ink); color: #fff; font-weight: 600; }
.mode-card__note { margin-top: 9px; font-size: 11px; color: var(--ink-4); }

.card__head-actions { display: flex; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; }

.clubhead { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; margin-top: 4px; }
.clubhead__badge {
  padding: 4px 10px; border-radius: 999px; background: var(--accent-tint);
  color: var(--accent-deep); font-size: 11.5px; font-weight: 600;
}
.clubhead span:last-child { font-size: 10.5px; color: var(--ink-4); }

.clubbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -6px 0 20px; padding: 0 2px; }
.clubbar__btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px; border: 1px solid var(--accent); border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 600;
}
.clubbar__btn:hover { background: var(--accent-deep); }
.clubbar__link {
  border: 0; background: none; padding: 2px 0; font-size: 11.5px; color: var(--ink-3);
  text-decoration: underline; text-underline-offset: 2px;
}
.clubbar__note { font-size: 11px; color: var(--ink-4); }

.club-share__dues {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  margin: 14px 0 6px; background: var(--line); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden;
}
.club-share__dues > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 13px; background: var(--surface); }
.club-share__dues span { font-size: 10.5px; color: var(--ink-4); }
.club-share__dues b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.member--club { grid-template-columns: minmax(0, 1fr) 76px auto; }
.member-add { display: flex; gap: 8px; margin-top: 12px; }
.member-add input {
  flex: 1 1 auto; min-width: 0; height: 34px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 12.5px;
}
.club-share__preview { margin-top: 16px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.club-share__preview header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.club-share__preview header b { font-size: 12.5px; font-weight: 600; }
.share-text {
  width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; line-height: 1.7; color: var(--ink-2); white-space: pre-wrap;
  resize: vertical; overflow-wrap: anywhere;
}
.share-text--inline { margin: 0; max-height: 260px; overflow-y: auto; }
.club-share__note { margin-top: 10px; font-size: 11px; line-height: 1.6; }

.ocr-note {
  margin-top: 8px; padding: 7px 10px; border-radius: 8px;
  background: var(--accent-tint); color: var(--accent-deep);
  font-size: 11.5px; font-variant-numeric: tabular-nums;
}
label.clip-btn { cursor: pointer; }

@media (max-width: 760px) {
  .clubhead { align-items: flex-start; margin-top: 0; }
  .clubbar { margin-top: -2px; }
  .clubbar__btn { flex: 1 1 auto; justify-content: center; }
  .clubbar__note { flex-basis: 100%; }
  .club-share__dues { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .club-share__dues b { font-size: 13px; }
  .member--club { grid-template-columns: minmax(0, 1fr) auto; }
  .member--club .member__num { display: none; }
  .member-add { flex-wrap: wrap; }
  .member-add input { flex-basis: 100%; }
  .mode-switch { width: 100%; }
  .mode-switch button { flex: 1 1 0; padding: 8px 6px; }
  .card__head:has(.card__head-actions) { flex-direction: column; align-items: stretch; }
  .card__head:has(.card__head-actions) > div:first-child { flex: 0 0 auto; }
  .card__head-actions { width: 100%; justify-content: flex-start; }
}


/* ============================================================
   + 플로팅 빠른 입력 · 액션 시트 · 내보내기 · 강조 색상
   ============================================================ */

.fab {
  position: fixed; right: 20px; bottom: 24px; z-index: 70;
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--accent); color: #fff;
  box-shadow: 0 14px 26px -12px rgba(32, 30, 26, 0.6), 0 2px 6px rgba(32, 30, 26, 0.12);
  transition: transform 0.14s ease, background 0.14s ease;
}
.fab:hover { background: var(--accent-deep); }
.fab:active { transform: scale(0.95); }
.fab:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
body.is-locked .fab { opacity: 0; pointer-events: none; }

@media (max-width: 760px) {
  .fab {
    right: 14px; width: 50px; height: 50px;
    bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom, 0px));
  }
  /* 내역·설정 — 우하단 + 가 행 삭제 아이콘·예산 + 버튼을 가리지 않게 숨기고 여백도 줄인다 */
  body.is-nofab .fab { display: none; }
  body.is-nofab .main { padding-bottom: calc(var(--tabbar-h) + 44px + env(safe-area-inset-bottom, 0px)); }
}

.modal--qsheet { max-width: 440px; padding: 22px 22px 18px; }
.modal--qsheet .modal__foot { margin-top: 10px; }
.qsheet__head h3 {
  font-family: var(--font-hand); font-size: 26px; font-weight: 400;
  line-height: 1.25; margin: 4px 0 6px; letter-spacing: 0.005em;
}
.qsheet__head p { font-size: 12px; color: var(--ink-3); line-height: 1.65; }
.qsheet__list { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 4px; }
.qsheet__item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); transition: background 0.14s ease, border-color 0.14s ease;
}
.qsheet__item:hover { background: var(--paper); border-color: var(--line-strong); }
.qsheet__emoji { flex: none; font-size: 21px; line-height: 1; }
.qsheet__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.qsheet__body b { font-size: 13.5px; font-weight: 600; letter-spacing: -0.02em; }
.qsheet__body small { font-size: 11.5px; color: var(--ink-3); }

.modal-backdrop.is-sheet { align-items: end; }
@media (min-width: 761px) {
  .modal-backdrop.is-sheet { align-items: center; padding: 20px; }
}
@media (max-width: 760px) {
  .modal-backdrop.is-sheet { align-items: end; padding: 0; }
  .modal--qsheet {
    max-width: none; border-radius: 18px 18px 0 0;
    padding: 18px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    animation: sheetUp 0.18s cubic-bezier(0.2, 0.9, 0.3, 1);
  }
  @keyframes sheetUp { from { opacity: 0.5; transform: translateY(18px); } to { opacity: 1; transform: none; } }
}

.toast--progress { background: var(--accent-deep); }

/* 강조 색상 — 설정 › 데이터 */
.accent__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.accent__chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font-size: 12.5px; color: var(--ink-2);
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}
.accent__chip:hover { border-color: var(--line-strong); }
.accent__chip.is-on { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-deep); font-weight: 600; }
.accent__dot { width: 14px; height: 14px; border-radius: 50%; background: var(--dot); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }

/* 사용법 — 핵심 4장 */
.guide--slim { max-width: 780px; }
.gcards { display: grid; gap: 14px; margin: 22px 0 0; }
.gcard {
  padding: 20px 20px 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px;
}
.gcard__head { display: flex; align-items: flex-start; gap: 12px; }
.gcard__no {
  flex: none; width: 27px; height: 27px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-tint); color: var(--accent-deep);
  font-family: var(--font-hand); font-size: 18px; line-height: 1;
}
.gcard__head h2 { font-family: var(--font-hand); font-size: 24px; font-weight: 400; line-height: 1.25; letter-spacing: 0.005em; }
.gcard__head p { margin-top: 2px; font-size: 12px; color: var(--ink-3); line-height: 1.6; }
.gsteps { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.gsteps li { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 10px; background: var(--paper); }
.gsteps b { font-size: 13px; font-weight: 600; letter-spacing: -0.02em; }
.gsteps span { font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }
.gsteps span b { font-size: inherit; color: var(--ink); }
.gtips { margin-top: 12px; }
.gtips li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.gtips li:last-child { border-bottom: 0; padding-bottom: 2px; }
.gtips__icon { font-size: 17px; line-height: 1.45; }
.gtips li div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gtips b { font-size: 13px; font-weight: 600; letter-spacing: -0.02em; }
.gtips span { font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }
.gtips span b { color: var(--ink); }
.glist { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.glist li { position: relative; padding-left: 12px; font-size: 12.5px; line-height: 1.72; color: var(--ink-2); }
.glist li::before { content: ''; position: absolute; left: 2px; top: 9px; width: 4px; height: 4px; border-radius: 50%; background: var(--ink-4); }
.glist b { margin-right: 3px; color: var(--ink); font-weight: 600; }
.gcard__cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.gcard__cta--center { justify-content: center; margin-top: 18px; }
.guide__privacy { margin-top: 20px; }

@media (min-width: 761px) {
  .gcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gcard { display: flex; flex-direction: column; }
  .gcard__cta { margin-top: auto; padding-top: 14px; }
}

/* 빠른 입력 미리보기 — 읽은 방식 표시 */
.qp__mode {
  font-style: normal; font-size: 10.5px; padding: 2px 7px; border-radius: 999px;
  background: var(--accent-tint); color: var(--accent-deep);
}

/* 인쇄용 리포트 (PDF) */
.modal--print { max-width: 760px; }
.preport { font-size: 12px; color: var(--ink); }
.preport__head { padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.preport__eyebrow { font-size: 10.5px; letter-spacing: 0.06em; color: var(--ink-3); }
.preport h1 { font-family: var(--font-hand); font-size: 30px; font-weight: 400; line-height: 1.3; margin: 6px 0 4px; }
.preport__meta { font-size: 11px; color: var(--ink-3); }
.preport__sum {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); margin: 16px 0 20px;
}
.preport__sum > div { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; background: var(--surface); }
.preport__sum span { font-size: 10px; color: var(--ink-3); }
.preport__sum b { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.preport h2 {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 13px; font-weight: 600; margin: 18px 0 8px;
  padding-bottom: 4px; border-bottom: 1px solid var(--line-strong);
}
.preport h2 small { font-size: 10.5px; font-weight: 400; color: var(--ink-3); }
.preport__table { width: 100%; border-collapse: collapse; font-size: 11px; }
.preport__table th, .preport__table td { padding: 5px 6px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-2); }
.preport__table th { font-weight: 600; color: var(--ink-3); background: var(--paper); border-bottom: 1px solid var(--line); white-space: nowrap; }
.preport__table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.preport__table tfoot td { font-weight: 600; border-top: 1px solid var(--line-strong); }
.preport__note { margin-top: 6px; font-size: 10px; line-height: 1.6; color: var(--ink-3); }
.preport__table td.memo { max-width: 150px; color: var(--ink-3); }
.preport__empty { padding: 12px 0; font-size: 12px; color: var(--ink-3); }
.preport__foot { margin-top: 18px; font-size: 10px; color: var(--ink-4); }
.preport__actions { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  .modal--print { padding: 16px; }
  .preport__sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preport__table { font-size: 10px; }
}

@media print {
  body { background: #fff !important; }
  body > *:not(#modalRoot) { display: none !important; }
  #modalRoot .modal-backdrop {
    position: static !important; display: block !important;
    background: #fff !important; padding: 0 !important; animation: none !important;
  }
  #modalRoot .modal { box-shadow: none !important; animation: none !important; border-radius: 0 !important; }
  #modalRoot .modal--print { width: 100% !important; max-width: none !important; max-height: none !important; overflow: visible !important; padding: 0 !important; }
  .preport__actions { display: none !important; }
  .preport__sum > div { background: #fff !important; }
  .preport__table tr { break-inside: avoid; }
  .preport h2 { break-after: avoid; }
  @page { margin: 14mm; }
}

/* ============================================================
   사용법 — 돈봉투 가계부 5대 장점 · 한 달 운영 흐름 5단계
   ============================================================ */

.merits { margin-top: 26px; }
.merits__head h2 {
  font-family: var(--font-hand); font-size: 28px; font-weight: 400;
  line-height: 1.3; letter-spacing: 0.005em; color: var(--ink);
}
.merits__head p { margin-top: 6px; font-size: 13px; line-height: 1.8; color: var(--ink-3); }
.merits__head p b { color: var(--ink-2); font-weight: 600; }
.merits__list { display: grid; gap: 9px; margin-top: 14px; }
.merit {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px;
  padding: 15px 16px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px;
}
.merit__no {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-tint); color: var(--accent-deep);
  font-family: var(--font-hand); font-size: 19px; line-height: 1;
}
.merit__title { display: block; font-size: 14.5px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.45; }
.merit__desc { margin-top: 4px; font-size: 12.5px; line-height: 1.75; color: var(--ink-2); }
.merit__link {
  display: inline-flex; align-items: center; gap: 3px; margin-top: 9px;
  padding: 4px 10px; border: 0; border-radius: 999px;
  background: var(--paper-2); color: var(--accent-deep);
  font-size: 11px; font-weight: 500; letter-spacing: -0.01em;
}
.merit__link:hover { background: var(--accent-tint); }
.merit__link .icon { color: var(--accent); }

.flow {
  margin-top: 30px; padding: 20px 18px 18px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
}
.flow__head h2 {
  font-family: var(--font-hand); font-size: 27px; font-weight: 400;
  line-height: 1.3; letter-spacing: 0.005em;
}
.flow__head p { margin-top: 5px; font-size: 12.5px; line-height: 1.75; color: var(--ink-3); }
.flow__list { margin-top: 15px; }
.flow__step {
  position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr);
  gap: 11px; padding-bottom: 15px;
}
.flow__step:last-child { padding-bottom: 0; }
.flow__step::before {
  content: ''; position: absolute; left: 14px; top: 30px; bottom: 2px;
  width: 1px; background: var(--line-strong);
}
.flow__step:last-child::before { display: none; }
.flow__no {
  position: relative; z-index: 1; display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--accent-deep); font-family: var(--font-hand); font-size: 17px; line-height: 1;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.flow__body b {
  display: block; padding-top: 3px;
  font-size: 13.5px; font-weight: 600; letter-spacing: -0.02em;
}
.flow__desc { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }
.flow__note {
  display: inline-block; margin-top: 5px; font-style: normal;
  font-size: 11px; color: var(--ink-4);
}
.flow__step.is-flash .flow__no {
  background: var(--accent); color: #fff; border-color: transparent;
  box-shadow: 0 0 0 4px var(--accent-tint);
}
.flow__step.is-flash .flow__body b { color: var(--accent-deep); }
.flow__rule {
  margin-top: 16px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.flow__rule b { display: block; font-size: 12.5px; line-height: 1.7; color: var(--accent-deep); }
.flow__rule span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ink-3); }
.flow__cta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }

@media (min-width: 761px) {
  .merits__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .merit:last-child { grid-column: 1 / -1; }
  .gcards > li:last-child { grid-column: 1 / -1; }
}

/* ============================================================
   이번 달 — 카드값(사용액·확보액) 칸 · 남은 돈 계산 줄
   ============================================================ */

.sum__reserve {
  display: block; margin-top: 2px;
  font-size: 10.5px; font-weight: 500; line-height: 1.45;
  color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.sum__reserve.is-ok { color: var(--accent-deep); }
.sum__reserve.is-short { color: var(--warn); }
.sum__reserve.is-none { color: var(--ink-4); }

/* 카드값 설명 — 두 숫자(사용액 · 확보액)를 나란히 */
.cardbil { display: grid; gap: 8px; margin-top: 12px; }
.cardbil__box { padding: 12px 13px 11px; background: var(--paper); border-radius: 10px; }
.cardbil__box--reserve { background: var(--accent-tint); }
.cardbil__label { display: block; font-size: 11px; color: var(--ink-3); }
.cardbil__label em { font-style: normal; color: var(--ink-4); }
.cardbil__value {
  display: block; margin-top: 3px; font-size: 21px; font-weight: 600;
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.25;
}
.cardbil__note { display: block; margin-top: 2px; font-size: 11px; line-height: 1.6; color: var(--ink-3); }
.cardbil__diff { font-size: 12px; font-weight: 500; color: var(--ink-3); padding-left: 2px; }
.cardbil__diff.is-short { color: var(--warn); }
.cardbil__diff.is-ok { color: var(--accent-deep); }
.cardbil__form {
  display: grid; gap: 9px; margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line-2);
}
.cardbil__acts { display: flex; flex-wrap: wrap; gap: 7px; }
.cardbil__save { justify-self: start; }

.modal__muted { color: var(--ink-4); font-size: 11.5px; }

/* ============================================================
   설정 — 예산 봉투 +/− 조작 · 새 봉투 / 봉투 지우기
   ============================================================ */

.stepchips {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin: 12px 0 2px; padding: 9px 11px;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 10px;
}
.stepchips__label { font-size: 11px; color: var(--ink-4); }
.stepchips__chip {
  padding: 5px 11px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink-2);
  font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.stepchips__chip:hover { border-color: var(--accent); color: var(--accent-deep); }
.stepchips__chip.is-on {
  background: var(--accent); border-color: transparent; color: #fff;
}
.stepchips__hint { margin-left: auto; font-size: 11px; color: var(--ink-4); }
.stepchips__hint b { color: var(--ink-2); font-weight: 600; padding: 0 1px; }

.stepbox { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.stepbox .money-field { flex: 1; max-width: none; margin: 0; min-width: 0; }
.stepbox .money-field input { padding: 0 17px 0 5px; font-size: 12px; letter-spacing: -0.02em; }
.stepbox .money-field span { right: 5px; font-size: 10px; }
.stepbox__btn {
  flex: none; width: 27px; height: 27px; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 17px; font-weight: 600; line-height: 1;
  transition: transform 0.08s ease, background 0.14s ease, border-color 0.14s ease;
}
.stepbox__btn:active { transform: scale(0.92); }
.stepbox__btn--minus {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
}
.stepbox__btn--minus:hover { border-color: var(--ink-3); color: var(--ink); background: var(--paper); }
.stepbox__btn--plus {
  border: 1px solid transparent; background: var(--accent); color: #fff;
  box-shadow: 0 1px 0 rgba(32, 30, 26, 0.08);
}
.stepbox__btn--plus:hover { background: var(--accent-deep); }

/* 예산 표 — 봉투 이름과 −/+ 가 자리를 나눠 갖도록 열 너비를 다시 잡는다 */
.budget-table th:nth-child(1) { width: 27%; }
.budget-table th:nth-child(2) { width: 27%; }
.budget-table th:nth-child(3), .budget-table th:nth-child(4) { width: 11%; }
.budget-table th:nth-child(5) { width: 92px; }
.budget-table .bt__input { min-width: 176px; }
.budget-table .bt__name { gap: 6px; }
.bt__goal { display: block; flex-basis: 100%; }
.bt__head { display: flex; align-items: center; flex-wrap: nowrap; gap: 4px 6px; min-width: 0; }
.bt__head .chip { overflow: hidden; text-overflow: ellipsis; }
.bt__label { min-width: 0; white-space: nowrap; }
.bt__acts { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: none; }
.bt__act {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 6px; border-radius: 7px; line-height: 1;
  font-size: 10px; font-weight: 500; white-space: nowrap;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-3);
}
.bt__act em { font-style: normal; }
.bt__act--edit:hover { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-tint); }
.bt__act--del { font-size: 12px; padding: 3px 6px; }
.bt__act--del:hover { border-color: var(--over); color: var(--over); background: var(--over-tint); }
.card__head-actions .primary-btn--sm { white-space: nowrap; }

@media (max-width: 760px) {
  .merits__head h2 { font-size: 25px; }
  .flow { padding: 17px 15px 15px; }
  .flow__head h2 { font-size: 24px; }
  .stepchips { gap: 5px; padding: 8px 10px; }
  .stepchips__hint { flex-basis: 100%; margin-left: 0; }

  /* 봉투 줄 — 이름 / − ＋ / 사용가능 · 이월 */
  .budget-table tr {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 7px; padding: 11px 0;
  }
  .budget-table .bt__name { grid-column: 1; grid-row: 1; }
  .budget-table .bt__input { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
  .budget-table td:nth-child(4) { grid-column: 1; grid-row: 3; }
  .budget-table td:nth-child(5) { grid-column: 2; grid-row: 3; }
  .stepbox { justify-content: stretch; gap: 6px; }
  .stepbox__btn { width: 40px; height: 40px; font-size: 20px; border-radius: 10px; }
  .stepbox .money-field { flex: 1; }
  .bt__acts { gap: 5px; }
  .bt__act { min-height: 30px; padding: 5px 9px; font-size: 11.5px; border-radius: 8px; }
  .bt__act--del { min-height: 30px; padding: 5px 8px; font-size: 13px; }
  .bt__name { flex-wrap: wrap; row-gap: 4px; }
  .card__head-actions { justify-content: flex-start; }
  .cardbil__value { font-size: 19px; }
}

/* ============================================================
   미배정 — 마이너스 경고 줄 · 설정 예산의 실시간 미배정
   ============================================================ */

.overbanner { margin: -10px 0 18px; }
.overbanner button {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 11px 14px; text-align: left;
  border: 1px solid #ecd6cf; border-radius: 11px; background: var(--over-tint);
  color: var(--over);
}
.overbanner button:hover { border-color: var(--over); }
.overbanner--income button { border-color: var(--line); background: var(--paper-2); color: var(--ink-2); }
.overbanner--income button:hover { border-color: var(--accent); }
.overbanner__text { font-size: 12.5px; font-weight: 500; }
.overbanner__text b { font-weight: 600; font-variant-numeric: tabular-nums; }
.overbanner__cta {
  display: inline-flex; align-items: center; gap: 3px; flex: none;
  font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px;
}

/* 설정 › 예산 — 실시간 미배정 */
.ready-live {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px;
  margin-top: 14px; padding: 13px 15px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper);
}
.ready-live__label { font-size: 11px; color: var(--ink-4); }
.ready-live__num {
  font-size: 24px; font-weight: 700; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.ready-live__note { font-size: 12px; color: var(--ink-3); }
.ready-live.is-over { background: var(--over-tint); border-color: #ecd6cf; }
.ready-live.is-over .ready-live__num { color: var(--over); }
.ready-live.is-over .ready-live__note { color: var(--over); }
.ready-live.is-ok { background: var(--accent-tint); border-color: #dbe6e1; }
.ready-live.is-ok .ready-live__num { color: var(--accent-deep); }
.ready-live.is-ok .ready-live__note { color: var(--accent-deep); }
.ready-live.is-plus .ready-live__num { color: var(--warn); }

/* 예산 표 위에 붙어 있는 미배정 띠 — 스크롤해도 보인다 */
.budget-live {
  position: sticky; top: calc(var(--header-h) + 6px); z-index: 8;
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 9px;
  margin: 12px -26px 0; padding: 8px 26px;
  background: var(--surface); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
}
.budget-live__label { font-size: 10.5px; color: var(--ink-4); }
.budget-live__num {
  font-size: 15px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.budget-live__note { font-size: 11px; color: var(--ink-3); }
.budget-live.is-over { background: var(--over-tint); border-color: #ecd6cf; }
.budget-live.is-over .budget-live__num, .budget-live.is-over .budget-live__note { color: var(--over); }
.budget-live.is-ok { background: var(--accent-tint); }
.budget-live.is-ok .budget-live__num, .budget-live.is-ok .budget-live__note { color: var(--accent-deep); }
.budget-live.is-plus .budget-live__num { color: var(--warn); }

@media (max-width: 760px) {
  .budget-live { margin: 12px -16px 0; padding: 8px 16px; }
  .ready-live { padding: 11px 13px; }
  .ready-live__num { font-size: 21px; }
  .overbanner button { flex-direction: column; align-items: flex-start; gap: 4px; }
}

@media (max-width: 430px) {
  .budget-live { margin: 12px -14px 0; padding: 8px 14px; }
}

.flow__hint {
  margin-top: 10px; font-size: 11.5px; line-height: 1.75; color: var(--ink-3);
}
.flow__hint b { color: var(--ink-2); font-weight: 600; }

/* 모바일 — 아래쪽 플로팅 + 가 마지막 봉투 줄을 가리지 않도록 여백을 더 준다 */
@media (max-width: 760px) {
  .main { padding-bottom: calc(var(--tabbar-h) + 118px); }
  /* 봉투 변경·지우기를 손가락으로 누르기 쉽게 */
  .bt__act { min-height: 34px; padding: 6px 10px; font-size: 12px; }
  .bt__act--del { min-height: 34px; padding: 6px 9px; font-size: 14px; }
  .bt__act .icon { width: 14px; height: 14px; }
}

/* ============================================================
   v3 — 이번 달 상단 전환 · 내 돈 여유 · 3단계 예산 · 접히는 사용법
   ============================================================ */

/* 이번 달 — 함께/나/배우자를 오른쪽 위로 컴팩트하게 */
.balance__top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.who--compact { margin-top: 0; padding: 2px; border-radius: 8px; }
.who--compact button { padding: 5px 11px; font-size: 11.5px; border-radius: 6px; }
@media (max-width: 760px) {
  .balance__top { gap: 10px; }
  .who--compact { align-self: flex-start; }
  .who--compact button { padding: 5px 9px; font-size: 11px; }
}

/* 내 돈 여유 — 좋다/나쁘다가 한 줄로 보이게 */
.sum__note--live { font-weight: 500; }
.sum__note--live.is-good { color: var(--accent-deep); }
.sum__note--live.is-tight { color: var(--warn); }
.sum__calc {
  display: block; margin-top: 3px; font-size: 10px; line-height: 1.45;
  color: var(--ink-4); font-variant-numeric: tabular-nums;
}
@media (max-width: 760px) {
  .sum__note--live { display: block; font-size: 10px; }
  .sum__calc { font-size: 9.5px; }
}

/* 예산 3단계 한 줄 */
.split--three button { gap: 5px; }
.split--three .split__step { font-size: 11.5px; }
@media (max-width: 760px) {
  .split--three button { row-gap: 2px; }
  .split--three .split__step b { font-size: 11px; }
}

/* 설정 › 예산 — 수입 + 이월 = 사용 가능 */
.formula {
  display: grid; grid-template-columns: minmax(0, 1.05fr) 14px minmax(0, 1fr) 14px minmax(0, 1.1fr);
  gap: 6px; align-items: stretch; margin-top: 14px;
}
.formula__box {
  display: flex; flex-direction: column; gap: 4px; justify-content: center;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface);
  min-width: 0;
}
.formula__box--total { background: var(--accent-tint); border-color: rgba(47, 79, 79, 0.28); }
.formula__label { font-size: 10.5px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.formula__tag { font-style: normal; font-size: 9.5px; padding: 1px 5px; border-radius: 5px; background: var(--paper-2); color: var(--ink-4); }
.formula__tag.is-manual { background: var(--warn-tint); color: var(--warn); }
.formula__num { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.3; }
.formula__sub { font-size: 10px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.formula__box--total .formula__num { color: var(--accent-deep); }
.formula__acts { display: flex; gap: 6px; flex-wrap: wrap; }
.formula__edit {
  border: 0; background: none; padding: 0; font-size: 10.5px; color: var(--accent-deep);
  text-decoration: underline; text-underline-offset: 2px;
}
.formula__op { display: grid; place-items: center; color: var(--ink-4); font-size: 14px; }
.formula .money-field input { height: 32px; font-size: 14px; font-weight: 600; }
.formula .money-field input::placeholder { font-size: 11.5px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink-4); }
@media (max-width: 760px) {
  .formula { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .formula__op { display: none; }
  .formula__box--total { grid-column: 1 / -1; }
  .formula__num { font-size: 15px; }
}

/* 설정 › 예산 — 1·2·3순위 묶음 행 */
.budget-table tr.tier-head td {
  padding: 15px 2px 7px; border: 0; background: transparent;
}
.budget-table tr.tier-head:first-child td { padding-top: 4px; }
.tier-head { display: table-row; }
.tier-head > td { display: flex; align-items: center; gap: 9px; }
.tier-head__no {
  flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-tint); color: var(--accent-deep);
  font-family: var(--font-hand); font-size: 15px; line-height: 1;
}
.tier-head__body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.tier-head__body b { font-size: 12.5px; font-weight: 600; letter-spacing: -0.01em; }
.tier-head__body small { font-size: 10.5px; color: var(--ink-4); }
.tier-head__amt { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.budget-table tr.tier-empty td { padding: 10px 2px 12px; font-size: 11.5px; color: var(--ink-4); border-bottom: 1px solid var(--line-2); }
.budget-table tr.tier-empty b { color: var(--ink-2); }
.bt__branch { color: var(--ink-4); font-size: 11px; }
.bt__parent { display: block; flex-basis: 100%; font-size: 10px; color: var(--ink-4); }
.budget-row.is-child .bt__label { font-weight: 400; }
.chip--nocar { color: var(--ink-4); }
@media (max-width: 760px) {
  .budget-table tr.tier-head { display: block; padding: 0; border-bottom: 0; }
  .budget-table tr.tier-head td { display: flex; padding: 14px 0 6px; }
  .budget-table tr.tier-empty { display: block; }
  .budget-table tr.tier-empty td { display: block; padding: 8px 0 12px; }
}

/* 설정 › 분류 규칙 — 순서 바꾸기 */
.rule-card__move { display: inline-flex; align-items: center; gap: 2px; }
.icon-btn--sm { width: 24px; height: 24px; border-radius: 6px; }
.rule-card__none { margin: 8px 0; font-size: 11px; line-height: 1.6; color: var(--ink-4); }

/* 설정 › 공유 · 모임 회비 납부 */
.dues-list { display: flex; flex-direction: column; margin: 12px 0 4px; }
.dues-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) 92px 54px auto;
  align-items: center; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--line-2);
}
.dues-list li:first-child { border-top: 0; }
.dues-list__who { display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 0; }
.dues-list__who input { width: 16px; height: 16px; accent-color: var(--accent); }
.dues-list__name { font-size: 13px; font-weight: 500; }
.dues-list__amt { text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.dues-list__state { font-size: 11px; color: var(--ink-4); text-align: right; }
.dues-list li.is-paid .dues-list__state { color: var(--accent-deep); font-weight: 600; }
.dues-list li.is-unpaid .dues-list__state { color: var(--warn); font-weight: 600; }
.club-share__unpaid { margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.club-share__unpaid b { color: var(--warn); }
@media (max-width: 760px) {
  .dues-list li { grid-template-columns: minmax(0, 1fr) auto auto; }
  .dues-list__amt { display: none; }
}

/* 이번 달 — 모임 회비 현황(미납자 중심 · 실시간) */
.clubhome {
  margin: 0 0 22px; padding: 16px 17px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.clubhome__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.clubhome__head h2 { font-size: 14px; font-weight: 600; letter-spacing: -0.02em; }
.clubhome__live { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; color: var(--accent-deep); }
.clubhome__dues {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  margin: 12px 0 4px; background: var(--line); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden;
}
.clubhome__dues > div { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px; background: var(--surface); }
.clubhome__dues span { font-size: 10px; color: var(--ink-4); }
.clubhome__dues b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.clubhome__members { margin-top: 8px; }
.clubhome__members li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 2px; border-bottom: 1px solid var(--line-2); font-size: 12.5px;
}
.clubhome__members li:last-child { border-bottom: 0; }
.clubhome__members label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.clubhome__members input { width: 15px; height: 15px; accent-color: var(--accent); }
.clubhome__members em { font-style: normal; font-size: 11px; color: var(--ink-4); }
.clubhome__members li.is-paid em { color: var(--accent-deep); font-weight: 600; }
.clubhome__members li.is-unpaid em { color: var(--warn); font-weight: 600; }
.clubhome__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.clubhome__preview { margin-top: 12px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.clubhome__preview summary { cursor: pointer; font-size: 11.5px; color: var(--ink-3); }
.clubhome__preview[open] summary { margin-bottom: 8px; }

/* 사용법 — 접히는 안내 */
.acc { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.acc__item { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.acc__item > summary {
  display: flex; align-items: center; gap: 11px; padding: 15px 17px; cursor: pointer;
  list-style: none;
}
.acc__item > summary::-webkit-details-marker { display: none; }
.acc__item > summary .icon { margin-left: auto; color: var(--ink-4); transition: transform 0.16s ease; flex: none; }
.acc__item[open] > summary .icon { transform: rotate(90deg); }
.acc__no {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-tint); color: var(--accent-deep);
  font-family: var(--font-hand); font-size: 17px; line-height: 1;
}
.acc__title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.acc__title b { font-family: var(--font-hand); font-size: 21px; font-weight: 400; letter-spacing: 0.005em; line-height: 1.3; }
.acc__title small { font-size: 11px; color: var(--ink-4); }
.acc__body { padding: 0 17px 18px; }
.acc__body .merits__list { margin-top: 2px; }
.acc__body .flow__list { margin-top: 2px; }
.acc__body .gsteps { margin-top: 0; }
.feat { display: flex; flex-direction: column; gap: 16px; }
.feat__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.feat__head b { font-size: 13.5px; font-weight: 600; letter-spacing: -0.02em; }
.feat__ico {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent-tint); color: var(--accent-deep); flex: none;
}
.feat .glist { margin-top: 0; gap: 6px; }
@media (max-width: 760px) {
  .acc__item > summary { padding: 13px 14px; gap: 9px; }
  .acc__title b { font-size: 19px; }
  .acc__title small { font-size: 10.5px; }
  .acc__body { padding: 0 14px 15px; }
  .acc__body .merits__list { grid-template-columns: minmax(0, 1fr); }
}

/* 사용법 — 프라이버시 & 데이터 */
.privacy-sec {
  margin-top: 26px; padding: 18px 18px 16px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
}
.privacy-sec__head h2 { font-family: var(--font-hand); font-size: 24px; font-weight: 400; line-height: 1.3; }
.privacy-sec__head p { margin-top: 3px; font-size: 12px; color: var(--ink-3); }
.privacy-sec__list { display: flex; flex-direction: column; gap: 7px; margin: 12px 0 14px; }
.privacy-sec__list li { position: relative; padding-left: 12px; font-size: 12px; line-height: 1.7; color: var(--ink-2); }
.privacy-sec__list li::before { content: ''; position: absolute; left: 2px; top: 9px; width: 4px; height: 4px; border-radius: 50%; background: var(--ink-4); }
.privacy-sec__list b { color: var(--ink); font-weight: 600; margin-right: 3px; }
.privacy-sec__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.privacy-sec__note { display: flex; gap: 6px; margin-top: 11px; font-size: 11px; color: var(--ink-4); line-height: 1.6; }
.privacy-sec__note .icon { margin-top: 1px; flex: none; }
.privacy-sec__note b { color: var(--ink-2); }
.guide__foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2);
  font-size: 11.5px; color: var(--ink-4);
}
.guide__foot a { color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }
.guide__foot a:hover { color: var(--ink); }
.linkbtn--inline { padding: 0; font-size: 11.5px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }

/* 가져오기 — 저장 전 수정 가능한 미리보기 */
.pv2__defaults {
  display: flex; flex-wrap: wrap; align-items: center; gap: 9px;
  margin-top: 12px; padding: 10px 12px; background: var(--paper);
  border: 1px solid var(--line-2); border-radius: 10px;
}
.pv2__defaults-label { font-size: 11px; color: var(--ink-4); }
.pv2__defaults-hint { font-size: 10.5px; color: var(--ink-4); }
.pv2__hint { display: flex; align-items: flex-start; gap: 5px; margin-top: 9px; font-size: 11px; color: var(--ink-3); line-height: 1.6; }
.pv2__hint .icon { margin-top: 1px; flex: none; color: var(--accent); }
.pv2__hint b { color: var(--ink-2); }
.pv2 { display: flex; flex-direction: column; margin-top: 8px; }
.pv2__row {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line-2); align-items: start;
}
.pv2__row:last-child { border-bottom: 0; }
.pv2__row.is-duplicate { opacity: 0.55; }
.pv2__row.is-off { opacity: 0.5; }
.pv2__check { padding-top: 8px; }
.pv2__check input { width: 16px; height: 16px; accent-color: var(--accent); }
.pv2__main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pv2__line1 { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 8px; }
.pv2__merchant {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); font-size: 13px; font-weight: 500;
}
.pv2__amount { min-width: 0; }
.pv2__amount input { height: 34px; font-size: 13px; font-weight: 600; text-align: right; padding: 0 22px 0 8px; }
.pv2__line2 { display: grid; grid-template-columns: 136px 104px minmax(0, 1fr) 92px; gap: 8px; }
.pv2__date, .pv2__sel { height: 32px; font-size: 11.5px; padding: 0 6px; }
.pv2__date { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.pv2__meta { display: flex; flex-wrap: wrap; gap: 5px; }
.pv2__meta:empty { display: none; }
@media (max-width: 760px) {
  .pv2__line1 { grid-template-columns: minmax(0, 1fr) 108px; }
  .pv2__line2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
  .pv2__cat { grid-column: 1 / -1; }
  .pv2__owner { grid-column: 1; }
  .pv2__defaults { gap: 7px; padding: 9px 10px; }
  .pv2__defaults-hint { flex-basis: 100%; }
  .pv2__merchant { font-size: 12.5px; }
}

/* 내역 — 수정·삭제 버튼 */
.tx-acts { text-align: right; white-space: nowrap; }
.tx-acts .icon-btn { width: 28px; height: 28px; }
.tx-acts .icon-btn + .icon-btn { margin-left: 2px; }
@media (max-width: 760px) {
  .tx-acts { grid-column: 2; grid-row: 4; align-self: center; }
  .tx-acts .icon-btn { width: 32px; height: 32px; }
}
.txedit__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.txedit__grid .field--wide { grid-column: 1 / -1; }
.modal--txedit { max-width: 520px; }
@media (max-width: 760px) {
  .txedit__grid { grid-template-columns: minmax(0, 1fr); }
  .txedit__grid .field--wide { grid-column: auto; }
}

/* 연간 ÷12 도우미 */
.annual-helper__presets { display: flex; flex-wrap: wrap; gap: 6px; }

/* 내보내기 안내(광고 자리) 팝업 */
.modal--ad { max-width: 440px; }
.admodal { display: flex; flex-direction: column; gap: 12px; }
.admodal__head h3 { margin: 3px 0 5px; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.admodal__head p { font-size: 12.5px; color: var(--ink-3); line-height: 1.65; }
.admodal__slot {
  position: relative; display: grid; place-items: center; gap: 4px; text-align: center;
  min-height: 96px; padding: 16px; border: 1px dashed var(--line-strong);
  border-radius: 12px; background: var(--paper);
}
.admodal__label {
  position: absolute; top: 6px; left: 8px; font-size: 9.5px; letter-spacing: 0.08em;
  color: var(--ink-4); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px;
}
.admodal__slot p { font-size: 11.5px; color: var(--ink-4); margin-top: 10px; }

/* 이번 달 — 상단 전환이 오른쪽 위로 오면서 큰 숫자는 아래로 (한 줄 flex 해제) */
.balance { display: block; }
.balance__top { margin-bottom: 2px; }

/* 예산 표 — 관리 버튼은 이름 아래로, 이월 스위치 글자는 한 줄로 */
.budget-table .bt__name { flex-direction: column; align-items: flex-start; gap: 5px; }
.budget-table .bt__acts { margin-left: 0; flex-wrap: wrap; }
.budget-table th:nth-child(1) { width: 30%; }
.budget-table th:nth-child(2) { width: 26%; }
.budget-table th:nth-child(5) { width: 112px; }
.bt__carry .mini-switch span { white-space: nowrap; }
@media (max-width: 760px) {
  .budget-table .bt__name { align-items: flex-start; gap: 4px; }
  .bt__carry .mini-switch span { font-size: 10.5px; }
}

/* 사용법 히어로 — 앞 문구와 예시 사이 구분점 */
.hero__diff span::before { content: '·'; margin: 0 5px 0 2px; color: var(--line-strong); }

/* 예산 표 — 열 너비를 고정해 머리글과 값을 맞춘다 */
.budget-table { table-layout: fixed; }
.budget-table th:nth-child(1) { width: 34%; }
.budget-table th:nth-child(2) { width: 23%; }
.budget-table th:nth-child(3), .budget-table th:nth-child(4) { width: 12%; }
.budget-table th:nth-child(5) { width: 104px; }
.budget-table td { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .budget-table { table-layout: auto; }
}

/* 1·2·3순위 묶음 행 — td에 flex를 주면 colspan이 풀리므로 안쪽 래퍼로 정렬한다 */
.tier-head > td { display: table-cell; padding: 15px 2px 7px; border: 0; background: transparent; }
.tier-head__in { display: flex; align-items: center; gap: 9px; width: 100%; min-width: 0; }
.tier-head__body { flex: 1 1 auto; }
.tier-head__amt { margin-left: auto; }
.budget-table th:nth-child(2) { width: 24%; }
.stepbox .money-field input { padding: 0 22px 0 6px; }
@media (max-width: 760px) {
  .tier-head > td { display: block; padding: 14px 0 6px; }
  .tier-head__in { gap: 8px; }
  .tier-head__body small { display: block; }
}
.budget-table th:nth-child(1) { width: 32%; }
.budget-table th:nth-child(2) { width: 26%; }

/* 모바일 예산 줄 — 이름 옆에 관리 버튼을 붙여 줄 높이를 줄인다 */
@media (max-width: 760px) {
  .budget-table .bt__name { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .budget-table .bt__acts { margin-left: auto; }
  .budget-table .bt__head { flex: 1 1 auto; }
}

@media (max-width: 760px) {
  .hero__diff span::before { content: none; margin: 0; }
}

/* ------------------------------------------------------------ 가족·모임 실시간 동기화 */

.syncbar {
  position: sticky; top: var(--header-h); z-index: 38;
  background: var(--accent-tint);
  border-bottom: 1px solid var(--line);
}
.syncbar[hidden] { display: none; }
.syncbar__in {
  max-width: var(--shell); margin: 0 auto;
  padding: 6px 24px;
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--accent-deep);
}
.syncbar__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex: none;
  box-shadow: 0 0 0 3px rgba(47, 79, 79, 0.12);
}
.syncbar[data-state="saving"] .syncbar__dot { animation: syncpulse 1s ease-in-out infinite; }
.syncbar[data-state="error"] { background: var(--over-tint); color: var(--over); }
.syncbar[data-state="error"] .syncbar__dot { background: var(--over); box-shadow: 0 0 0 3px rgba(178, 69, 58, 0.12); }
.syncbar__text { font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.syncbar__btn {
  border: 0; background: none; color: inherit;
  font-size: 11.5px; padding: 3px 7px; border-radius: 6px;
  text-decoration: underline; text-underline-offset: 2px; flex: none;
}
.syncbar__btn:hover { background: rgba(47, 79, 79, 0.08); }
.syncbar__btn--off { margin-left: auto; color: var(--ink-3); }
@keyframes syncpulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

@media (max-width: 760px) {
  .syncbar { top: 56px; }
  .syncbar__in { padding: 6px 16px; gap: 6px; font-size: 11.5px; }
  .syncbar__text { max-width: 58vw; }
}

.sync-card .card__head { align-items: flex-start; }
.sync-chip--on { color: var(--accent-deep); }
.sync-chip--error { color: var(--over); }

.sync-empty p { font-size: 13px; color: var(--ink-2); }
.sync-help { list-style: none; margin: 10px 0 0; display: flex; flex-direction: column; gap: 5px; }
.sync-help li { position: relative; padding-left: 12px; font-size: 12px; color: var(--ink-3); line-height: 1.6; }
.sync-help li::before { content: ''; position: absolute; left: 2px; top: 8px; width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }
.sync-help b { color: var(--ink-2); font-weight: 500; }

.sync-now {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 14px; padding: 11px 13px;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
}
.sync-now__dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none;
  background: var(--accent); box-shadow: 0 0 0 3px rgba(47, 79, 79, 0.12);
}
.sync-now[data-state="saving"] .sync-now__dot { animation: syncpulse 1s ease-in-out infinite; }
.sync-now[data-state="error"] { background: var(--over-tint); border-color: #efd6d2; }
.sync-now[data-state="error"] .sync-now__dot { background: var(--over); box-shadow: 0 0 0 3px rgba(178, 69, 58, 0.12); }
.sync-now__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sync-now__text b { font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.sync-now__text em { font-style: normal; font-size: 11px; color: var(--ink-4); overflow: hidden; text-overflow: ellipsis; }

.sync-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.sync-actions .sync-off { margin-left: auto; color: var(--ink-3); }
.sync-note {
  display: flex; gap: 6px; align-items: flex-start;
  margin-top: 12px; font-size: 11.5px; line-height: 1.65; color: var(--ink-3);
}
.sync-note .icon { flex: none; margin-top: 1px; color: var(--ink-4); }
.sync-note b { color: var(--ink-2); font-weight: 500; }

.sync-code {
  margin: 14px 0 10px; padding: 14px 0;
  text-align: center; letter-spacing: 0.32em;
  font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--accent-deep); background: var(--accent-tint);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.sync-join__field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.sync-join__field span { font-size: 12px; color: var(--ink-3); }
.sync-join__field input {
  width: 100%; padding: 12px 14px;
  font-size: 20px; letter-spacing: 0.28em; text-align: center; text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
}
.sync-join__field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.sync-join__note { margin-top: 10px; font-size: 12px; color: var(--over); }

@media (max-width: 760px) {
  .sync-actions .sync-off { margin-left: 0; }
  .sync-code { font-size: 26px; }
}
.sync-trash { margin-top: 8px; text-align: right; }
.link-btn {
  border: 0; background: none; padding: 0;
  font-size: 11.5px; color: var(--ink-4);
  text-decoration: underline; text-underline-offset: 2px;
}
.link-btn:hover { color: var(--over); }
.syncbar[data-state="error"] + .main { padding-top: 30px; }


/* ============================================================
   v6 — 외부 검증 반영(모바일 가독성 · 예시 글 줄바꿈 · 복구 화면)
   ============================================================ */

/* 붙여넣기 칸 예시 글(placeholder)이 길어도 잘리지 않고 줄바꿈되게 */
.paste {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* '다시 읽기' 안내 — 아이콘 옆 글자가 줄바꿈될 때 아이콘과 어긋나지 않게 */
.import__auto { align-items: flex-start; }
.import__auto > span { flex: 1 1 auto; min-width: 0; }

/* 보조 설명 글씨 — 작고 흐린 회색을 조금 키우고 진하게(읽기 편하게) */
.import__auto,
.qzone__privacy,
.privacy,
.privacy-sec__note,
.flow__hint,
.sync-note {
  font-size: 12px;
  color: var(--ink-3);
}
.qzone__privacy,
.privacy-sec__note { color: var(--ink-3); }

/* 그리기 오류 복구 화면 */
.recovery { display: grid; place-items: center; min-height: 60vh; padding: 24px 4px; }
.recovery__card {
  width: 100%; max-width: 460px; padding: 26px 22px;
  border: 1px solid var(--line-strong); border-radius: 16px; background: var(--paper);
}
.recovery__card h2 { font-family: var(--font-hand); font-size: 23px; font-weight: 400; line-height: 1.35; }
.recovery__card p { margin-top: 8px; font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.recovery__detail {
  margin-top: 10px; padding: 9px 11px; border-radius: 8px;
  background: var(--paper-2); font-family: ui-monospace, Menlo, monospace;
  font-size: 11.5px; color: var(--ink-3); word-break: break-word;
}
.recovery__acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.recovery__note { margin-top: 12px; font-size: 11.5px; color: var(--ink-3); }

@media (max-width: 760px) {
  /* 아래쪽 플로팅 + 가 마지막 봉투 카드를 가리지 않도록 여백을 더 준다 */
  .main { padding-bottom: calc(var(--tabbar-h) + 150px + env(safe-area-inset-bottom, 0px)); }
  body.is-nofab .main { padding-bottom: calc(var(--tabbar-h) + 44px + env(safe-area-inset-bottom, 0px)); }
  .paste { font-size: 12px; line-height: 1.75; }
  .import__auto,
  .qzone__privacy,
  .privacy,
  .privacy-sec__note,
  .flow__hint { font-size: 12.5px; }
}

/* '재확인' 배지 — 꼬붕이6 측 가져오기 미리보기에서 쓰는 표시(노랑 계열, 경고와 구분) */
.chip--recheck,
.chip--warn {
  background: #FBF3DF;
  border-color: #E4C982;
  color: #6B4E12;
}
.chip--recheck::before {
  content: '!';
  display: inline-grid;
  place-items: center;
  width: 12px; height: 12px;
  margin-right: 4px;
  border-radius: 50%;
  background: #C79A2B;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}
