/* 색은 역할 이름(토큰)으로만 쓴다. 밝은/어두운 화면 값은 여기 한 곳에서 바꾼다. */
:root {
  color-scheme: light;
  --bg: #f6f5f2;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --line: #e4e2dd;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #7a7974;
  --accent: #2a78d6;         /* 막대(한 가지 색) */
  --accent-soft: #86b6ef;    /* 고르지 않은 달 */
  --accent-wash: rgba(42, 120, 214, .10);
  --up: #d03b3b;             /* 지출 늘어남(▲ 와 함께만) */
  --down: #0b8a0b;           /* 지출 줄어듦(▼ 와 함께만) */
  --radius: 14px;
  /* 종류 색(검증된 기본 팔레트 1~7번 순서 그대로) + 나머지 회색 */
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --c5: #e87ba4; --c6: #008300; --c7: #4a3aa7;
  --c-other: #b4b2ab;
  --sat: #2a6fc9; --sun: #d03b3b;          /* 달력의 토·일 글씨 */
  --wk: rgba(42, 120, 214, .13); --wk-sun: rgba(208, 59, 59, .12);
  --hero-a: #e8f1fd; --hero-b: #f6efff;    /* 큰 숫자 카드 바탕 */
  --t1: #e8f1fd; --t2: #fdeee6; --t3: #e6f6ef;
  --shadow: 0 10px 40px rgba(0, 0, 0, .18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    /* 어두운 화면은 검정이 아니라 차콜(짙은 회색) 계열. 카드·창이 바탕과 구분되게 단계를 넉넉히 둔다 */
    --bg: #1f2023; --surface: #2a2b2f; --surface-2: #35363b; --line: #42444a;
    --text: #f3f3f4; --text-2: #c9cacf; --text-3: #9a9ca2;
    --accent: #3987e5; --accent-soft: #2d5f9c; --accent-wash: rgba(57, 135, 229, .16);
    --up: #ef7676; --down: #4cc94c;
    --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c6: #2e9a2e; --c7: #9085e9;
    --c-other: #6b6d73;
    --sat: #6da7ec; --sun: #ef7676;
    --wk: rgba(57, 135, 229, .16); --wk-sun: rgba(239, 118, 118, .15);
    --hero-a: #283444; --hero-b: #322c3e;
    --t1: #2a384a; --t2: #3e3029; --t3: #263c36;
    --shadow: 0 10px 40px rgba(0, 0, 0, .55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  /* 어두운 화면은 검정이 아니라 차콜(짙은 회색) 계열. 카드·창이 바탕과 구분되게 단계를 넉넉히 둔다 */
  --bg: #1f2023; --surface: #2a2b2f; --surface-2: #35363b; --line: #42444a;
  --text: #f3f3f4; --text-2: #c9cacf; --text-3: #9a9ca2;
  --accent: #3987e5; --accent-soft: #2d5f9c; --accent-wash: rgba(57, 135, 229, .16);
  --up: #ef7676; --down: #4cc94c;
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c6: #2e9a2e; --c7: #9085e9;
  --c-other: #6b6d73;
  --sat: #6da7ec; --sun: #ef7676;
  --wk: rgba(57, 135, 229, .16); --wk-sun: rgba(239, 118, 118, .15);
  --hero-a: #283444; --hero-b: #322c3e;
  --t1: #2a384a; --t2: #3e3029; --t3: #263c36;
  --shadow: 0 10px 40px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", system-ui, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.err { color: var(--up); min-height: 1.5em; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; margin-top: 20px; }

/* 버튼·입력 */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 10px; padding: 10px 14px; font: inherit; font-weight: 600; cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; width: 100%; padding: 14px; font-size: 16px; }
.btn.ghost { background: transparent; width: 100%; margin-top: 24px; }
.icon-btn { appearance: none; border: 0; background: transparent; color: var(--text-2); font-size: 22px; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; }
input[type=text], input[type=search], select {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; min-width: 0;
}
.row { display: flex; gap: 8px; }
.row > input { flex: 1; }

/* 로그인 */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px 22px; text-align: center; }
.auth-card h1 { font-size: 22px; margin-bottom: 8px; }
.auth-card p { margin: 0 0 20px; }

/* 머리 */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: calc(env(safe-area-inset-top) + 8px) 16px 0; border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 8px; }
.month-pick { flex: 1; min-width: 0; }
.month-pick select { width: 100%; font-weight: 700; font-size: 16px; background: transparent; border: 0; padding: 6px 0; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs button {
  appearance: none; border: 0; background: none; font: inherit; color: var(--text-2); padding: 10px 10px 12px;
  border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer;
}
.tabs button[aria-selected="true"] { color: var(--text); font-weight: 700; border-bottom-color: var(--accent); }

main { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; margin-bottom: 14px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; margin-bottom: 12px; }
.card-head h2 { white-space: nowrap; }
.card-head .muted { font-size: 13px; }

/* 큰 숫자 */
.hero-label { color: var(--text-2); font-size: 14px; }
.hero { font-size: 44px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin: 4px 0 6px; }
.hero small { font-size: 22px; font-weight: 600; margin-left: 2px; }
.deltas { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--text-2); }
.delta-up { color: var(--up); font-weight: 600; }
.delta-down { color: var(--down); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.tile { background: var(--surface-2); border-radius: 10px; padding: 10px; }
.tile .k { font-size: 12px; color: var(--text-2); }
.tile .v { font-size: 17px; font-weight: 700; }

/* 가로 막대 목록 */
.hbars { list-style: none; margin: 0; padding: 0; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 7px 0; cursor: pointer; border-radius: 8px; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .val { font-variant-numeric: tabular-nums; text-align: right; }
.hbar .val .pct { color: var(--text-3); font-size: 12px; margin-left: 6px; }
.hbar .track { grid-column: 1 / -1; height: 10px; }
.hbar .fill { height: 10px; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar.on .name { font-weight: 700; }
.hbar:not(.on).dim .fill { background: var(--accent-soft); }

/* 세로 막대(SVG) */
.chart { width: 100%; display: block; overflow: visible; touch-action: pan-y; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis-t { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--accent); }
.chart .bar.soft { fill: var(--accent-soft); }
.chart .hit { fill: transparent; cursor: pointer; }
/* 막대·글자는 터치를 받지 않고, 그 아래 넓은 투명 영역(.hit)이 받는다 */
.chart .bar, .chart text, .chart line { pointer-events: none; }
.chart .hit:hover + .bar, .chart .bar.hot { fill: var(--accent); filter: brightness(1.15); }
.chart .avg { stroke: var(--text-3); stroke-width: 1; }
/* 막대 위에 겹쳐도 읽히게 바탕색 테두리를 두른다 */
.chart .avg-t, .chart .val-t { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.chart .avg-t { fill: var(--text-2); font-size: 11px; }
.chart .val-t { fill: var(--text); font-size: 11px; font-weight: 600; }

/* 내역 목록 */
.day { margin-top: 14px; }
.day-head { display: flex; justify-content: space-between; color: var(--text-2); font-size: 13px; padding: 0 2px 4px; border-bottom: 1px solid var(--line); }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.item .m { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .a { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
.item .a.neg { color: var(--down); }
.item .meta { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.chip {
  appearance: none; font: inherit; font-size: 12px; color: var(--text-2); background: var(--surface-2);
  border: 0; border-radius: 999px; padding: 2px 8px; max-width: 120px;
}
.badge { font-size: 11px; border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; color: var(--text-2); }
.empty { color: var(--text-2); text-align: center; padding: 24px 0; }
.more { width: 100%; margin-top: 12px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.filters input { grid-column: 1 / -1; }
.sum-line { display: flex; justify-content: space-between; color: var(--text-2); font-size: 14px; margin-bottom: 4px; }
.month-head { display: flex; justify-content: space-between; font-weight: 700; margin-top: 22px; padding-bottom: 6px; border-bottom: 2px solid var(--text); }

/* 할부 */
.inst { padding: 12px 0; border-bottom: 1px solid var(--line); }
.inst:last-child { border-bottom: 0; }
.inst-top { display: flex; justify-content: space-between; gap: 8px; }
.inst-top .m { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inst-sub { display: flex; justify-content: space-between; color: var(--text-2); font-size: 13px; margin-top: 4px; }
.meter { height: 8px; border-radius: 4px; background: var(--accent-wash); margin-top: 8px; overflow: hidden; }
.meter > div { height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }

/* 표 */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
th:not(:first-child), td:not(:first-child) { white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--text-2); font-weight: 600; font-size: 12px; }

/* 설정 시트 */
.sheet { border: 1px solid var(--line); border-radius: 18px; padding: 18px 16px 22px; width: min(440px, calc(100% - 24px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.sheet::backdrop { background: rgba(0, 0, 0, .5); backdrop-filter: blur(2px); }
.sheet input[type=text] { background: var(--surface-2); }
.icon-btn svg { width: 22px; height: 22px; display: block; margin: auto; }
.theme-seg { display: flex; width: 100%; margin-top: 6px; }
.theme-seg button { flex: 1; white-space: nowrap; padding: 7px 0; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.invite-out { display: flex; gap: 8px; margin-top: 8px; }
.invite-out input { flex: 1; font-size: 12px; }
.files { list-style: none; padding: 0; margin: 6px 0 0; font-size: 12px; color: var(--text-2); }
.files li { padding: 4px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }

/* 말풍선·알림 */
.tip {
  position: fixed; z-index: 20; pointer-events: none; max-width: 260px; background: var(--text); color: var(--bg);
  border-radius: 10px; padding: 8px 10px; font-size: 13px; line-height: 1.45; box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.tip b { font-weight: 700; }
.tip .tl { display: flex; justify-content: space-between; gap: 12px; }
.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 104px); transform: translateX(-50%); z-index: 30; text-align: center;
  background: var(--text); color: var(--bg); border-radius: 999px; padding: 10px 16px; font-size: 14px; max-width: calc(100% - 32px);
}

@media (max-width: 380px) {
  .hero { font-size: 38px; }
  .tiles { grid-template-columns: 1fr 1fr; }
}

/* 막대/달력 전환 */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 2px; }
.seg button { appearance: none; border: 0; background: none; font: inherit; font-size: 13px; color: var(--text-2); padding: 4px 12px; border-radius: 7px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* 달력 */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-h { text-align: center; font-size: 11px; color: var(--text-3); padding-bottom: 2px; }
.cal-d {
  appearance: none; border: 0; font: inherit; cursor: pointer; aspect-ratio: 1 / 1.05; border-radius: 8px; padding: 4px 2px;
  display: flex; flex-direction: column; justify-content: space-between; align-items: center; min-width: 0;
  background: color-mix(in srgb, var(--accent) var(--lv), var(--surface-2)); color: var(--text);
}
.cal-d .n { font-size: 11px; color: var(--text-2); align-self: flex-start; padding-left: 3px; }
.cal-d .v { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cal-d.strong { color: #fff; }
.cal-d.strong .n { color: rgba(255,255,255,.85); }
.cal-d.on { outline: 2px solid var(--text); outline-offset: 1px; }
.cal-legend { display: flex; align-items: center; gap: 6px; justify-content: flex-end; font-size: 11px; color: var(--text-3); margin-top: 8px; }
.cal-ramp { width: 80px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, var(--surface-2)), var(--accent)); }

/* ---------------------------------------------------------------- 2차 디자인 */
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.ic { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--surface-2); font-size: 15px; }
.card-head .sub { flex: 1 1 100%; order: 3; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; flex: none; vertical-align: 1px; }

.hero-card { background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); border-color: transparent; }
.hero-sub { color: var(--text-2); font-size: 13px; margin-bottom: 10px; }
.pill { display: inline-block; font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--surface); color: var(--text-2); }
.pill.up { color: var(--up); font-weight: 600; }
.pill.down { color: var(--down); font-weight: 600; }
.tile.t1 { background: var(--t1); } .tile.t2 { background: var(--t2); } .tile.t3 { background: var(--t3); }

.toggle { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12px; border-radius: 999px; padding: 4px 10px; cursor: pointer; }

/* 원그래프 */
.donut-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; margin: 4px 0 14px; }
.donut { width: 150px; height: 150px; }
.donut .slice { cursor: pointer; transition: opacity .15s; }
.donut .slice.dim { opacity: .25; }
.donut .d-k { fill: var(--text-2); font-size: 12px; }
.donut .d-v { fill: var(--text); font-size: 17px; font-weight: 700; }
.d-legend { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.d-legend li { display: flex; align-items: center; padding: 3px 0; cursor: pointer; }
.d-legend li.dim { opacity: .4; }
.d-legend .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-legend .pc { color: var(--text-2); font-variant-numeric: tabular-nums; }
@media (max-width: 360px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; } }

/* 가로 막대: 1위 강조 */
.hbar .name { display: flex; align-items: center; }
.hbar .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .sub { color: var(--text-3); font-size: 12px; margin-left: 6px; flex: none; }
.hbar .rank { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-right: 8px; border-radius: 7px; background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--text-2); }
.hbar.first { background: linear-gradient(90deg, rgba(237, 161, 0, .14), transparent); padding: 10px 10px; margin: 0 -10px 4px; border-radius: 12px; }
.hbar.first .name { font-weight: 700; font-size: 16px; }
.hbar.first .val { font-weight: 700; font-size: 16px; }
.hbar.first .rank { background: transparent; font-size: 18px; }
.hbar.first .fill { background: var(--c4); height: 12px; }
.hbar.first .track { height: 12px; }

/* 날짜별: 주말 띠, 달 넘기기 */
.chart .wk { fill: var(--wk); }
.chart .wk.sun { fill: var(--wk-sun); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 11px; color: var(--text-3); margin-top: 6px; }
.legend.end { justify-content: flex-end; }
.sw { display: inline-block; width: 12px; height: 10px; border-radius: 3px; margin-right: -4px; }
.sw.wk-sw { background: var(--wk); outline: 1px solid var(--line); }
.sw.wk-sw.sun { background: var(--wk-sun); }
.sw.line { height: 0; border-top: 1.5px solid var(--text-3); border-radius: 0; }
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; padding: 6px; background: var(--surface-2); border-radius: 12px; }
.nav-btn { appearance: none; border: 0; background: var(--surface); color: var(--text); width: 40px; height: 36px; border-radius: 9px; font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.nav-btn:disabled { opacity: .3; cursor: default; }
.nav-t { text-align: center; display: flex; flex-direction: column; line-height: 1.3; }
.nav-t span { font-size: 12px; color: var(--text-2); }
.cal-h.sat, .cal-d.sat .n, .day-head.sat span:first-child { color: var(--sat); }
.cal-h.sun, .cal-d.sun .n, .day-head.sun span:first-child { color: var(--sun); }
.cal-d.strong.sat .n, .cal-d.strong.sun .n { color: rgba(255,255,255,.9); }

/* 추이: 가로로 미는 긴 막대 */
.hscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; scrollbar-width: thin; }
.chart.long { width: auto; max-width: none; }
.chart.long .bar { fill: var(--accent); }
.chart.long .bar.top { fill: var(--c2); }
.chart.long .bar.on { stroke: var(--text); stroke-width: 2px; }
.chart.long .val-t { font-size: 11px; }
.chart.long .axis-t.on, .chart.long .val-t.on { font-weight: 800; fill: var(--text); }
.trend-cat { margin-bottom: 8px; }

/* 내역 필터 */
.filters { grid-template-columns: 1fr auto; }
.filters input { grid-column: auto; }
.fchips { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 8px; }
.fchip { appearance: none; border: 0; background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; border-radius: 999px; padding: 4px 10px; cursor: pointer; display: inline-flex; align-items: center; }
.chip-wrap { display: inline-flex; align-items: center; background: var(--surface-2); border-radius: 999px; padding-left: 8px; }
.chip-wrap .dot { margin-right: 0; width: 7px; height: 7px; }
.chip-wrap .chip { background: transparent; padding-left: 5px; }
.month-head { border-bottom-color: var(--accent); }

/* 표의 차이 칸 */
td.up { color: var(--up); font-weight: 600; }
td.down { color: var(--down); font-weight: 600; }
td .dot { margin-right: 6px; }

/* ---------------------------------------------------------------- 3차: 손가락 밀기, 거르기 막대, 펼침, PC 대시보드 */
/* 긴 막대는 좌우로 밀 수 있어야 한다(.chart 의 pan-y 를 덮어씀) */
.hscroll, .chart.long { touch-action: pan-x pan-y; }

.cat-body.with-pie .donut-wrap { margin-bottom: 14px; }
.d-legend li { border-radius: 8px; padding: 4px 6px; margin: 0 -6px; }
.d-legend li:active { background: var(--surface-2); }

.fbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 14px); z-index: 15;
  display: flex; align-items: center; gap: 8px; width: max-content; max-width: calc(100% - 24px);
  background: var(--text); color: var(--bg); border-radius: 999px; padding: 6px 6px 6px 14px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.fbar .ft { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; }
.fbar button { appearance: none; border: 0; font: inherit; font-size: 13px; border-radius: 999px; padding: 6px 10px; cursor: pointer; background: rgba(255,255,255,.18); color: inherit; white-space: nowrap; }
:root[data-theme="dark"] .fbar button { background: rgba(0,0,0,.12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fbar button { background: rgba(0,0,0,.12); } }
main { padding-bottom: 90px; }

.hdetail { list-style: none; margin: -2px 0 8px 30px; padding: 6px 10px; border-left: 2px solid var(--line); }
.drow { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; color: var(--text-2); }
.drow .dd { flex: 1; }
.drow .da { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.drow .da.neg { color: var(--down); }

/* PC: 넓은 화면에서는 카드를 여러 열·행의 대시보드로 놓는다 */
@media (min-width: 1024px) {
  .top > * { max-width: 1280px; margin-left: auto; margin-right: auto; }
  main { max-width: 1280px; padding: 20px 24px 60px; }
  .tab { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .tab > .card { margin: 0; grid-column: span 12; }
  [data-area="hero"] { grid-column: span 4 !important; }
  [data-area="cats"] { grid-column: span 8 !important; }
  [data-area="daily"] { grid-column: span 7 !important; }
  [data-area="merch"] { grid-column: span 5 !important; }
  [data-area="list"] { grid-column: span 12 !important; }
  [data-area="trend"] { grid-column: span 8 !important; }
  [data-area="compare"] { grid-column: span 4 !important; }
  [data-area="inst"], [data-area="past"] { grid-column: span 6 !important; }
  .hero-card { min-height: 100%; }
  .cat-body.with-pie { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
  .cat-body.with-pie .donut-wrap { grid-template-columns: 1fr; justify-items: center; margin: 0; }
  .cat-body.with-pie .donut { width: 190px; height: 190px; }
  .cat-body.with-pie .d-legend { width: 100%; }
  .cal { max-width: 560px; margin: 0 auto; }
  .cal-d { aspect-ratio: 1.25 / 1; }
  /* 내역은 넓으니 날짜 묶음을 두 줄(단)로 흘린다 */
  #list-card .filters { max-width: 520px; }
  #list-card > div:last-child { columns: 2; column-gap: 32px; }
  #list-card .day, #list-card .item, #list-card .month-head { break-inside: avoid; }
  .fbar { bottom: 24px; }
}

/* 승인 문자 기준(진행 중인 달) 표시 */
.live { color: var(--down); font-weight: 600; }
