/* 우리집 머니 · 차분한 흰 바탕, 진한 글자, 절제된 녹색 */
:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --surface: #ffffff;
  --surface-2: #f0f2ec;
  --surface-3: #e7eae2;
  --ink: #18211c;
  --ink-2: #47524b;
  --muted: #727d76;
  --line: #e1e5dc;
  --line-strong: #cdd3c8;
  --accent: #2f6b4f;
  --accent-hover: #285c44;
  --accent-ink: #ffffff;
  --accent-soft: #e4efe8;
  --accent-text: #2a6248;
  --mark: #1e7f4f;
  --mark-soft: #d6eadd;
  --good: #2a6248;
  --good-bg: #e4efe8;
  --warn: #855600;
  --warn-bg: #fdf1d4;
  --bad: #a3322a;
  --bad-bg: #fbe8e5;
  --info: #35576f;
  --info-bg: #e9f0f5;
  --shadow: 0 1px 2px rgba(24, 33, 28, 0.05), 0 6px 24px rgba(24, 33, 28, 0.06);
  --c1: #2a78d6;
  --c2: #eb6834;
  --c3: #1baf7a;
  --c4: #eda100;
  --c5: #e87ba4;
  --c-rest: #c9cec6;
  --radius: 12px;
  --radius-s: 8px;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1411;
    --surface: #161d19;
    --surface-2: #1b241f;
    --surface-3: #222d27;
    --ink: #e5ebe7;
    --ink-2: #b6c1bb;
    --muted: #8b978f;
    --line: #26302a;
    --line-strong: #34403a;
    --accent: #74c29b;
    --accent-hover: #8bd0ad;
    --accent-ink: #0c1912;
    --accent-soft: #1d3328;
    --accent-text: #8fd2b0;
    --mark: #3daa72;
    --mark-soft: #1f3a2c;
    --good: #8fd2b0;
    --good-bg: #1d3328;
    --warn: #e9bd62;
    --warn-bg: #352a10;
    --bad: #f19185;
    --bad-bg: #3b1e1a;
    --info: #9cc0da;
    --info-bg: #1b2a35;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.25);
    --c1: #3987e5;
    --c2: #d95926;
    --c3: #199e70;
    --c4: #c98500;
    --c5: #d55181;
    --c-rest: #3a453f;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1411;
  --surface: #161d19;
  --surface-2: #1b241f;
  --surface-3: #222d27;
  --ink: #e5ebe7;
  --ink-2: #b6c1bb;
  --muted: #8b978f;
  --line: #26302a;
  --line-strong: #34403a;
  --accent: #74c29b;
  --accent-hover: #8bd0ad;
  --accent-ink: #0c1912;
  --accent-soft: #1d3328;
  --accent-text: #8fd2b0;
  --mark: #3daa72;
  --mark-soft: #1f3a2c;
  --good: #8fd2b0;
  --good-bg: #1d3328;
  --warn: #e9bd62;
  --warn-bg: #352a10;
  --bad: #f19185;
  --bad-bg: #3b1e1a;
  --info: #9cc0da;
  --info-bg: #1b2a35;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.25);
  --c1: #3987e5;
  --c2: #d95926;
  --c3: #199e70;
  --c4: #c98500;
  --c5: #d55181;
  --c-rest: #3a453f;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
a { color: var(--accent-text); }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15.5px; font-weight: 650; }
p { margin: 0; }
.num, table td.r, .tnum { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- 레이아웃 ---------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 22px 16px 24px; border-right: 1px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none;
}
.brand-name { font-weight: 750; font-size: 16px; line-height: 1.2; }
.brand-sub { color: var(--muted); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: 14.5px;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
.nav .badge { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--warn-bg); color: var(--warn); }
.side-foot { margin-top: auto; font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; padding: 0 6px; }
.main { min-width: 0; padding-block: 26px 80px; padding-inline: clamp(16px, 3vw, 40px); }
.main-inner { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.topbar { display: none; }
.tabs { display: none; }
.fab { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.month-switch { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.month-switch button { border: 0; background: transparent; color: var(--ink-2); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 16px; }
.month-switch button:hover { background: var(--surface); color: var(--ink); }
.month-switch .label { min-width: 104px; text-align: center; font-weight: 650; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.month-switch input[type="month"] { position: absolute; opacity: 0; pointer-events: none; width: 1px; }

.banner { border-radius: 10px; padding: 11px 14px; display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.banner-demo { background: var(--warn-bg); color: var(--warn); }
.banner-info { background: var(--info-bg); color: var(--info); }
.banner b { font-weight: 700; }
.banner .grow { flex: 1 1 260px; }

/* ---------- 카드·섹션 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card-flat { background: var(--surface); border-radius: var(--radius); padding: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head .meta { color: var(--muted); font-size: 12.5px; }
.section { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.ink2 { color: var(--ink-2); }
.strong { font-weight: 700; }
.right { text-align: right; }
.hr { height: 1px; background: var(--line); border: 0; margin: 4px 0; }

/* 지표 */
.stat .label { color: var(--ink-2); font-size: 13.5px; font-weight: 550; }
.stat .value { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; margin-top: 4px; line-height: 1.2; }
.stat .value.sm { font-size: 21px; }
.stat .foot { color: var(--muted); font-size: 12.5px; margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.hero .value { font-size: 40px; }
.asof {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650; letter-spacing: 0.02em;
  color: var(--ink-2); border: 1px solid var(--line-strong); border-radius: 6px; padding: 1px 6px; font-variant-numeric: tabular-nums;
}

/* 진행 막대 */
.meter { height: 8px; border-radius: 99px; background: var(--mark-soft); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--mark); }
.meter.warn > span { background: var(--warn); }
.meter.warn { background: var(--warn-bg); }
.meter.bad > span { background: var(--bad); }
.meter.bad { background: var(--bad-bg); }

/* 상태 표시 */
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 650;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap; line-height: 1.7;
}
.pill-good { background: var(--good-bg); color: var(--good); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.pill-info { background: var(--info-bg); color: var(--info); }
.pill-line { background: transparent; border: 1px solid var(--line-strong); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }

/* 먼저 할 일 */
.todo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.todo-item {
  display: flex; gap: 10px; align-items: flex-start; padding: 13px 14px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); text-align: left; cursor: pointer; color: inherit; font: inherit;
}
.todo-item:hover { border-color: var(--line-strong); }
.todo-item .ico { width: 26px; height: 26px; flex: none; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--warn-bg); color: var(--warn); }
.todo-item.info .ico { background: var(--info-bg); color: var(--info); }
.todo-item b { display: block; font-size: 14px; }
.todo-item span { color: var(--muted); font-size: 12.5px; }

/* ---------- 버튼·입력 ---------- */
.btn {
  appearance: none; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  height: 38px; padding: 0 14px; border-radius: 9px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line-strong)); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn-block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--accent-text); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); min-width: 0; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 9px; padding: 8px 11px; min-height: 40px; width: 100%; min-width: 0;
}
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); margin: 0; flex: none; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input.amount { text-align: right; font-variant-numeric: tabular-nums; }
.inline-check { display: inline-flex; gap: 8px; align-items: center; font-weight: 550; color: var(--ink); font-size: 14px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--ink-2); padding: 6px 12px; border-radius: 7px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.choice { display: grid; gap: 10px; }
.choice-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line-strong); border-radius: 10px;
  cursor: pointer; background: var(--surface); text-align: left; font: inherit; color: inherit;
}
.choice-item[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.choice-item .num-badge { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 750; flex: none; }

/* ---------- 표·목록 ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-weight: 650; color: var(--muted); font-size: 12.5px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: var(--surface-2); }
tr.selected td { background: var(--accent-soft) !important; }
.desc { font-weight: 550; }
.desc-sub { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.amt { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt-in { color: var(--accent-text); }
.amt-muted { color: var(--muted); font-weight: 550; }

.list { display: flex; flex-direction: column; }
.list-day { font-size: 12.5px; color: var(--muted); font-weight: 650; padding: 14px 4px 6px; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 11px 12px; background: var(--surface); border-bottom: 1px solid var(--line); cursor: pointer; }
.list-item:first-of-type { border-top-left-radius: 10px; border-top-right-radius: 10px; }
.list-item .main-col { flex: 1; min-width: 0; }
.list-item .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { width: auto; min-height: 36px; padding: 5px 10px; font-size: 14px; }
.filters input[type="search"] { min-width: 180px; }
.bulk {
  position: sticky; bottom: 16px; z-index: 20; background: var(--ink); color: var(--bg); border-radius: 12px; padding: 10px 12px;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; box-shadow: var(--shadow);
}
.bulk .btn { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 35%, transparent); }
.bulk .btn:hover { background: color-mix(in srgb, var(--bg) 12%, transparent); }
.bulk select { width: auto; min-height: 30px; padding: 3px 8px; font-size: 13px; background: var(--ink); color: var(--bg); border-color: color-mix(in srgb, var(--bg) 35%, transparent); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.budget-group { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.budget-group > .bg-head { display: flex; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: baseline; flex-wrap: wrap; }
.budget-line { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(90px, 1fr); gap: 10px; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.budget-line:last-child { border-bottom: 0; }
.budget-line .lbl { min-width: 0; }
.budget-line input { min-height: 34px; padding: 5px 9px; font-size: 14px; }
.budget-line.edit { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr) minmax(0, 1.1fr) minmax(0, 1fr) 34px; }

/* ---------- 차트 ---------- */
.chart { width: 100%; display: block; }
.chart text { fill: var(--muted); font-size: 11.5px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--mark); }
.chart .bar.partial { fill: var(--mark-soft); stroke: var(--mark); stroke-width: 1.5; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:focus { outline: none; }
.chart .line { fill: none; stroke: var(--mark); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--mark); opacity: 0.1; }
.chart .pt { fill: var(--mark); stroke: var(--surface); stroke-width: 2; }
.chart .pt.open { fill: var(--surface); stroke: var(--mark); stroke-width: 2; }
.chart .lbl-strong { fill: var(--ink); font-weight: 700; font-size: 12px; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.hbar .track { height: 10px; position: relative; }
.hbar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--mark); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar .fill.ghost { background: var(--surface-3); }
.hbar .name { min-width: 0; overflow-wrap: anywhere; color: var(--ink-2); }
.hbar .val { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--mark); }
.legend i.soft { background: var(--mark-soft); border: 1.5px solid var(--mark); }
.legend i.open { background: var(--surface); border: 2px solid var(--mark); border-radius: 50%; }
#tip {
  position: fixed; z-index: 90; pointer-events: none; background: var(--ink); color: var(--bg); padding: 6px 9px; border-radius: 7px;
  font-size: 12.5px; line-height: 1.45; max-width: 260px; box-shadow: var(--shadow); font-variant-numeric: tabular-nums;
}

/* ---------- 모달·토스트 ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(12, 18, 14, 0.42); display: grid; place-items: center; padding: 16px; }
.modal {
  background: var(--surface); border-radius: 14px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.modal.wide { width: min(860px, 100%); }
.modal-head { padding: 18px 20px 6px; display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.modal-body { padding: 10px 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 12px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); }
.toasts { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(520px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow); font-size: 14px; width: 100%; }
.toast .grow { flex: 1; }
.toast button { background: transparent; border: 0; color: var(--accent-soft); font: inherit; font-weight: 700; cursor: pointer; }
.toast.bad { background: var(--bad); color: #fff; }

.empty { text-align: center; padding: 32px 16px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty b { color: var(--ink); font-size: 15px; }
.loading { opacity: 0.55; transition: opacity 0.15s; }
.notice { border-left: 3px solid var(--line-strong); padding: 6px 12px; color: var(--ink-2); font-size: 13.5px; background: var(--surface-2); border-radius: 0 8px 8px 0; }
.notice.warn { border-left-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
.notice.bad { border-left-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.notice.good { border-left-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }

/* 로그인 */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); }
.auth-aside { background: var(--accent); color: var(--accent-ink); padding: 48px clamp(24px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.auth-aside h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.15; font-weight: 750; letter-spacing: -0.03em; }
.auth-aside p { opacity: 0.9; max-width: 34em; }
.auth-aside ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; opacity: 0.92; }
.ledger-sample { border: 1px solid color-mix(in srgb, var(--accent-ink) 30%, transparent); border-radius: 12px; padding: 14px 16px; font-size: 13.5px; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.ledger-sample div { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.auth-main { background: var(--surface); padding: 48px clamp(20px, 4vw, 48px); display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.steps { display: flex; flex-direction: column; gap: 10px; counter-reset: s; }
.step-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.step-row .no { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 750; font-size: 13px; flex: none; }
.step-row.done .no { background: var(--accent); color: var(--accent-ink); }
.step-row.later .no { background: var(--warn-bg); color: var(--warn); }
.step-row .body { flex: 1; min-width: 0; }

/* ---------- 모바일 ---------- */
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px);
    padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; border-bottom: 1px solid var(--line); align-items: center; justify-content: space-between; gap: 10px;
  }
  .main { padding-block: 16px 120px; padding-inline: 16px; }
  .tabs {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; color: var(--muted); text-decoration: none; padding: 4px 0; font-weight: 600; }
  .tabs a svg { width: 22px; height: 22px; }
  .tabs a[aria-current="page"] { color: var(--accent-text); }
  .fab {
    display: inline-flex; position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 41; height: 48px; padding: 0 18px;
    border-radius: 99px; border: 0; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; box-shadow: var(--shadow); align-items: center; gap: 6px; cursor: pointer;
  }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: 1fr; }
  .todo { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { padding: 32px 20px; }
  .auth-main { padding: 28px 16px 48px; }
  .bulk { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .hero .value { font-size: 32px; }
}
@media (max-width: 640px) {
  .g2, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .budget-line { grid-template-columns: minmax(0, 1fr) auto; }
  .budget-line .hide-sm { display: none; }
  .budget-line.edit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px; }
  .budget-line.edit .hide-sm { display: none; }
  .modal { border-radius: 14px 14px 0 0; align-self: end; max-height: 92vh; }
  .overlay { padding: 0; align-items: end; }
  h1 { font-size: 21px; }
}

/* ---------- 피드백 핀 (Sales Ops와 같은 형태) ---------- */
#fbBtn {
  position: fixed; right: 22px; bottom: 22px; z-index: 50; background: #d6453b; color: #fff; border: 0; border-radius: 999px;
  padding: 12px 18px; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 6px 18px rgba(214, 69, 59, 0.35);
}
#fbBtn.active { background: var(--ink); color: var(--bg); }
#fbBtn #fbCount { margin-left: 7px; background: #fff; color: #d6453b; border-radius: 999px; padding: 0 7px; font-size: 12px; font-weight: 800; }
#fbBtn #fbCount:empty { display: none; }
body.fb-mode { cursor: crosshair; }
body.fb-mode .main, body.fb-mode .side, body.fb-mode .topbar { cursor: crosshair; }
.fb-pin {
  position: absolute; z-index: 55; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: #d6453b; color: #fff;
  font-weight: 800; font-size: 13px; line-height: 22px; text-align: center; cursor: pointer; box-shadow: 0 2px 7px rgba(0, 0, 0, 0.4); border: 2px solid #fff;
}
#fbPanel {
  display: none; position: fixed; right: 22px; bottom: 76px; z-index: 60; width: 340px; max-width: calc(100vw - 32px); max-height: 62vh; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 44px rgba(15, 23, 42, 0.28); overflow: hidden;
}
.fbp-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 800; }
.fbp-head #fbHint { font-size: 11px; font-weight: 500; color: var(--muted); }
.fbp-head #fbDone { margin-left: auto; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 7px; padding: 4px 11px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
#fbList { overflow: auto; padding: 8px 12px; }
.fbp-empty { padding: 10px 4px; font-size: 12.5px; color: var(--muted); }
.fbp-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.fbp-num { flex: 0 0 22px; height: 22px; border-radius: 50%; background: #d6453b; color: #fff; font-weight: 800; font-size: 12px; text-align: center; line-height: 22px; }
.fbp-item input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font: inherit; font-size: 13px; min-height: 0; }
.fbp-del { border: 0; background: none; color: var(--muted); font-size: 17px; cursor: pointer; }
.fbp-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 14px; border-top: 1px solid var(--line); }
.fbp-actions button { padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.fbp-actions .send { background: #d6453b; color: #fff; border-color: #d6453b; }
#fbMsg { padding: 0 14px 10px; font-size: 12px; color: var(--ink-2); }
#fbMsg:empty { display: none; }
@media (max-width: 960px) {
  #fbBtn { bottom: calc(136px + env(safe-area-inset-bottom, 0px)); right: 16px; padding: 10px 14px; font-size: 13px; }
  #fbPanel { bottom: calc(190px + env(safe-area-inset-bottom, 0px)); right: 16px; }
}

/* ---------- 차트 추가 ---------- */
.chart .bar.over { fill: var(--bad); }
.chart .plan-line { fill: none; stroke: var(--c2); stroke-width: 2; stroke-linejoin: round; }
.chart .plan-pt { fill: var(--c2); stroke: var(--surface); stroke-width: 2; }
.chart .donut-k { fill: var(--muted); font-size: 11px; }
.chart .donut-v { fill: var(--ink); font-size: 14px; font-weight: 750; }
.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut-wrap svg { flex: none; }
.legend-list { flex: 1 1 200px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; min-width: 0; }
.legend-list .li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.legend-list i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend-list .nm { color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.legend-list .v { font-variant-numeric: tabular-nums; font-weight: 600; }
.legend-list .p { font-variant-numeric: tabular-nums; color: var(--muted); width: 48px; text-align: right; }
.legend .sw-plan { display: inline-block; width: 14px; height: 2px; background: var(--c2); vertical-align: 3px; margin-right: 5px; }
.hbar .fill.over { background: var(--bad); }
.hbar .track .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); border-radius: 1px; }
.period { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.period select { width: auto; min-height: 34px; padding: 4px 10px; font-size: 14px; }
.grid-plan { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.grid-plan table { font-size: 12.5px; min-width: 1240px; }
.grid-plan th, .grid-plan td { padding: 6px 6px; white-space: nowrap; }
.grid-plan td.lbl { white-space: normal; }
.grid-plan td input { min-height: 30px; padding: 3px 6px; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; border-color: transparent; background: transparent; }
.grid-plan td input:hover { border-color: var(--line-strong); }
.grid-plan td input:focus { background: var(--surface); }
.grid-plan td input.changed { background: var(--warn-bg); }
.grid-plan .grp td { background: var(--surface-2); font-weight: 700; }
.grid-plan .sum td { font-weight: 700; border-top: 1px solid var(--line-strong); }
.grid-plan td.lbl { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 150px; }
.grid-plan .grp td.lbl { background: var(--surface-2); }
.heat td.cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.heat td.cell.over { color: var(--bad); font-weight: 700; }
.heat td.cell.none { color: var(--muted); }
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 960px) { .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpi-row { grid-template-columns: 1fr; } }

.table-wrap td.r, .table-wrap td.num, .table-wrap td .num { white-space: nowrap; }

/* 지출 › 분류별 월별 움직임: 비중 칸 */
.heat td.share .share-wrap { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.heat td.share .share-bar { display: inline-block; height: 6px; border-radius: 3px; background: var(--c1); }
.heat tr.sum td { border-top: 1px solid var(--line-strong); background: var(--surface-2); }

/* 계획 마스터 › 표 위 흐름 */
.flow-wrap { margin: 10px 0 14px; display: flex; flex-direction: column; gap: 10px; }
.flow-strip { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; }
.flow-box { flex: 1 1 0; min-width: 96px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.flow-box .lbl { font-size: 12.5px; color: var(--ink-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.flow-box .lbl i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex: none; }
.flow-box b { font-size: 15px; font-weight: 700; white-space: nowrap; }
.flow-box .sub { font-size: 11.5px; color: var(--muted); }
.flow-box.income { background: var(--surface-2); }
.flow-box.left { border-color: var(--accent); }
.flow-box.left.neg { border-color: var(--bad); }
.flow-box.ghost { border-style: dashed; }
.flow-op { align-self: center; font-size: 18px; color: var(--muted); font-weight: 700; padding: 0 1px; }
.flow-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.flow-bar span { display: block; height: 100%; min-width: 2px; }
@media (max-width: 640px) {
  .flow-op { display: none; }
  .flow-box { flex-basis: calc(50% - 6px); min-width: 0; }
}

/* 월말 점검 › 준비할 내역 · 점검 미팅 */
.prep-list { display: flex; flex-direction: column; }
.prep-item { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.prep-item:first-child { border-top: 0; }
.prep-item .ic { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); }
.prep-item.ok .ic { background: var(--good-bg); color: var(--good); }
.prep-item.need .ic { background: var(--warn-bg); color: var(--warn); }
.prep-item.miss .ic { background: var(--bad-bg); color: var(--bad); }
.prep-item .t { font-weight: 600; }
.prep-item .how { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.prep-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.meet { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.meet .date-tile { width: 74px; border-radius: 12px; border: 1px solid var(--line-strong); text-align: center; overflow: hidden; background: var(--surface); }
.meet .date-tile .mo { background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; padding: 3px 0; }
.meet .date-tile .dd { font-size: 26px; font-weight: 800; padding: 4px 0 0; }
.meet .date-tile .dw { font-size: 12px; color: var(--ink-2); padding-bottom: 6px; }
.agenda { margin: 0; padding-left: 20px; }
.agenda li { margin: 3px 0; }
/* 인사이트 표: 첫 칸(이름)이 좁은 화면에서 한 글자씩 꺾이지 않게 */
th.lbl-col { min-width: 8.5em; }
