:root {
  --bg:#f5f7f6; --surface:#fff; --surface-soft:#eef4f2; --text:#17211f; --muted:#6f7d79;
  --line:#dfe7e4; --accent:#0f766e; --accent-dark:#0a5c56; --accent-soft:#dff2ee;
  --danger:#b42318; --danger-soft:#fff0ee; --income:#0a7a4b; --shadow:0 14px 36px rgba(20,40,35,.08);
}
*{box-sizing:border-box} html{background:var(--bg)} body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,"Noto Sans JP",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
button,input,select{font:inherit} button{cursor:pointer}.app-shell{width:min(720px,100%);min-height:100vh;margin:0 auto;background:var(--bg);padding-bottom:86px}.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;padding:14px 18px 12px;background:rgba(245,247,246,.95);backdrop-filter:blur(16px);border-bottom:1px solid rgba(223,231,228,.85)}
.eyebrow,.section-kicker{margin:0 0 2px;color:var(--accent);font-size:9px;font-weight:900;letter-spacing:.14em}.topbar h1{margin:0;font-size:21px;letter-spacing:-.03em}.month-button{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:8px 11px;color:var(--text);font-size:12px;font-weight:800;display:flex;align-items:center;gap:5px}
main{padding:10px 14px 20px}.view{display:none}.view.active{display:block}.hero-card{background:linear-gradient(145deg,#0f766e,#115f59);color:#fff;border-radius:26px;padding:20px;box-shadow:0 18px 40px rgba(15,118,110,.22)}.hero-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.muted-label{margin:0;color:rgba(255,255,255,.75);font-size:12px;font-weight:700}.hero-value{margin:3px 0 0;font-size:38px;font-weight:900;letter-spacing:-.055em}.status-pill{border-radius:999px;padding:7px 9px;background:rgba(255,255,255,.15);font-size:10px;font-weight:800;white-space:nowrap}.status-pill.good{background:rgba(219,255,239,.18)}.status-pill.warn{background:rgba(255,225,221,.18)}
.hero-grid{display:grid;grid-template-columns:1fr 1fr;gap:1px;margin-top:18px;background:rgba(255,255,255,.15);border-radius:17px;overflow:hidden}.hero-grid>div{padding:12px;background:rgba(255,255,255,.04)}.hero-grid span{display:block;color:rgba(255,255,255,.7);font-size:10px}.hero-grid strong{display:block;margin-top:3px;font-size:15px}
.section-block{margin-top:22px}.last-block{padding-bottom:8px}.compact-top{margin-top:14px}.section-title-row{display:flex;justify-content:space-between;align-items:end;gap:10px;margin:0 2px 10px}.section-title-row h3{margin:0;font-size:17px}.text-button{border:0;background:transparent;color:var(--accent);font-size:11px;font-weight:800;padding:5px}.metric-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.four-grid{grid-template-columns:1fr 1fr}.metric-card{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:14px;min-width:0}.metric-card span{display:block;color:var(--muted);font-size:10px;font-weight:700}.metric-card strong{display:block;margin-top:4px;font-size:16px;letter-spacing:-.02em}.metric-card strong.up{color:var(--danger)}.metric-card strong.down{color:var(--income)}
.insight-list{display:flex;flex-direction:column;gap:8px}.insight-card{display:grid;grid-template-columns:36px 1fr auto;gap:10px;align-items:center;background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:13px}.insight-rank{width:36px;height:36px;border-radius:12px;background:var(--surface-soft);display:grid;place-items:center;font-weight:900;color:var(--accent)}.insight-card strong{display:block;font-size:13px}.insight-card p{margin:3px 0 0;color:var(--muted);font-size:11px}.delta{font-size:12px;font-weight:900;white-space:nowrap}.delta.up{color:var(--danger)}.delta.down{color:var(--income)}
.empty-state{color:var(--muted);font-size:12px;padding:18px;text-align:center;background:var(--surface);border:1px dashed var(--line);border-radius:18px}.analysis-list,.comparison-list,.ranking-list,.transaction-list{display:flex;flex-direction:column;gap:8px}.analysis-row{display:grid;grid-template-columns:minmax(86px,1fr) minmax(90px,1.7fr) 78px;align-items:center;gap:9px}.analysis-row .label{font-size:11px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bar-track{height:10px;background:#e7eeeb;border-radius:99px;overflow:hidden}.bar-fill{height:100%;background:var(--accent);border-radius:inherit}.analysis-row .value{text-align:right;font-size:11px;font-weight:800}
.page-heading{padding:8px 2px 13px}.page-heading h2{margin:0;font-size:27px;letter-spacing:-.04em}.page-note{margin:6px 0 0;color:var(--muted);font-size:11px;line-height:1.6}.filter-panel{position:sticky;top:68px;z-index:10;background:var(--bg);padding-bottom:10px}.search-field{display:flex;align-items:center;gap:8px;border:1px solid var(--line);background:var(--surface);border-radius:16px;padding:0 13px}.search-field input{width:100%;border:0;outline:0;padding:13px 0;background:transparent;font-size:13px}.chip-row{display:flex;gap:7px;margin-top:8px;overflow:auto;padding-bottom:1px}.chip-row.wrap{flex-wrap:wrap;overflow:visible}.filter-chip{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:7px 11px;font-size:10px;color:var(--muted);font-weight:800}.filter-chip.active{background:var(--accent);color:white;border-color:var(--accent)}.list-caption{color:var(--muted);font-size:10px;margin:3px 2px 8px}
.transaction-item{display:grid;grid-template-columns:40px minmax(0,1fr) auto;align-items:center;gap:10px;background:var(--surface);border:1px solid var(--line);border-radius:17px;padding:12px;color:inherit}.transaction-icon{width:40px;height:40px;display:grid;place-items:center;border-radius:13px;background:var(--surface-soft);font-size:18px}.transaction-main{min-width:0}.transaction-main strong{display:block;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.transaction-main span{display:block;margin-top:3px;color:var(--muted);font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.transaction-amount{font-weight:900;font-size:13px;white-space:nowrap}.transaction-amount.income{color:var(--income)}.tag-row{display:flex;gap:4px;margin-top:5px!important}.mini-tag{display:inline-block!important;width:auto!important;border-radius:999px;padding:2px 6px;background:var(--surface-soft);font-size:8px!important;font-weight:800}.mini-tag.special{background:#fff0e8;color:#9a4c12}.mini-tag.fixed{background:#eef0ff;color:#4857a5}
.comparison-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:10px;align-items:center;background:var(--surface);border:1px solid var(--line);border-radius:15px;padding:11px}.comparison-row .name{font-size:12px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.comparison-row .now{font-size:11px;font-weight:800;text-align:right}.comparison-row .diff{font-size:11px;font-weight:900;min-width:70px;text-align:right}.comparison-row .diff.up{color:var(--danger)}.comparison-row .diff.down{color:var(--income)}
.split-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.split-card{background:var(--surface);border:1px solid var(--line);border-radius:17px;padding:13px}.split-card span{display:block;color:var(--muted);font-size:10px}.split-card strong{display:block;font-size:16px;margin-top:3px}.split-card small{display:block;color:var(--muted);font-size:10px;margin-top:2px}.ranking-item{display:grid;grid-template-columns:28px minmax(0,1fr) auto;align-items:center;gap:9px;background:var(--surface);border:1px solid var(--line);border-radius:15px;padding:10px}.rank-num{width:28px;height:28px;border-radius:10px;background:var(--surface-soft);display:grid;place-items:center;color:var(--accent);font-size:10px;font-weight:900}.ranking-item strong{display:block;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ranking-item span{color:var(--muted);font-size:9px}.ranking-value{font-size:12px!important;color:var(--text)!important;font-weight:900!important}
.trend-chart{height:245px;display:grid;grid-template-columns:repeat(12,1fr);align-items:end;gap:4px;padding:18px 7px 8px;background:var(--surface);border:1px solid var(--line);border-radius:20px;overflow:hidden}.trend-col{height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:5px;min-width:0}.trend-bar-wrap{height:175px;width:100%;display:flex;align-items:end;justify-content:center}.trend-bar{width:min(25px,75%);min-height:2px;background:var(--accent);border-radius:7px 7px 2px 2px}.trend-label{font-size:8px;color:var(--muted);white-space:nowrap}.trend-value{font-size:7px;color:var(--muted);writing-mode:vertical-rl;max-height:48px;overflow:hidden}
.settings-card{background:var(--surface);border:1px solid var(--line);border-radius:22px;padding:17px;margin-bottom:12px;box-shadow:0 6px 20px rgba(21,45,38,.03)}.settings-card h3{margin:0;font-size:15px}.settings-card p{margin:6px 0 13px;color:var(--muted);font-size:11px;line-height:1.65}.emphasis-card{border-color:#b9ddd7;background:linear-gradient(180deg,#fff,#f7fcfa)}.primary-button,.secondary-button,.danger-button{min-height:43px;border-radius:14px;padding:10px 13px;font-weight:900;border:0;text-align:center}.primary-button{color:#fff;background:var(--accent)}.secondary-button{color:var(--text);background:var(--surface-soft);border:1px solid var(--line)}.danger-button{color:var(--danger);background:var(--danger-soft)}.file-button{display:flex;align-items:center;justify-content:center}.button-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.small-note{margin:9px 0 0!important;font-weight:800}.danger-card{border-color:#f2c8c4}.field-label{display:flex;flex-direction:column;gap:6px;margin-top:11px;color:var(--muted);font-size:11px;font-weight:800}.field-label input,.field-label select{border:1px solid var(--line);background:#fbfcfc;border-radius:12px;padding:11px;color:var(--text);outline:0}.sync-heading-row{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.sync-heading-row p{margin-bottom:0}.sync-badge{flex:0 0 auto;border-radius:999px;padding:6px 8px;font-size:10px;font-weight:900;background:var(--surface-soft);color:var(--muted);border:1px solid var(--line)}.sync-badge.online{background:var(--accent-soft);color:var(--accent-dark);border-color:#b9ddd7}.sync-badge.syncing{background:#eef2ff;color:#4653a3;border-color:#d7dcff}.sync-badge.error{background:var(--danger-soft);color:var(--danger);border-color:#f2c8c4}.remember-row{display:flex;align-items:center;gap:7px;margin:9px 0 13px;color:var(--muted);font-size:11px;font-weight:800}.remember-row input{width:16px;height:16px;accent-color:var(--accent)}
.classification-editor{display:flex;flex-direction:column;gap:7px;margin:12px 0}.classification-row{display:grid;grid-template-columns:minmax(85px,1fr) 94px 94px;gap:6px;align-items:center}.classification-row .cat{font-size:11px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.classification-row select{width:100%;border:1px solid var(--line);background:#fbfcfc;border-radius:10px;padding:8px 6px;font-size:10px;color:var(--text)}
.bottom-nav{position:fixed;z-index:30;bottom:0;left:50%;transform:translateX(-50%);width:min(720px,100%);display:grid;grid-template-columns:repeat(4,1fr);align-items:end;padding:8px 8px calc(8px + env(safe-area-inset-bottom));background:rgba(255,255,255,.97);border-top:1px solid var(--line);backdrop-filter:blur(16px)}.nav-item{border:0;background:transparent;color:#82908c;display:flex;flex-direction:column;align-items:center;gap:2px;padding:5px 2px 3px;font-size:9px;font-weight:800}.nav-item.active{color:var(--accent)}.nav-icon{font-size:19px;line-height:1.1}.toast{position:fixed;z-index:100;left:50%;bottom:calc(82px + env(safe-area-inset-bottom));transform:translate(-50%,16px);opacity:0;pointer-events:none;transition:.2s ease;background:#17211f;color:white;border-radius:999px;padding:9px 14px;font-size:11px;box-shadow:var(--shadow);white-space:nowrap;max-width:calc(100vw - 28px);overflow:hidden;text-overflow:ellipsis}.toast.show{opacity:1;transform:translate(-50%,0)}.hidden,.visually-hidden{display:none!important}
@media(min-width:720px){body{padding:20px 0}.app-shell{min-height:calc(100vh - 40px);border-radius:30px;overflow:clip;box-shadow:0 22px 70px rgba(20,40,35,.12)}.bottom-nav{width:720px}}

.compact-metrics .metric-card strong{font-size:13px}.compact-metrics .metric-card span{font-size:9px}details.settings-card summary{cursor:pointer;list-style:none;font-size:15px;font-weight:900}details.settings-card summary::-webkit-details-marker{display:none}details.settings-card[open] summary{margin-bottom:10px}
