:root {
  color-scheme: light;
  --ink: #29233a; --muted: #696477; --soft: #817b90; --line: #ebe8f1;
  --paper: #fff; --ground: #f8f7fb; --violet: #684cb8; --deep: #302449;
  --peach: #ffab90; --radius: 19px; --shadow: 0 3px 11px #21143c05;
  font-family: Inter, "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
:focus-visible { outline: 3px solid #9a80ec; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
svg.icon { width: 19px; height: 19px; flex: none; vertical-align: middle; }
.skip { position: fixed; z-index: 10; left: 12px; top: -60px; padding: 8px 14px; background: white; border-radius: 6px; }
.skip:focus { top: 12px; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1376px; width: calc(100% - 80px); margin: auto; min-height: 73px; display: flex; align-items: center; gap: 38px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: max-content; font-weight: 850; font-size: 21px; letter-spacing: -.09em; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; color: #ffac93; background: var(--deep); border-radius: 11px; }
.brand-mark .icon { width: 25px; height: 25px; }
.brand-dot { color: #e47e64; padding-left: 2px; }
.nav { display: flex; align-items: center; gap: 5px; }
.nav a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border-radius: 9px; color: #696278; font-size: 13px; font-weight: 700; white-space: nowrap; }
.nav .icon { width: 16px; height: 16px; }
.nav a:hover, .nav a[aria-current="page"] { background: #f0ebfb; color: #5a429c; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; padding: 9px 14px; min-height: 40px; border-radius: 9px; border: 1px solid transparent; font-size: 13px; font-weight: 720; text-align: center; }
.button .icon { width: 16px; height: 16px; }
.top-upload, .primary { background: var(--deep); color: white; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.top-actions .button { white-space: nowrap; }
.top-actions form { margin: 0; }
.top-upload:hover, .primary:hover { background: #4a3869; }
.secondary { background: white; color: var(--ink); border-color: #e4e0ed; }
.secondary:hover, .quiet:hover { background: #f4f0fb; border-color: #ded4f3; }
.quiet { border-color: transparent; background: transparent; color: var(--violet); min-height: 32px; padding: 5px 8px; }
.danger { color: #9a3033; }
.shell { max-width: 1376px; width: calc(100% - 80px); margin: 0 auto; padding: 33px 0 0; }
.heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 23px; }
h1 { font-size: clamp(28px, 3.5vw, 41px); line-height: 1.22; font-weight: 850; letter-spacing: -.069em; }
.heading p { font-size: 13px; color: var(--muted); margin-top: 9px; letter-spacing: -.025em; }
.heading-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.pill { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border-radius: 999px; padding: 5px 10px; color: #74482a; background: #fff0e4; font-size: 11px; font-weight: 800; }
.pill::before { content: ""; display: inline-block; flex: none; width: 6px; height: 6px; border-radius: 50%; background: #d77a4c; }
.select-wrap { position: relative; display: inline-flex; align-items: center; min-width: max-content; }
.select-wrap > .icon { position: absolute; left: 11px; width: 16px; height: 16px; color: #6c568f; pointer-events: none; }
.select-wrap select { padding-left: 35px; font-weight: 700; }
select, input, textarea { border: 1px solid #e3dfeb; border-radius: 8px; padding: 8px 10px; min-height: 38px; color: var(--ink); background: white; }
select { padding-right: 26px; }
input::placeholder, textarea::placeholder { color: #8d879a; }
.hero-grid, .analytics { display: grid; grid-template-columns: minmax(0, 1.58fr) minmax(0, 1fr); gap: 18px; }
.balance { position: relative; overflow: hidden; min-height: 245px; display: flex; align-items: stretch; justify-content: space-between; border-radius: 21px; padding: 25px 27px 24px; background: radial-gradient(ellipse at 94% 10%, #67498a 0, #44315f 38%, #302447 72%); color: white; }
.balance::after { content: ""; position: absolute; width: 380px; height: 380px; right: -166px; top: -150px; border: 1px solid #d6b9fa23; border-radius: 50%; box-shadow: 0 0 0 26px #d6b9fa13, 0 0 0 54px #d6b9fa0f; pointer-events: none; }
.balance-info { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: start; }
.hero-label { display: flex; align-items: center; gap: 9px; font-weight: 720; color: #f3eafc; letter-spacing: -.023em; }
.hero-label .icon { width: 17px; height: 17px; color: #ffc1ac; }
.hero-amount { margin-top: 11px; font-size: clamp(28px, 4.4vw, 57px); line-height: 1.04; font-weight: 830; letter-spacing: -.065em; white-space: nowrap; }
.hero-amount small { display: inline-block; margin-left: 4px; font-size: .44em; font-weight: 650; letter-spacing: -.06em; }
.delta-line { display: flex; align-items: center; gap: 7px; margin-top: 13px; color: #dfd4ed; font-size: 12px; }
.delta { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 20px; font-weight: 780; color: #fdd9cc; background: #c566693b; white-space: nowrap; }
.delta.down { color: #d9fae9; background: #48967648; }
.delta .icon { width: 13px; height: 13px; }
.hero-meta { display: flex; align-items: center; gap: 14px; color: #e3d9f0; margin-top: auto; padding-top: 17px; font-size: 12px; white-space: nowrap; }
.hero-meta span { display: inline-flex; align-items: center; gap: 5px; }
.hero-meta span + span { padding-left: 14px; border-left: 1px solid #ffffff3a; }
.hero-meta .icon { width: 15px; height: 15px; color: #d4baea; }
.mini-chart { position: relative; z-index: 1; flex: 0 1 235px; min-width: 0; align-self: end; margin-left: 18px; }
.mini-bars { display: flex; height: 101px; gap: clamp(5px, 1.1vw, 13px); align-items: end; border-bottom: 1px solid #fff3; padding: 0 2px; }
.mini-bar { flex: 1; min-width: 0; border-radius: 5px 5px 0 0; background: #d1b3eb5c; }
.mini-bar:last-child { background: linear-gradient(180deg, #ffc1a9, #ed876e); }
.mini-label { margin-top: 7px; display: flex; justify-content: space-between; color: #e5d7f2; font-size: 10px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.upload { padding: 18px; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 208px; gap: 7px; padding: 12px; text-align: center; border: 1.5px dashed #d9cdec; border-radius: 13px; background: #fcfaff; }
.drop.drag { background: #eee4fc; border-color: #8a69da; }
.drop-icon, .modal-icon { display: grid; place-items: center; width: 42px; height: 42px; color: #7151b5; background: #f0e9fc; border-radius: 12px; margin-bottom: 1px; }
.drop-icon .icon { width: 23px; height: 23px; }
.drop h2 { font-size: 18px; font-weight: 830; letter-spacing: -.045em; }
.drop p { font-size: 12px; color: var(--muted); }
.drop .button { margin-top: 3px; min-height: 36px; padding: 6px 13px; }
.drop .drop-foot { display: flex; justify-content: center; align-items: center; gap: 4px; font-size: 10px; color: #736983; margin-top: 2px; }
.drop-foot .icon { height: 12px; width: 12px; }
.drop-foot .quiet { min-height: 24px; padding: 2px 5px; font-size: 11px; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 17px 0; }
.kpi { display: flex; gap: 13px; align-items: start; padding: 17px 18px 15px; }
.kpi-icon, .category-icon, .issuer-icon { display: grid; flex: none; place-items: center; width: 39px; height: 39px; border-radius: 11px; background: var(--shade, #efe9fb); color: var(--tint, #7558b4); }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 720; }
.kpi-value { font-size: clamp(19px, 2.15vw, 28px); line-height: 1.2; font-weight: 830; letter-spacing: -.045em; margin: 4px 0 2px; overflow-wrap: anywhere; }
.kpi-note { color: var(--muted); font-size: 11px; }
.chart-card { padding: 20px 21px 16px; }
.card-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.card-head h2 { font-size: 18px; letter-spacing: -.044em; font-weight: 830; }
.card-head p { color: var(--muted); font-size: 12px; margin-top: 3px; letter-spacing: -.02em; }
.chart-key { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 650; padding-top: 4px; white-space: nowrap; }
.dot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 3px; background: var(--tint, #9678dd); }
.trend { height: 169px; display: flex; gap: 9px; margin-top: 3px; }
.axis-labels { flex: 0 0 47px; text-align: right; padding-bottom: 22px; display: flex; flex-direction: column; justify-content: space-between; color: var(--soft); font-size: 10px; font-variant-numeric: tabular-nums; }
.plot { position: relative; flex: 1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: stretch; gap: 2px; }
.gridlines { pointer-events: none; position: absolute; top: 7px; bottom: 27px; width: 100%; display: flex; flex-direction: column; justify-content: space-between; }
.gridlines i { width: 100%; border-top: 1px dashed #eee9f3; }
.bar-group { display: flex; flex-direction: column; position: relative; align-items: center; justify-content: end; min-width: 0; }
.bar-target { flex: 1; margin-top: 7px; width: 100%; display: flex; justify-content: center; align-items: end; border: 0; background: transparent; padding: 0; position: relative; }
.bar-fill { width: min(44px, 66%); background: #d8caef; border-radius: 6px 6px 0 0; min-height: 2px; }
.bar-group:last-child .bar-fill { background: linear-gradient(#a68be8, #8059ca); }
.bar-target:hover .bar-fill, .bar-target:focus .bar-fill { filter: brightness(.9); }
.bar-group label { display: block; height: 26px; padding-top: 6px; color: var(--muted); font-size: 11px; pointer-events: none; }
.bar-group:last-child label { color: #6949b1; font-weight: 800; }
.breakdown { display: flex; align-items: center; justify-content: space-around; gap: 17px; min-height: 172px; }
.donut { display: grid; flex: none; place-items: center; position: relative; width: 143px; height: 143px; border-radius: 50%; background: var(--chart, #ede8f5); }
.donut::before { content: ""; position: absolute; width: 105px; height: 105px; background: white; border-radius: 50%; }
.donut-center { z-index: 1; max-width: 97px; text-align: center; line-height: 1.19; }
.donut-center span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.donut-center strong { font-size: 14px; white-space: nowrap; letter-spacing: -.045em; }
.legend { list-style: none; padding: 0; margin: 0; flex: 1; max-width: 216px; min-width: 0; display: grid; gap: 8px; }
.legend li { display: flex; align-items: center; gap: 7px; font-size: 11px; min-width: 0; }
.legend li span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend li strong { margin-left: auto; color: #655e73; }
.table-card { margin-top: 17px; padding: 19px 21px; }
.table-card:first-child { margin-top: 0; }
.issuer-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 220px),1fr)); gap: 9px; }
.issuer-tile { min-width: 0; display: flex; align-items: center; gap: 8px; background: #fcfafd; border: 1px solid var(--line); padding: 9px 10px; border-radius: 11px; color: var(--ink); text-align: left; }
.issuer-tile:hover { background: #f4effb; border-color: #ded4f3; }
.issuer-title { min-width: 0; line-height: 1.25; }
.issuer-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.issuer-title small { display: block; color: var(--muted); margin-top: 4px; font-size: 10px; }
.issuer-tile b { margin-left: auto; font-size: 13px; white-space: nowrap; }
.issuer-tile > .icon { width: 14px; height: 14px; color: var(--violet); }
.issuer-icon { width: 31px; height: 31px; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-size: 13px; }
th { background: #f7f5fa; color: #6d647c; font-size: 11px; font-weight: 750; }
th:first-child { border-radius: 8px 0 0 8px; }
th:last-child { border-radius: 0 8px 8px 0; }
th, td { padding: 10px 13px; }
td { border-bottom: 1px solid #f0edf4; }
tbody tr:last-child td { border-bottom: 0; }
td strong { font-weight: 760; }
.money { text-align: right; font-variant-numeric: tabular-nums; }
.negative { color: #7951b2; }
.merchant { display: flex; align-items: center; gap: 8px; }
.category-icon { width: 29px; height: 29px; border-radius: 8px; }
.category-icon .icon, .issuer-icon .icon { width: 15px; height: 15px; }
.card-chip, .kind { background: #f1edf8; border-radius: 20px; padding: 4px 8px; color: #675583; font-size: 11px; font-weight: 730; }
.kind.installment { color: #8a5331; background: #fff1e5; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input { min-width: min(220px, 100%); }
.empty { display: grid; justify-items: center; gap: 9px; text-align: center; padding: 31px 12px; white-space: normal; color: var(--muted); }
.empty .icon { color: #a185cd; }
.empty strong { color: var(--ink); }
.summary { display: flex; gap: 15px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 17px; padding: 19px 21px; }
.summary strong { font-size: 27px; color: var(--deep); letter-spacing: -.045em; display: block; }
.summary span { color: var(--muted); font-size: 12px; }
.statement-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; gap: 17px; }
.statement-layout .table-card { margin: 0; }
.statement-side { display: grid; gap: 16px; }
.settings { padding: 18px; }
.settings h2 { font-size: 16px; }
.settings p { margin: 5px 0 12px; font-size: 12px; color: var(--muted); }
.footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 20px 0 24px; color: var(--muted); font-size: 11px; }
.footer > span:last-child { display: flex; align-items: center; gap: 5px; }
.footer-name { color: #5c4c73; font-weight: 800; }
.footer .icon { width: 14px; height: 14px; }
dialog { border: 1px solid var(--line); color: var(--ink); background: white; border-radius: 17px; padding: 0; max-height: calc(100dvh - 28px); width: min(960px, calc(100% - 26px)); box-shadow: 0 20px 80px #23143244; overflow: auto; }
dialog::backdrop { background: #22163081; backdrop-filter: blur(3px); }
#password, #review.narrow { width: min(445px, calc(100% - 26px)); }
.modal { padding: 23px 24px; }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.modal h2, .password-form h2 { font-size: 22px; letter-spacing: -.05em; }
.modal p, .password-form p { color: var(--muted); margin-top: 5px; font-size: 13px; overflow-wrap: anywhere; }
.close { width: 34px; height: 34px; display: grid; place-items: center; background: white; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin: 16px 0; }
.form-grid label, .password-form label, .settings-label { display: grid; gap: 4px; font-weight: 700; font-size: 12px; }
.form-grid select, .form-grid input, .password-form input, .settings-label input { min-width: 0; width: 100%; }
.notice { border-radius: 8px; padding: 9px 11px; color: #79522d !important; margin-top: 12px !important; background: #fff5e9; }
.review-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0; }
.review-actions h3 { font-size: 14px; }
.review-table { max-height: 360px; }
.review-table th, .review-table td { padding: 5px; }
.review-table input, .review-table select { min-height: 33px; padding: 5px 6px; width: 100%; }
.review-table .merchant-input { min-width: 130px; }
.review-table .amt-input { min-width: 84px; }
.review-table .round-input { min-width: 48px; width: 52px; }
details { margin-top: 14px; font-size: 12px; }
summary { cursor: pointer; font-weight: 720; color: var(--violet); }
details textarea { width: 100%; display: block; min-height: 100px; margin: 7px 0; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 15px; }
.password-form { padding: 22px; }
.password-form label, .settings-label { margin-top: 13px; }
.checkbox { margin-top: 11px; display: flex; align-items: center; gap: 7px; font-size: 12px; }
.checkbox input { min-height: auto; accent-color: var(--violet); }
.toast { position: fixed; z-index: 20; bottom: 18px; right: 18px; max-width: min(500px, calc(100% - 36px)); padding: 13px 15px; border-radius: 11px; color: white; background: #382b50; box-shadow: 0 9px 32px #23143233; font-size: 13px; }
@media (min-width: 1500px) { .shell { padding-top: 41px; } }
@media (max-width: 1040px) { .topbar-inner, .shell { width: calc(100% - 48px); } .topbar-inner { gap: 22px; } .balance { padding: 21px; } .breakdown { gap: 11px; } .donut { width: 118px; height: 118px; } .donut::before { width: 85px; height: 85px; } .donut-center strong { font-size: 12px; } }
@media (max-width: 780px) {
  .topbar-inner, .shell { width: calc(100% - 32px); }
  .topbar-inner { flex-wrap: wrap; gap: 0 10px; padding: 10px 0 4px; }
  .brand { order: 0; } .top-actions { order: 1; } .nav { order: 2; width: 100%; margin-top: 6px; overflow-x: auto; }
  .nav a { padding: 7px 9px; font-size: 12px; gap: 5px; }
  .shell { padding-top: 23px; }
  .heading { align-items: start; flex-direction: column; gap: 12px; margin-bottom: 16px; }
  .hero-grid, .analytics, .statement-layout { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .balance { min-height: 193px; }
  .hero-amount { font-size: clamp(29px, 7vw, 49px); }
  .mini-chart { flex-basis: 180px; }
  .upload { padding: 12px; } .drop { min-height: 166px; padding: 11px; }
  .kpis { margin: 13px 0; gap: 8px; }
  .kpi { padding: 11px; flex-direction: column; gap: 6px; }
  .kpi-icon { width: 31px; height: 31px; } .kpi-icon .icon { width: 15px; height: 15px; }
  .kpi-label, .kpi-note { font-size: 10px; }
  .kpi-value { font-size: clamp(14px, 4vw, 23px); }
  .table-card, .chart-card { padding: 14px; }
  .table-card th.money, .table-card td.money { position: sticky; right: 0; box-shadow: -1px 0 0 #ebe8f1; }
  .table-card td.money { background: var(--paper); }
  .footer { flex-wrap: wrap; }
}
@media (max-width: 385px) { .mini-chart { display: none; } .nav a { padding: 7px 7px; } .topbar-inner, .shell { width: calc(100% - 24px); } }
@media (prefers-reduced-motion: no-preference) { .button, .nav a, .drop { transition: background-color .16s, border-color .16s; } }


.transaction-note { color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 28ch; font-size: 12px; }
.schedule-row {display:flex;justify-content:space-between;gap:1em;padding:6px 0;border-bottom:1px solid var(--line);font-variant-numeric:tabular-nums}
.unit-title{font-size:22px;margin:24px 0 10px}.budget{margin-bottom:17px}.budget-totals{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:12px;margin:16px 0}.budget-totals>div{background:#f5f1fa;border-radius:12px;padding:12px;color:var(--muted)}.budget-totals strong{display:block;font-size:22px;color:var(--ink)}.budget .kpi-note{margin:8px 0}
.combined-detail{color:#e5dcef;font-size:12px;margin-top:8px}#combined-spend{margin-bottom:17px}

#combined-spend{display:grid;gap:16px;min-width:0}

.issuer-total{display:grid;gap:4px;margin-bottom:14px;padding:14px;border-radius:10px;background:#f5f1fa}.issuer-total strong{font-size:24px}.issuer-total small{color:var(--muted)}.lifetime-total{margin-top:10px}.lifetime-total strong{font-size:1.2em}
