/* =========================================================
   青账 QINGZHANG — a local-first pocket ledger for students
   ========================================================= */

:root {
  --font-sans: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-num: "Bahnschrift", "DIN Alternate", "Avenir Next", "Segoe UI", "PingFang SC", sans-serif;
  --font-serif: "Songti SC", "STSong", "SimSun", Georgia, serif;

  --bg: #f3f0e7;
  --bg-deep: #ebe6d9;
  --surface: #fffdf8;
  --surface-2: #f7f3e9;
  --surface-3: #eee9dd;
  --surface-raised: #fffefb;
  --ink: #202a24;
  --ink-2: #455047;
  --muted: #798177;
  --faint: #a4aaa1;
  --line: rgba(50, 66, 54, 0.1);
  --line-strong: rgba(50, 66, 54, 0.17);
  --brand: #245b44;
  --brand-deep: #173f2e;
  --brand-soft: #e2ece3;
  --brand-tint: #eff5ef;
  --accent: #e36d4a;
  --accent-deep: #c95333;
  --accent-soft: #fae6de;
  --gold: #c79737;
  --gold-soft: #f6edd8;
  --blue: #4f7fa4;
  --blue-soft: #e4edf4;
  --rose: #d86672;
  --rose-soft: #f9e5e7;
  --green: #2f7e5c;
  --green-soft: #e3f0e7;
  --red: #c55249;
  --red-soft: #f8e6e2;
  --white: #ffffff;
  --hero-bg: #1d4a37;
  --hero-bg-2: #133527;
  --chart-line: #2f7c5c;
  --chart-grid: rgba(50, 66, 54, 0.1);

  --shadow-xs: 0 1px 2px rgba(31, 43, 35, 0.03);
  --shadow-sm: 0 1px 2px rgba(31, 43, 35, 0.03), 0 10px 30px -24px rgba(31, 43, 35, 0.38);
  --shadow-md: 0 2px 6px rgba(31, 43, 35, 0.035), 0 24px 55px -36px rgba(31, 43, 35, 0.42);
  --shadow-lg: 0 30px 80px -38px rgba(20, 36, 26, 0.5), 0 3px 12px rgba(20, 36, 26, 0.06);

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --sidebar-w: 252px;
  --page-pad: clamp(18px, 2.6vw, 38px);
  --topbar-h: 86px;
  --focus: rgba(36, 91, 68, 0.45);
  --ease: cubic-bezier(0.22, 0.72, 0.28, 1);
  --transition: 180ms var(--ease);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #121714;
  --bg-deep: #0d120f;
  --surface: #1a211c;
  --surface-2: #202821;
  --surface-3: #273129;
  --surface-raised: #1d251f;
  --ink: #edf1e8;
  --ink-2: #c9d1c6;
  --muted: #939c92;
  --faint: #687269;
  --line: rgba(230, 239, 230, 0.085);
  --line-strong: rgba(230, 239, 230, 0.16);
  --brand: #347a5a;
  --brand-deep: #1e4b36;
  --brand-soft: #23372b;
  --brand-tint: #1d2c23;
  --accent: #ee8862;
  --accent-deep: #f09b7a;
  --accent-soft: #38251e;
  --gold: #d8b56b;
  --gold-soft: #322a1c;
  --blue: #7ba8c8;
  --blue-soft: #1c2a32;
  --rose: #e08a93;
  --rose-soft: #332126;
  --green: #70bf98;
  --green-soft: #1d3027;
  --red: #ec8c82;
  --red-soft: #38231f;
  --hero-bg: #1d4634;
  --hero-bg-2: #142f23;
  --chart-line: #7cc39e;
  --chart-grid: rgba(230, 239, 230, 0.08);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.18);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.16), 0 12px 32px -25px rgba(0, 0, 0, 0.85);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.2), 0 28px 55px -36px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 30px 80px -32px rgba(0, 0, 0, 0.9), 0 3px 12px rgba(0, 0, 0, 0.3);
  --focus: rgba(140, 200, 164, 0.55);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 300px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open,
body.menu-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

p,
h1,
h2,
h3,
h4 {
  margin: 0;
}

button,
a,
input,
select,
textarea,
label {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

::selection {
  background: color-mix(in srgb, var(--brand) 28%, transparent);
}

[hidden] {
  display: none !important;
}

.hidden {
  display: none !important;
}

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

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
}

.muted {
  color: var(--muted);
}

.income-text {
  color: var(--green);
}

.expense-text {
  color: var(--ink);
}

.danger-text {
  color: var(--red);
}

.inline-icon {
  display: inline-flex;
  vertical-align: -0.18em;
}

/* ---------- ambient background ---------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(2px);
}

.ambient-blob--one {
  top: -220px;
  right: -160px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle at 40% 55%, rgba(207, 171, 109, 0.2), rgba(207, 171, 109, 0) 68%);
}

.ambient-blob--two {
  top: 36%;
  left: -260px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle at 50% 50%, rgba(86, 136, 104, 0.13), rgba(86, 136, 104, 0) 70%);
}

.ambient-grid {
  position: absolute;
  top: 0;
  right: 0;
  width: 58vw;
  height: 52vh;
  background-image: radial-gradient(rgba(46, 63, 51, 0.16) 0.7px, transparent 0.7px);
  background-size: 20px 20px;
  opacity: 0.45;
  mask-image: linear-gradient(145deg, rgba(0, 0, 0, 0.9), transparent 68%);
  -webkit-mask-image: linear-gradient(145deg, rgba(0, 0, 0, 0.9), transparent 68%);
}

[data-theme="dark"] .ambient-grid {
  background-image: radial-gradient(rgba(218, 234, 221, 0.17) 0.7px, transparent 0.7px);
  opacity: 0.25;
}

[data-theme="dark"] .ambient-blob--one {
  background: radial-gradient(circle at 40% 55%, rgba(160, 119, 52, 0.12), transparent 68%);
}

[data-theme="dark"] .ambient-blob--two {
  background: radial-gradient(circle at 50% 50%, rgba(75, 132, 97, 0.12), transparent 70%);
}

/* ---------- app frame ---------- */

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  width: 100%;
  max-width: 1720px;
  min-height: 100vh;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 28px 20px 18px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 38%, transparent), transparent 42%);
  backdrop-filter: blur(20px);
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.main-shell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  margin: 0 4px 8px;
  border-radius: 16px;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  flex: none;
  border-radius: 14px;
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.2), transparent 30%),
    linear-gradient(145deg, #2c6a4f, #194430);
  box-shadow: 0 8px 20px -12px rgba(21, 59, 42, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  color: #f8f3e5;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.brand-spark {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #eaa46d;
  box-shadow: 0 0 0 3px rgba(234, 164, 109, 0.13);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.15;
}

.brand-copy small {
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.nav-caption {
  margin: 28px 12px 8px;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 43px;
  padding: 0 12px;
  border-radius: 13px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}

.nav-item:hover {
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  color: var(--ink);
}

.nav-item.active {
  background: var(--surface);
  color: var(--brand);
  font-weight: 650;
  box-shadow: var(--shadow-sm);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 21px;
  color: var(--muted);
  transition: color var(--transition);
}

.nav-icon .icon {
  width: 19px;
  height: 19px;
}

.nav-item.active .nav-icon {
  color: var(--brand);
}

.nav-pip {
  width: 5px;
  height: 5px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity var(--transition), transform var(--transition);
}

.nav-item.active .nav-pip {
  opacity: 1;
  transform: scale(1);
}

.sidebar-spacer {
  flex: 1;
  min-height: 20px;
}

.sidebar-budget {
  margin: 10px 0 12px;
}

.side-budget-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--gold) 12%, transparent), transparent 52%),
    var(--surface-2);
}

.side-budget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10.5px;
}

.side-budget-head button {
  padding: 2px;
  background: none;
  color: var(--brand);
  font-size: 10.5px;
  font-weight: 650;
}

.side-budget-amount {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 5px 0 9px;
  font-family: var(--font-num);
}

.side-budget-amount strong {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.side-budget-amount span {
  color: var(--faint);
  font-family: var(--font-sans);
  font-size: 9.5px;
}

.side-budget-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--faint);
  font-size: 9.5px;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 500ms var(--ease);
}

.progress-track--warm > span {
  background: linear-gradient(90deg, var(--gold), var(--accent));
}

.progress-track--danger > span {
  background: var(--red);
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 15px;
  transition: background var(--transition), border-color var(--transition);
}

.sidebar-profile:hover {
  border-color: var(--line);
  background: var(--surface);
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--brand-soft), var(--surface-3));
  color: var(--brand);
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
}

.avatar--profile {
  width: 37px;
  height: 37px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.7), transparent 40%),
    linear-gradient(145deg, #d8e7d7, #b7d0bd);
  color: #255743;
}

[data-theme="dark"] .avatar--profile {
  background: linear-gradient(145deg, #365a44, #264432);
  color: #e2f0e4;
}

.profile-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.35;
}

.profile-copy strong {
  overflow: hidden;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy small {
  color: var(--faint);
  font-size: 9.5px;
}

.profile-chevron {
  margin-left: auto;
  color: var(--faint);
}

.profile-chevron .icon {
  width: 15px;
  height: 15px;
}

.sidebar-footnote {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 11px 0 0 10px;
  color: var(--faint);
  font-size: 9px;
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 12%, transparent);
}

.sidebar-close {
  display: none;
}

.sidebar-scrim {
  display: none;
}

/* ---------- topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: var(--topbar-h);
  padding: 21px var(--page-pad) 13px;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 94%, transparent) 54%, color-mix(in srgb, var(--bg) 72%, transparent) 84%, transparent);
  backdrop-filter: blur(18px);
}

.topbar-title-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.topbar-heading {
  min-width: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  color: var(--faint);
  font-family: var(--font-num);
  font-size: 9px;
  letter-spacing: 0.09em;
}

.breadcrumb-slash {
  opacity: 0.6;
}

.topbar h1 {
  overflow: hidden;
  font-size: 21px;
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-heading p {
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.month-switcher {
  display: flex;
  align-items: center;
  gap: 1px;
  height: 41px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.month-pick {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 98px;
  height: 30px;
  padding: 0 5px;
  border-radius: 9px;
  cursor: pointer;
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background var(--transition);
}

.month-pick:hover {
  background: var(--surface-2);
}

.month-pick input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.month-reset {
  width: 25px !important;
  height: 25px !important;
  margin-left: 2px;
  color: var(--muted);
}

.month-reset.hidden {
  display: none !important;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-2);
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}

.icon-btn .icon {
  width: 18px;
  height: 18px;
}

.icon-btn:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.icon-btn:active {
  transform: scale(0.96);
}

.icon-btn--small {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  color: var(--muted);
}

.icon-btn--small .icon {
  width: 15px;
  height: 15px;
}

.icon-btn--mobile,
.mobile-search-btn {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 41px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 620;
  line-height: 1;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  border-color: color-mix(in srgb, var(--brand-deep) 40%, transparent);
  background: linear-gradient(150deg, #2b664d, var(--brand-deep));
  box-shadow: 0 8px 20px -13px rgba(23, 63, 46, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  color: #fbf8ef;
}

.btn--primary:hover {
  box-shadow: 0 12px 25px -13px rgba(23, 63, 46, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn--soft {
  background: var(--brand-tint);
  color: var(--brand);
}

.btn--soft:hover {
  background: var(--brand-soft);
}

.btn--ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink-2);
}

.btn--ghost:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.btn--outline {
  border-color: var(--line-strong);
  background: var(--surface);
}

.btn--danger {
  border-color: color-mix(in srgb, var(--red) 22%, transparent);
  background: var(--red-soft);
  color: var(--red);
}

.btn--danger-solid {
  background: var(--red);
  color: #fff;
}

.btn--sm {
  height: 33px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 11px;
}

.btn--sm .icon {
  width: 14px;
  height: 14px;
}

.btn--wide {
  width: 100%;
}

.btn-add {
  height: 41px;
  padding: 0 16px 0 14px;
  border-radius: 12px;
}

.btn-add .icon {
  width: 17px;
  height: 17px;
}

.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

/* ---------- view + shared ---------- */

.view {
  flex: 1;
  width: 100%;
  max-width: 1390px;
  margin: 0 auto;
  padding: 2px var(--page-pad) 34px;
  outline: none;
}

.view--animate > * {
  animation: riseIn 420ms var(--ease) both;
}

.view--animate > *:nth-child(2) {
  animation-delay: 45ms;
}

.view--animate > *:nth-child(3) {
  animation-delay: 80ms;
}

.view--animate > *:nth-child(4) {
  animation-delay: 110ms;
}

.view--animate > *:nth-child(5) {
  animation-delay: 140ms;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 4px var(--page-pad) 26px;
  color: var(--faint);
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.foot-dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--faint);
}

.card {
  position: relative;
  min-width: 0;
  padding: clamp(18px, 1.8vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card--flush {
  padding: 0;
  overflow: hidden;
}

.card--soft {
  background: var(--surface-2);
}

.card--accent {
  border-color: color-mix(in srgb, var(--gold) 18%, var(--line));
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--gold) 11%, transparent), transparent 42%),
    var(--surface);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head--center {
  align-items: center;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 660;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.section-title .icon {
  width: 16px;
  height: 16px;
  color: var(--faint);
}

.section-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
  padding: 5px 0;
  background: transparent;
  color: var(--brand);
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}

.section-link .icon {
  width: 13px;
  height: 13px;
  transition: transform var(--transition);
}

.section-link:hover .icon {
  transform: translateX(2px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 9.5px;
  font-weight: 560;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 2px 2px 22px;
}

.page-head h2 {
  margin-top: 5px;
  font-size: clamp(25px, 2.5vw, 33px);
  font-weight: 660;
  letter-spacing: -0.045em;
  line-height: 1.2;
}

.page-head p {
  max-width: 520px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11.5px;
}

.page-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}

.pill .icon {
  width: 11px;
  height: 11px;
}

.pill--brand {
  background: var(--brand-tint);
  color: var(--brand);
}

.pill--accent {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.pill--green {
  background: var(--green-soft);
  color: var(--green);
}

.pill--red {
  background: var(--red-soft);
  color: var(--red);
}

.pill--gold {
  background: var(--gold-soft);
  color: color-mix(in srgb, var(--gold) 82%, var(--ink));
}

.pill--ghost {
  border: 1px solid var(--line);
  background: transparent;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}

.tag + .tag {
  margin-left: 3px;
}

.divider {
  height: 1px;
  border: 0;
  margin: 16px 0;
  background: var(--line);
}

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.kbd {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 9px;
}

/* ---------- overview ---------- */

.overview-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 3px 2px 23px;
}

.overview-greeting .eyebrow {
  margin-bottom: 7px;
}

.overview-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(27px, 3.1vw, 38px);
  font-weight: 660;
  letter-spacing: -0.055em;
  line-height: 1.16;
}

.overview-title .name {
  position: relative;
  color: var(--brand);
}

.overview-sub {
  max-width: 560px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.overview-sub strong {
  color: var(--ink-2);
  font-weight: 620;
}

.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  margin-bottom: 4px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--gold) 22%, var(--line));
  border-radius: 13px;
  background: color-mix(in srgb, var(--gold-soft) 45%, var(--surface));
  color: color-mix(in srgb, var(--gold) 74%, var(--ink));
  font-size: 10.5px;
  font-weight: 600;
}

.streak-chip .icon {
  width: 14px;
  height: 14px;
  color: var(--gold);
}

.demo-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 11px 14px;
  border: 1px solid color-mix(in srgb, var(--gold) 24%, var(--line));
  border-radius: 15px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--gold-soft) 65%, var(--surface)), var(--surface) 70%);
  color: var(--ink-2);
  font-size: 10.5px;
}

.demo-banner-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: none;
  border-radius: 9px;
  background: var(--gold-soft);
  color: var(--gold);
}

.demo-banner-icon .icon {
  width: 15px;
  height: 15px;
}

.demo-banner p {
  flex: 1;
  line-height: 1.5;
}

.demo-banner p strong {
  color: var(--ink);
  font-weight: 650;
}

.demo-banner-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.demo-banner-link {
  padding: 5px 7px;
  border-radius: 7px;
  background: none;
  color: var(--gold);
  font-size: 10px;
  font-weight: 650;
}

.demo-banner-link:hover {
  background: var(--gold-soft);
}

.demo-banner-close {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: transparent;
  color: var(--faint);
}

.demo-banner-close:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.demo-banner-close .icon {
  width: 14px;
  height: 14px;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.63fr) minmax(280px, 0.83fr);
  gap: 16px;
  margin-bottom: 16px;
}

.hero-card {
  position: relative;
  display: flex;
  min-height: 286px;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(22px, 2.5vw, 30px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 30px;
  background:
    radial-gradient(circle at 86% 12%, rgba(236, 183, 121, 0.18), transparent 30%),
    radial-gradient(circle at 12% 108%, rgba(101, 160, 126, 0.22), transparent 46%),
    linear-gradient(135deg, var(--hero-bg) 0%, var(--hero-bg-2) 100%);
  box-shadow: 0 24px 50px -32px rgba(17, 49, 34, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #f5f1e4;
}

.hero-card::before {
  position: absolute;
  top: -172px;
  right: -150px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(255, 250, 234, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(255, 250, 234, 0.026), 0 0 0 78px rgba(255, 250, 234, 0.018);
  content: "";
  pointer-events: none;
}

.hero-card::after {
  position: absolute;
  right: 20%;
  bottom: -88px;
  width: 280px;
  height: 170px;
  border-radius: 50%;
  background: rgba(238, 174, 107, 0.07);
  filter: blur(18px);
  content: "";
  pointer-events: none;
}

.hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(249, 245, 232, 0.72);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.hero-label .icon {
  width: 14px;
  height: 14px;
  color: rgba(249, 245, 232, 0.55);
}

.hero-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  color: rgba(246, 243, 232, 0.86);
  font-size: 9px;
  font-weight: 550;
  white-space: nowrap;
}

.hero-trend .icon {
  width: 11px;
  height: 11px;
}

.hero-trend--good {
  color: #cbe7c8;
}

.hero-trend--bad {
  color: #f3c4a6;
}

.hero-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-top: auto;
  padding-top: 20px;
  font-family: var(--font-num);
  line-height: 1;
}

.hero-currency {
  padding-bottom: 7px;
  color: rgba(248, 244, 230, 0.58);
  font-size: 19px;
  font-weight: 500;
}

.hero-number {
  font-size: clamp(48px, 5.5vw, 68px);
  font-weight: 520;
  letter-spacing: -0.055em;
}

.hero-decimal {
  padding-bottom: 9px;
  color: rgba(248, 244, 230, 0.55);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.hero-date {
  position: relative;
  z-index: 1;
  margin-top: 7px;
  color: rgba(248, 244, 230, 0.47);
  font-size: 9.5px;
}

.hero-budget {
  position: relative;
  z-index: 1;
  margin-top: 20px;
}

.hero-budget-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
  color: rgba(248, 244, 230, 0.57);
  font-size: 9.5px;
}

.hero-budget-labels strong {
  color: rgba(250, 247, 237, 0.9);
  font-weight: 550;
}

.hero-progress {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

.hero-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #edbd82, #e69060);
  box-shadow: 0 0 22px rgba(237, 183, 130, 0.32);
  transition: width 650ms var(--ease);
}

.hero-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.hero-metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 15px;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
}

.hero-metric:first-child {
  padding-left: 0;
  border-left: 0;
}

.hero-metric span {
  color: rgba(248, 244, 231, 0.48);
  font-size: 9px;
}

.hero-metric strong {
  overflow: hidden;
  color: rgba(251, 248, 239, 0.94);
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 520;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-metric strong.positive {
  color: #c8e6c8;
}

.hero-metric strong.negative {
  color: #f4c6a8;
}

.hero-leaf-mark {
  position: absolute;
  right: 28px;
  bottom: 25px;
  width: 98px;
  height: 98px;
  opacity: 0.04;
  transform: rotate(-14deg);
}

.hero-leaf-mark .icon {
  width: 100%;
  height: 100%;
  stroke-width: 1;
}

.today-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 286px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 90% 12%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 38%),
    linear-gradient(150deg, var(--surface), color-mix(in srgb, var(--surface-2) 70%, var(--surface)));
  box-shadow: var(--shadow-sm);
}

.today-card::after {
  position: absolute;
  right: -48px;
  bottom: -70px;
  width: 180px;
  height: 180px;
  border: 1px solid var(--line);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.today-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.today-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 9.5px;
  font-weight: 650;
}

.today-date {
  color: var(--faint);
  font-family: var(--font-num);
  font-size: 9.5px;
}

.today-amount-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 17px;
  font-family: var(--font-num);
}

.today-yen {
  color: var(--muted);
  font-size: 14px;
}

.today-amount {
  font-size: 34px;
  font-weight: 570;
  letter-spacing: -0.045em;
  line-height: 1;
}

.today-count {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.today-count strong {
  color: var(--ink-2);
  font-weight: 620;
}

.quick-caption {
  margin-top: auto;
  padding-top: 17px;
  color: var(--faint);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

.quick-cats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-top: 9px;
}

.quick-cat {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 7px 2px 6px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.quick-cat:hover {
  background: var(--surface-2);
  color: var(--ink-2);
  transform: translateY(-2px);
}

.quick-cat-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--cat-color) 12%, var(--surface));
  color: var(--cat-color);
}

.quick-cat-icon .icon {
  width: 15px;
  height: 15px;
}

.quick-cat-icon .cat-emoji {
  font-size: 13px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.63fr) minmax(280px, 0.83fr);
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-stack {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
}

.chart-card {
  display: flex;
  flex-direction: column;
  min-height: 382px;
}

.chart-card .card-head {
  margin-bottom: 12px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 2px 2px 0;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9.5px;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--chart-line);
}

.legend-dash {
  width: 12px;
  height: 1px;
  border-top: 1px dashed var(--faint);
}

.chart-container {
  position: relative;
  width: 100%;
  min-height: 220px;
  padding-top: 4px;
}

.trend-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid {
  stroke: var(--chart-grid);
  stroke-width: 1;
  stroke-dasharray: 2 5;
}

.chart-average {
  stroke: var(--faint);
  stroke-width: 1;
  stroke-dasharray: 4 5;
  opacity: 0.7;
}

.chart-axis-text {
  fill: var(--faint);
  font-family: var(--font-num);
  font-size: 9.5px;
}

.chart-x-text {
  font-family: var(--font-sans);
}

.chart-line-path {
  animation: lineFade 600ms var(--ease) both;
}

.chart-guide {
  stroke: var(--line-strong);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  pointer-events: none;
  transition: opacity 100ms linear;
}

.chart-focus-dot {
  pointer-events: none;
  transition: opacity 100ms linear;
}

.chart-hit-area {
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 99px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-md);
  pointer-events: none;
  transform: translateX(-50%);
  white-space: nowrap;
}

.chart-tooltip-date {
  color: var(--muted);
  font-size: 8.5px;
}

.chart-tooltip-value {
  font-family: var(--font-num);
  font-size: 11.5px;
  font-weight: 600;
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 185px;
  color: var(--faint);
  font-size: 10.5px;
}

.chart-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 9px;
}

.chart-foot strong {
  color: var(--ink-2);
  font-family: var(--font-num);
  font-weight: 600;
}

.category-card {
  min-height: 382px;
}

.donut-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.donut-figure {
  position: relative;
  width: min(162px, 68%);
  margin: 0 auto;
}

.donut-figure svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.donut-segment {
  animation: donutFade 500ms var(--ease) both;
  animation-delay: calc(var(--seg-index) * 45ms);
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}

.donut-center-label {
  color: var(--muted);
  font-size: 9px;
}

.donut-center-value {
  display: flex;
  align-items: baseline;
  gap: 1px;
  max-width: 96px;
  margin-top: 2px;
  overflow: hidden;
  font-family: var(--font-num);
  font-size: 18px;
  font-weight: 620;
  letter-spacing: -0.04em;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donut-yen {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.donut-center small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 8.5px;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.donut-legend-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  font-size: 10px;
}

.category-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--cat-color);
}

.donut-legend-name {
  overflow: hidden;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donut-legend-value {
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 9.5px;
}

.donut-legend-value em {
  margin-left: 4px;
  color: var(--faint);
  font-family: var(--font-sans);
  font-size: 8.5px;
  font-style: normal;
}

.empty-donut {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  color: var(--faint);
  font-size: 10.5px;
  text-align: center;
}

.mini-budget-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.mini-budget-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
}

.mini-budget-label .icon {
  width: 14px;
  height: 14px;
}

.mini-budget-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 7px;
  font-family: var(--font-num);
}

.mini-budget-value .yen {
  color: var(--muted);
  font-size: 11px;
}

.mini-budget-value strong {
  font-size: 25px;
  font-weight: 620;
  letter-spacing: -0.04em;
}

.mini-budget-value span {
  color: var(--faint);
  font-family: var(--font-sans);
  font-size: 9px;
}

.mini-budget-meta {
  display: flex;
  justify-content: space-between;
  margin: 7px 0 8px;
  color: var(--faint);
  font-size: 9px;
}

.mini-category-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 13px;
}

.mini-category-row {
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  color: var(--muted);
}

.mini-category-row .mini-cat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-category-row .mini-cat-track {
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.mini-category-row .mini-cat-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--cat-color);
}

.mini-category-row .mini-cat-percent {
  color: var(--faint);
  font-family: var(--font-num);
  text-align: right;
}

.mini-goal-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 100% 50%, color-mix(in srgb, var(--goal-color, var(--brand)) 8%, transparent), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.mini-goal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.mini-goal-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 14px;
  background: color-mix(in srgb, var(--goal-color, var(--brand)) 13%, var(--surface));
  color: var(--goal-color, var(--brand));
}

.mini-goal-icon .icon {
  width: 20px;
  height: 20px;
}

.mini-goal-copy {
  min-width: 0;
  flex: 1;
}

.mini-goal-copy span {
  display: block;
  color: var(--faint);
  font-size: 8.5px;
}

.mini-goal-copy strong {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  font-size: 11.5px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-goal-progress {
  margin-top: 7px;
}

.mini-goal-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--faint);
  font-size: 8.5px;
}

.mini-goal-arrow {
  color: var(--faint);
}

.mini-goal-arrow .icon {
  width: 15px;
  height: 15px;
}

.recent-card .section-head {
  margin-bottom: 8px;
}

.recent-list {
  display: flex;
  flex-direction: column;
}

.tx-row {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 6px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: background var(--transition), transform var(--transition);
}

.tx-row:hover {
  background: var(--surface-2);
}

.tx-row:active {
  transform: scale(0.997);
}

.tx-row + .tx-row::before {
  position: absolute;
  top: 0;
  right: 6px;
  left: 55px;
  height: 1px;
  background: var(--line);
  content: "";
}

.tx-row:hover::before,
.tx-row:hover + .tx-row::before {
  opacity: 0;
}

.cat-badge {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  flex: none;
  border: 1px solid color-mix(in srgb, var(--cat-color) 12%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--cat-color) 11%, var(--surface));
  color: var(--cat-color);
}

.cat-badge .icon {
  width: 18px;
  height: 18px;
}

.cat-badge .cat-emoji {
  font-size: 17px;
  line-height: 1;
}

.cat-badge--income {
  border-color: color-mix(in srgb, var(--green) 12%, transparent);
  background: var(--green-soft);
  color: var(--green);
}

.cat-badge--transfer {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--muted);
}

.tx-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.tx-note {
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-meta-sep {
  width: 2px;
  height: 2px;
  flex: none;
  border-radius: 50%;
  background: var(--faint);
}

.tx-meta .tag {
  height: 17px;
  padding: 0 5px;
  font-size: 8.5px;
}

.tx-amount {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex: none;
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 610;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.tx-amount small {
  color: var(--faint);
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 400;
}

.tx-amount--income {
  color: var(--green);
}

.tx-amount--transfer {
  color: var(--muted);
}

.tx-amount--masked {
  letter-spacing: 0.02em;
}

.recent-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 30px 10px 24px;
  color: var(--faint);
  font-size: 10px;
  text-align: center;
}

.recent-empty .icon {
  width: 22px;
  height: 22px;
  opacity: 0.65;
}

/* ---------- page head / summary ---------- */

.period-summary {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, 0.75fr);
  align-items: stretch;
  margin-bottom: 15px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.summary-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 18px 20px;
  background:
    radial-gradient(circle at 90% 15%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 45%),
    var(--surface);
}

.summary-intro .eyebrow {
  font-size: 8.5px;
}

.summary-intro h3 {
  font-family: var(--font-num);
  font-size: 18px;
  font-weight: 620;
  letter-spacing: -0.03em;
}

.summary-intro p {
  color: var(--faint);
  font-size: 9px;
}

.summary-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 17px 18px;
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.summary-stat-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9.5px;
}

.summary-stat-label::before {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--stat-color, var(--brand));
  content: "";
}

.summary-stat strong {
  overflow: hidden;
  font-family: var(--font-num);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-stat small {
  color: var(--faint);
  font-size: 8.5px;
}

.summary-stat--income strong {
  color: var(--green);
}

.summary-stat--balance strong {
  color: var(--brand);
}

.filters-card {
  padding: 13px 14px;
  border-radius: 20px;
  margin-bottom: 15px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 175px;
}

.search-field .icon {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--faint);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 11px;
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.search-field input::placeholder {
  color: var(--faint);
}

.search-field input:focus {
  border-color: color-mix(in srgb, var(--brand) 34%, var(--line));
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 8%, transparent);
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.segmented button {
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.segmented button:hover {
  color: var(--ink-2);
}

.segmented button.active {
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--brand);
  font-weight: 650;
}

.segmented--light {
  border-color: transparent;
  background: var(--surface-3);
}

.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: none;
}

.select-wrap select {
  height: 38px;
  min-width: 86px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  appearance: none;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  font-size: 10.5px;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.select-wrap select:hover {
  border-color: var(--line-strong);
}

.select-wrap select:focus {
  border-color: color-mix(in srgb, var(--brand) 34%, var(--line));
}

.select-wrap > .icon {
  position: absolute;
  right: 9px;
  width: 13px;
  height: 13px;
  color: var(--faint);
  pointer-events: none;
}

.select-wrap--wide select {
  min-width: 108px;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.filter-reset {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 32px;
  padding: 0 7px;
  border-radius: 8px;
  background: transparent;
  color: var(--faint);
  font-size: 9.5px;
}

.filter-reset:hover {
  background: var(--surface-2);
  color: var(--ink-2);
}

.filter-reset .icon {
  width: 12px;
  height: 12px;
}

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 9px;
  color: var(--faint);
  font-size: 9.5px;
}

.results-bar strong {
  color: var(--ink-2);
  font-weight: 600;
}

.tx-list-card {
  padding: 0 18px 6px;
  overflow: hidden;
}

.day-group {
  padding: 3px 0 0;
}

.day-group + .day-group {
  border-top: 1px solid var(--line);
}

.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 6px 4px;
}

.day-date {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 640;
}

.day-date .weekday {
  color: var(--faint);
  font-size: 9px;
  font-weight: 400;
}

.day-today {
  height: 17px;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--brand-tint);
  color: var(--brand);
  font-size: 8px;
  font-weight: 600;
  line-height: 17px;
}

.day-sum {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--faint);
  font-family: var(--font-num);
  font-size: 9px;
}

.day-sum .day-expense {
  color: var(--muted);
}

.day-sum .day-income {
  color: var(--green);
}

.flat-list {
  padding: 5px 0 12px;
}

.load-more {
  display: flex;
  justify-content: center;
  padding: 18px 0 8px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 52px;
  text-align: center;
}

.empty-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-2);
  color: var(--faint);
  transform: rotate(-4deg);
}

.empty-art::before,
.empty-art::after {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  content: "";
  opacity: 0.55;
}

.empty-art::before {
  top: 5px;
  right: 8px;
}

.empty-art::after {
  bottom: 9px;
  left: 5px;
  width: 3px;
  height: 3px;
  background: var(--accent);
}

.empty-art .icon {
  width: 27px;
  height: 27px;
  transform: rotate(4deg);
}

.empty-state h3 {
  font-size: 13px;
  font-weight: 630;
}

.empty-state p {
  max-width: 280px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.empty-state .btn {
  margin-top: 15px;
}

/* ---------- calendar ---------- */

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.64fr) minmax(270px, 0.72fr);
  gap: 16px;
  align-items: start;
}

.calendar-card {
  padding: 20px;
}

.calendar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 17px;
}

.calendar-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.calendar-title h2 {
  font-family: var(--font-num);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.calendar-title span {
  color: var(--muted);
  font-size: 10px;
}

.calendar-stats {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.calendar-grid-wrap {
  min-width: 0;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 6px;
}

.cal-weekday {
  padding: 3px 0;
  color: var(--faint);
  font-size: 9px;
  text-align: center;
}

.cal-weekday.is-weekend {
  color: color-mix(in srgb, var(--accent) 65%, var(--faint));
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.cal-day {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 81px;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
  transition: transform var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.cal-day:hover {
  z-index: 1;
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.cal-day--blank {
  min-height: 81px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-2) 38%, transparent);
  pointer-events: none;
}

.cal-day--future {
  color: var(--faint);
  background: color-mix(in srgb, var(--surface-2) 52%, transparent);
}

.cal-day--today {
  background: var(--brand-tint);
}

.cal-day--selected {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--brand), var(--shadow-sm);
}

.cal-day--l1 {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-2));
}

.cal-day--l2 {
  background: color-mix(in srgb, var(--accent) 13%, var(--surface-2));
}

.cal-day--l3 {
  background: color-mix(in srgb, var(--accent) 20%, var(--surface-2));
}

.cal-day--l4 {
  background: color-mix(in srgb, var(--accent) 29%, var(--surface-2));
}

.cal-day--l4 .cal-amount {
  color: color-mix(in srgb, var(--accent-deep) 80%, var(--ink));
  font-weight: 650;
}

.cal-day-num {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  color: var(--ink-2);
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 560;
  line-height: 1;
}

.cal-day--today .cal-day-num {
  background: var(--brand);
  color: #fff;
}

.cal-day--future .cal-day-num {
  color: var(--faint);
}

.cal-amount {
  margin-top: auto;
  overflow: hidden;
  width: 100%;
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 10px;
  letter-spacing: -0.02em;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-amount--empty {
  color: var(--faint);
  font-family: var(--font-sans);
  font-size: 8.5px;
  opacity: 0.6;
}

.cal-day-meta {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 5px;
}

.cal-income-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
}

.cal-note-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--faint);
  opacity: 0.55;
}

.calendar-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 13px;
  color: var(--faint);
  font-size: 8.5px;
}

.legend-square {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--surface-2);
}

.legend-square.l1 {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-2));
}

.legend-square.l2 {
  background: color-mix(in srgb, var(--accent) 13%, var(--surface-2));
}

.legend-square.l3 {
  background: color-mix(in srgb, var(--accent) 20%, var(--surface-2));
}

.legend-square.l4 {
  background: color-mix(in srgb, var(--accent) 29%, var(--surface-2));
}

.day-panel {
  position: sticky;
  top: calc(var(--topbar-h) + 10px);
  padding: 21px;
}

.day-panel-date {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.day-panel-day {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-family: var(--font-num);
}

.day-panel-day strong {
  font-size: 35px;
  font-weight: 570;
  letter-spacing: -0.055em;
  line-height: 1;
}

.day-panel-day span {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 10px;
}

.day-panel-weekday {
  color: var(--faint);
  font-size: 9px;
  text-align: right;
}

.day-panel-weekday strong {
  display: block;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
}

.day-totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 15px 0 13px;
}

.day-total {
  padding: 8px 9px;
  border-radius: 9px;
  background: var(--surface-2);
}

.day-total span {
  display: block;
  color: var(--faint);
  font-size: 8px;
}

.day-total strong {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-panel .recent-list {
  margin: 2px -4px 0;
}

.day-panel .tx-row {
  padding: 7px 4px;
  gap: 8px;
}

.day-panel .cat-badge {
  width: 31px;
  height: 31px;
  border-radius: 10px;
}

.day-panel .cat-badge .icon {
  width: 15px;
  height: 15px;
}

.day-panel .tx-note {
  font-size: 11.5px;
}

.day-panel .tx-amount {
  font-size: 11.5px;
}

.day-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 27px 10px 22px;
  color: var(--faint);
  font-size: 10px;
  text-align: center;
}

.day-empty .empty-art {
  width: 48px;
  height: 48px;
  margin-bottom: 9px;
  border-radius: 16px;
}

.day-empty .empty-art .icon {
  width: 21px;
  height: 21px;
}

.day-panel-foot {
  margin-top: 14px;
}

/* ---------- stats ---------- */

.stats-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stat-card::after {
  position: absolute;
  top: -30px;
  right: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--stat-color, var(--brand)) 7%, transparent);
  content: "";
}

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stat-label {
  color: var(--muted);
  font-size: 9.5px;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--stat-color, var(--brand)) 11%, var(--surface));
  color: var(--stat-color, var(--brand));
}

.stat-icon .icon {
  width: 13px;
  height: 13px;
}

.stat-value {
  margin-top: 12px;
  overflow: hidden;
  font-family: var(--font-num);
  font-size: clamp(22px, 2.1vw, 27px);
  font-weight: 570;
  letter-spacing: -0.04em;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-value .currency {
  margin-right: 2px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 500;
}

.stat-foot {
  margin-top: 5px;
  color: var(--faint);
  font-size: 8.5px;
}

.stat-foot strong {
  color: var(--ink-2);
  font-weight: 600;
}

.stat-foot .up {
  color: var(--red);
}

.stat-foot .down {
  color: var(--green);
}

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: 16px;
  margin-bottom: 16px;
}

.analysis-card {
  min-height: 395px;
}

.analysis-card--category {
  display: flex;
  flex-direction: column;
}

.category-analysis-body {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1fr);
  align-items: center;
  gap: 21px;
  flex: 1;
}

.category-rank {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.rank-row {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.rank-index {
  color: var(--faint);
  font-family: var(--font-num);
  font-size: 10px;
  font-style: normal;
}

.rank-main {
  min-width: 0;
}

.rank-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin-bottom: 4px;
  font-size: 9.5px;
}

.rank-label span {
  overflow: hidden;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-label em {
  color: var(--faint);
  font-family: var(--font-num);
  font-size: 8.5px;
  font-style: normal;
}

.rank-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.rank-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--cat-color);
}

.rank-amount {
  color: var(--ink-2);
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 550;
  white-space: nowrap;
}

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

.month-bars-card .mini-bars {
  flex: 1;
}

.mini-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 7px;
  min-height: 170px;
  padding: 25px 2px 0;
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 100% 25%;
  background-position: 0 25px;
}

.mini-bar-col {
  position: relative;
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 156px;
  justify-content: flex-end;
}

.mini-bar-track {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 34px;
  height: 125px;
  align-items: flex-end;
  justify-content: center;
}

.mini-bar-fill {
  display: block;
  width: min(58%, 22px);
  min-height: 2px;
  border-radius: 5px 5px 2px 2px;
  background: color-mix(in srgb, var(--brand) 36%, var(--surface-3));
  transition: height 550ms var(--ease), background var(--transition);
}

.mini-bar-col:hover .mini-bar-fill {
  background: color-mix(in srgb, var(--brand) 65%, var(--surface-3));
}

.mini-bar-col.is-current .mini-bar-fill {
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--gold)));
  box-shadow: 0 2px 12px -3px color-mix(in srgb, var(--accent) 35%, transparent);
}

.mini-bar-label {
  color: var(--faint);
  font-size: 8.5px;
  white-space: nowrap;
}

.mini-bar-col.is-current .mini-bar-label {
  color: var(--ink-2);
  font-weight: 600;
}

.mini-bar-value {
  position: absolute;
  top: -10px;
  left: 50%;
  z-index: 2;
  opacity: 0;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-xs);
  color: var(--ink-2);
  font-family: var(--font-num);
  font-size: 8px;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%) translateY(3px);
  transition: opacity var(--transition), transform var(--transition);
}

.mini-bar-col.is-current .mini-bar-value,
.mini-bar-col:hover .mini-bar-value {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.mini-bars--compact {
  min-height: 130px;
  padding-top: 18px;
}

.mini-bars--compact .mini-bar-col {
  height: 118px;
}

.mini-bars--compact .mini-bar-track {
  height: 91px;
}

.month-bar-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 11px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 8.5px;
}

.month-bar-summary strong {
  color: var(--ink-2);
  font-family: var(--font-num);
  font-weight: 600;
}

.stats-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.weekday-card {
  min-height: 260px;
}

.weekday-card .mini-bars {
  min-height: 145px;
  padding-top: 14px;
}

.weekday-card .mini-bar-col {
  height: 130px;
}

.weekday-card .mini-bar-track {
  height: 103px;
}

.top-expense-card {
  min-height: 260px;
}

.top-expenses {
  display: flex;
  flex-direction: column;
}

.top-expense-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.top-expense-row:last-child {
  border-bottom: 0;
}

.top-expense-index {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  flex: none;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--faint);
  font-family: var(--font-num);
  font-size: 8.5px;
}

.top-expense-row:first-child .top-expense-index {
  background: var(--gold-soft);
  color: var(--gold);
}

.top-expense-copy {
  min-width: 0;
  flex: 1;
}

.top-expense-copy strong {
  display: block;
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-expense-copy span {
  color: var(--faint);
  font-size: 8.5px;
}

.top-expense-amount {
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.insights-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.insight-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.insight-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: color-mix(in srgb, var(--insight-color, var(--brand)) 11%, var(--surface));
  color: var(--insight-color, var(--brand));
}

.insight-icon .icon {
  width: 15px;
  height: 15px;
}

.insight-copy {
  min-width: 0;
}

.insight-kicker {
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.insight-copy strong {
  display: block;
  margin-top: 1px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.45;
}

.insight-copy p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.5;
}

/* ---------- budget ---------- */

.budget-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
  overflow: hidden;
  margin-bottom: 16px;
  padding: clamp(22px, 2.5vw, 30px);
  border: 1px solid color-mix(in srgb, var(--brand) 13%, var(--line));
  border-radius: 30px;
  background:
    radial-gradient(circle at 95% 8%, color-mix(in srgb, var(--gold) 13%, transparent), transparent 37%),
    radial-gradient(circle at 5% 100%, color-mix(in srgb, var(--brand) 9%, transparent), transparent 45%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.budget-hero::after {
  position: absolute;
  top: -60px;
  right: 17%;
  width: 210px;
  height: 210px;
  border: 1px solid var(--line);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.budget-hero-copy {
  position: relative;
  z-index: 1;
}

.budget-setup-btn {
  margin-top: 15px;
}

.budget-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.budget-hero-amount {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 8px;
  font-family: var(--font-num);
}

.budget-hero-amount .yen {
  color: var(--muted);
  font-size: 19px;
}

.budget-hero-amount strong {
  font-size: clamp(36px, 4.2vw, 49px);
  font-weight: 570;
  letter-spacing: -0.05em;
  line-height: 1;
}

.budget-hero-amount span {
  color: var(--faint);
  font-family: var(--font-sans);
  font-size: 10px;
}

.budget-hero-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.budget-hero-meta strong {
  color: var(--ink-2);
  font-family: var(--font-num);
  font-weight: 600;
}

.budget-hero-progress {
  width: min(420px, 100%);
  margin-top: 16px;
}

.budget-hero-progress .progress-track {
  height: 7px;
}

.budget-hero-progress .progress-track > span {
  background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 66%, var(--gold)));
}

.budget-hero-progress .progress-track.is-over {
  background: var(--red-soft);
}

.budget-hero-progress .progress-track.is-over > span {
  background: var(--red);
}

.budget-days {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  color: var(--faint);
  font-size: 9px;
}

.budget-days strong {
  color: var(--ink-2);
  font-weight: 600;
}

.budget-ring-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 22px;
}

.budget-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 142px;
  height: 142px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color, var(--brand)) calc(var(--ring-value, 0) * 1%), var(--surface-3) 0);
  transition: background 600ms var(--ease);
}

.budget-ring::before {
  position: absolute;
  inset: 11px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  content: "";
}

.budget-ring-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.budget-ring-inner strong {
  font-family: var(--font-num);
  font-size: 27px;
  font-weight: 570;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.budget-ring-inner strong span {
  font-size: 13px;
}

.budget-ring-inner small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 8px;
}

.budget-ring-note {
  display: flex;
  max-width: 118px;
  flex-direction: column;
  gap: 5px;
}

.budget-ring-note span {
  color: var(--faint);
  font-size: 8.5px;
}

.budget-ring-note strong {
  font-family: var(--font-num);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.budget-ring-note em {
  color: var(--muted);
  font-size: 8.5px;
  font-style: normal;
  line-height: 1.5;
}

.budget-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(280px, 0.68fr);
  gap: 16px;
  align-items: start;
}

.budget-categories-card {
  min-width: 0;
}

.budget-summary-line {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--faint);
  font-size: 9px;
}

.budget-summary-line strong {
  color: var(--ink-2);
  font-family: var(--font-num);
  font-weight: 600;
}

.budget-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 1px -6px 0;
}

.budget-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 7px;
  border-radius: 12px;
  transition: background var(--transition);
}

.budget-row:hover {
  background: var(--surface-2);
}

.budget-row .cat-badge {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.budget-row .cat-badge .icon {
  width: 16px;
  height: 16px;
}

.budget-row-main {
  min-width: 0;
}

.budget-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.budget-row-top strong {
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.budget-row-top .numbers {
  flex: none;
  color: var(--faint);
  font-family: var(--font-num);
  font-size: 9px;
  white-space: nowrap;
}

.budget-row-top .numbers b {
  color: var(--ink-2);
  font-weight: 600;
}

.budget-row-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.budget-row-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 450ms var(--ease);
}

.budget-row-track span.warn {
  background: var(--gold);
}

.budget-row-track span.over {
  background: var(--red);
}

.budget-row-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.budget-row-percent {
  color: var(--faint);
  font-family: var(--font-num);
  font-size: 9.5px;
  text-align: right;
  white-space: nowrap;
}

.budget-row-percent.over {
  color: var(--red);
}

.budget-edit-btn {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: transparent;
  color: var(--faint);
  opacity: 0;
  transition: opacity var(--transition), background var(--transition), color var(--transition);
}

.budget-row:hover .budget-edit-btn,
.budget-edit-btn:focus-visible {
  opacity: 1;
}

.budget-edit-btn:hover {
  background: var(--surface-3);
  color: var(--ink-2);
}

.budget-edit-btn .icon {
  width: 13px;
  height: 13px;
}

.budget-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.subscription-card {
  padding: 20px;
}

.subscription-total {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: -3px 0 12px;
  font-family: var(--font-num);
}

.subscription-total strong {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.subscription-total span {
  color: var(--faint);
  font-family: var(--font-sans);
  font-size: 9px;
}

.sub-list {
  display: flex;
  flex-direction: column;
}

.sub-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.sub-badge {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--cat-color) 10%, var(--surface));
  color: var(--cat-color);
}

.sub-badge .icon {
  width: 14px;
  height: 14px;
}

.sub-copy {
  min-width: 0;
}

.sub-copy strong {
  display: block;
  overflow: hidden;
  font-size: 10px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sub-copy span {
  color: var(--faint);
  font-size: 8px;
}

.sub-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.sub-amount {
  font-family: var(--font-num);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.sub-action {
  padding: 1px 4px;
  border-radius: 4px;
  background: none;
  color: var(--accent-deep);
  font-size: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.sub-action:hover {
  background: var(--accent-soft);
}

.sub-paid {
  color: var(--faint);
  font-size: 8px;
  white-space: nowrap;
}

.sub-row--inactive {
  opacity: 0.55;
}

.sub-row--inactive .sub-copy:hover strong {
  color: var(--ink);
}

.budget-tip {
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--gold) 20%, var(--line));
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--gold) 13%, transparent), transparent 55%),
    var(--surface-2);
}

.budget-tip-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: color-mix(in srgb, var(--gold) 72%, var(--ink));
  font-size: 10px;
  font-weight: 600;
}

.budget-tip-head .icon {
  width: 14px;
  height: 14px;
}

.budget-tip p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.7;
}

.budget-tip strong {
  color: var(--ink-2);
  font-weight: 600;
}

/* ---------- savings ---------- */

.savings-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 30px;
  overflow: hidden;
  margin-bottom: 18px;
  padding: clamp(24px, 2.7vw, 32px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 30px;
  background:
    radial-gradient(circle at 88% 5%, rgba(234, 179, 115, 0.22), transparent 32%),
    radial-gradient(circle at 4% 110%, rgba(119, 175, 140, 0.26), transparent 48%),
    linear-gradient(132deg, #225441, #15392a);
  box-shadow: 0 24px 50px -32px rgba(17, 49, 34, 0.8);
  color: #f6f2e5;
}

.savings-hero::before {
  position: absolute;
  top: -180px;
  right: -130px;
  width: 440px;
  height: 440px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(255, 255, 255, 0.025), 0 0 0 84px rgba(255, 255, 255, 0.017);
  content: "";
}

.savings-hero-copy {
  position: relative;
  z-index: 1;
}

.savings-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(248, 243, 230, 0.6);
  font-size: 10px;
}

.savings-eyebrow .icon {
  width: 14px;
  height: 14px;
}

.savings-total {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 10px;
  font-family: var(--font-num);
}

.savings-total .yen {
  color: rgba(248, 243, 230, 0.5);
  font-size: 20px;
}

.savings-total strong {
  font-size: clamp(39px, 4.5vw, 55px);
  font-weight: 520;
  letter-spacing: -0.055em;
  line-height: 1;
}

.savings-total span {
  color: rgba(248, 243, 230, 0.48);
  font-family: var(--font-sans);
  font-size: 10px;
}

.savings-meta {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
  margin-top: 10px;
  color: rgba(248, 243, 230, 0.58);
  font-size: 9.5px;
}

.savings-meta strong {
  color: rgba(253, 250, 241, 0.92);
  font-family: var(--font-num);
  font-weight: 550;
}

.savings-progress {
  width: min(420px, 100%);
  margin-top: 19px;
}

.savings-progress .progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.14);
}

.savings-progress .progress-track > span {
  background: linear-gradient(90deg, #e8c18c, #e89266);
}

.savings-ring-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 19px;
}

.savings-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 133px;
  height: 133px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(#e8b17a calc(var(--ring-value, 0) * 1%), rgba(255, 255, 255, 0.13) 0);
}

.savings-ring::before {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(27, 65, 48, 0.65);
  content: "";
}

.savings-ring-center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.savings-ring-center strong {
  font-family: var(--font-num);
  font-size: 26px;
  font-weight: 530;
  letter-spacing: -0.04em;
}

.savings-ring-center strong span {
  font-size: 12px;
}

.savings-ring-center small {
  color: rgba(248, 243, 230, 0.44);
  font-size: 8px;
}

.savings-ring-note {
  display: flex;
  max-width: 110px;
  flex-direction: column;
  gap: 4px;
}

.savings-ring-note span {
  color: rgba(248, 243, 230, 0.46);
  font-size: 8.5px;
}

.savings-ring-note strong {
  color: rgba(252, 249, 240, 0.94);
  font-family: var(--font-num);
  font-size: 17px;
  font-weight: 570;
}

.savings-ring-note em {
  color: rgba(248, 243, 230, 0.42);
  font-size: 8px;
  font-style: normal;
  line-height: 1.5;
}

.goals-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 2px 14px;
}

.goals-head h3 {
  font-size: 16px;
  font-weight: 660;
  letter-spacing: -0.025em;
}

.goals-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.goals-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.goals-grid--empty {
  grid-template-columns: minmax(0, 1fr);
}

.goals-grid--empty .add-goal-card {
  min-height: 170px;
}

.goal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 23px;
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--goal-color) 10%, transparent), transparent 47%),
    var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.goal-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.goal-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--goal-color), transparent);
  content: "";
  opacity: 0.55;
}

.goal-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.goal-icon {
  display: grid;
  place-items: center;
  width: 41px;
  height: 41px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--goal-color) 12%, var(--surface));
  color: var(--goal-color);
}

.goal-icon .icon {
  width: 20px;
  height: 20px;
}

.goal-card-menu {
  display: flex;
  gap: 1px;
}

.goal-menu-btn {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: transparent;
  color: var(--faint);
  transition: background var(--transition), color var(--transition);
}

.goal-menu-btn:hover {
  background: var(--surface-2);
  color: var(--ink-2);
}

.goal-menu-btn .icon {
  width: 14px;
  height: 14px;
}

.goal-name {
  margin-top: 13px;
  overflow: hidden;
  font-size: 14px;
  font-weight: 640;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-due {
  margin-top: 2px;
  color: var(--faint);
  font-size: 8.5px;
}

.goal-due.overdue {
  color: var(--red);
}

.goal-amount-row {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 13px;
  font-family: var(--font-num);
}

.goal-amount-row strong {
  font-size: 23px;
  font-weight: 580;
  letter-spacing: -0.04em;
}

.goal-amount-row span {
  color: var(--faint);
  font-family: var(--font-sans);
  font-size: 9px;
}

.goal-progress {
  margin-top: 9px;
}

.goal-progress .progress-track {
  height: 5px;
  background: color-mix(in srgb, var(--goal-color) 10%, var(--surface-3));
}

.goal-progress .progress-track > span {
  background: var(--goal-color);
}

.goal-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--faint);
  font-size: 8.5px;
}

.goal-progress-meta strong {
  color: var(--goal-color);
  font-family: var(--font-num);
  font-weight: 600;
}

.goal-actions {
  display: flex;
  gap: 6px;
  margin-top: 13px;
}

.goal-actions .btn {
  flex: 1;
  height: 32px;
  font-size: 10.5px;
}

.goal-actions .btn .icon {
  width: 13px;
  height: 13px;
}

.add-goal-card {
  display: flex;
  min-height: 218px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px dashed var(--line-strong);
  border-radius: 23px;
  background: color-mix(in srgb, var(--surface) 48%, transparent);
  color: var(--faint);
  font-size: 10px;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.add-goal-card:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  background: var(--surface);
  color: var(--brand);
}

.add-goal-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.add-goal-icon .icon {
  width: 17px;
  height: 17px;
}

.savings-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
  color: var(--faint);
  font-size: 9px;
  line-height: 1.6;
}

.savings-foot .icon {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--gold);
}

.savings-foot strong {
  color: var(--ink-2);
  font-weight: 600;
}

/* ---------- accounts ---------- */

.assets-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 26px;
  overflow: hidden;
  margin-bottom: 18px;
  padding: clamp(23px, 2.5vw, 30px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 30px;
  background:
    radial-gradient(circle at 88% 8%, rgba(233, 180, 117, 0.2), transparent 32%),
    radial-gradient(circle at 2% 112%, rgba(124, 176, 143, 0.23), transparent 45%),
    linear-gradient(134deg, #22523f, #15382a);
  box-shadow: 0 24px 50px -32px rgba(17, 49, 34, 0.8);
  color: #f5f1e4;
}

.assets-hero::before {
  position: absolute;
  top: -150px;
  right: -100px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  box-shadow: 0 0 0 32px rgba(255, 255, 255, 0.023), 0 0 0 72px rgba(255, 255, 255, 0.015);
  content: "";
}

.assets-copy {
  position: relative;
  z-index: 1;
}

.assets-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(248, 243, 230, 0.58);
  font-size: 10px;
}

.assets-label .icon {
  width: 13px;
  height: 13px;
}

.assets-amount {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 8px;
  font-family: var(--font-num);
}

.assets-amount .yen {
  color: rgba(248, 243, 230, 0.5);
  font-size: 19px;
}

.assets-amount strong {
  font-size: clamp(38px, 4.1vw, 51px);
  font-weight: 520;
  letter-spacing: -0.055em;
  line-height: 1;
}

.assets-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  color: rgba(248, 243, 230, 0.48);
  font-size: 9px;
}

.assets-meta strong {
  color: rgba(252, 249, 240, 0.9);
  font-family: var(--font-num);
  font-weight: 550;
}

.assets-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.assets-actions .btn {
  height: 37px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #f5f1e4;
  box-shadow: none;
  backdrop-filter: blur(6px);
}

.assets-actions .btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.assets-actions .btn--light {
  border-color: transparent;
  background: #f5f0e3;
  color: var(--brand-deep);
}

.accounts-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 0 2px 13px;
}

.accounts-head h3 {
  font-size: 16px;
  font-weight: 660;
  letter-spacing: -0.025em;
}

.accounts-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.account-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--account-color) 9%, transparent), transparent 48%),
    var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.account-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.account-card--add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 160px;
  border-style: dashed;
  background: color-mix(in srgb, var(--surface) 46%, transparent);
  box-shadow: none;
  color: var(--faint);
  font-size: 10px;
}

.account-card--add:hover {
  border-color: color-mix(in srgb, var(--brand) 38%, var(--line));
  background: var(--surface);
  color: var(--brand);
}

.account-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.account-icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  flex: none;
  border-radius: 11px;
  background: color-mix(in srgb, var(--account-color) 11%, var(--surface));
  color: var(--account-color);
}

.account-icon .icon {
  width: 17px;
  height: 17px;
}

.account-name {
  min-width: 0;
  flex: 1;
}

.account-name strong {
  display: block;
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-name span {
  display: block;
  color: var(--faint);
  font-size: 8.5px;
}

.account-edit {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: none;
  border-radius: 7px;
  background: transparent;
  color: var(--faint);
  opacity: 0;
  transition: opacity var(--transition), background var(--transition);
}

.account-card:hover .account-edit,
.account-edit:focus-visible {
  opacity: 1;
}

.account-edit:hover {
  background: var(--surface-2);
  color: var(--ink-2);
}

.account-edit .icon {
  width: 13px;
  height: 13px;
}

.account-balance-label {
  margin-top: 17px;
  color: var(--faint);
  font-size: 8.5px;
}

.account-balance {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-top: 2px;
  font-family: var(--font-num);
}

.account-balance .yen {
  color: var(--faint);
  font-size: 10px;
}

.account-balance strong {
  overflow: hidden;
  font-size: 24px;
  font-weight: 570;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-balance strong.negative {
  color: var(--red);
}

.account-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 8px;
}

.account-foot strong {
  color: var(--ink-2);
  font-family: var(--font-num);
  font-weight: 600;
}

.account-foot .income {
  color: var(--green);
}

.accounts-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 15px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface-2) 58%, transparent);
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.65;
}

.accounts-note .icon {
  width: 13px;
  height: 13px;
  flex: none;
  margin-top: 1px;
}

/* ---------- settings ---------- */

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.settings-col {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
}

.settings-card {
  padding: 20px;
}

.settings-card .section-head {
  margin-bottom: 15px;
}

.settings-card h3 {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-avatar-large {
  display: grid;
  place-items: center;
  width: 59px;
  height: 59px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.75), transparent 42%),
    linear-gradient(145deg, #d8e7d7, #b7d0bd);
  color: #255743;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 700;
}

[data-theme="dark"] .profile-avatar-large {
  background: linear-gradient(145deg, #365a44, #264432);
  color: #e2f0e4;
}

.profile-info {
  min-width: 0;
  flex: 1;
}

.profile-info strong {
  display: block;
  overflow: hidden;
  font-size: 15px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-info span {
  color: var(--faint);
  font-size: 9px;
}

.profile-edit-form {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-top: 15px;
}

.profile-edit-form .input {
  flex: 1;
}

.input,
.textarea {
  width: 100%;
  height: 39px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 11.5px;
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.textarea {
  min-height: 76px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.6;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--faint);
}

.input:focus,
.textarea:focus {
  border-color: color-mix(in srgb, var(--brand) 36%, var(--line));
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 8%, transparent);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
}

.field > span em {
  color: var(--faint);
  font-size: 8.5px;
  font-style: normal;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-hint {
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.55;
}

.form-error {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 9.5px;
}

.form-error:empty {
  display: none;
}

.form-error .icon {
  width: 13px;
  height: 13px;
  flex: none;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.theme-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 9.5px;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.theme-option:hover {
  border-color: var(--line-strong);
}

.theme-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
  background: var(--brand-tint);
  color: var(--brand);
  font-weight: 600;
}

.theme-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-option .icon {
  width: 18px;
  height: 18px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.setting-row:first-of-type {
  border-top: 0;
}

.setting-copy strong {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
}

.setting-copy span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.5;
}

.switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: none;
  border-radius: 999px;
  background: var(--surface-3);
  cursor: pointer;
  transition: background var(--transition);
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  content: "";
  transition: transform var(--transition);
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch:has(input:checked) {
  background: var(--brand);
}

.switch:has(input:checked)::after {
  transform: translateX(16px);
}

.category-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.category-manager-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.category-manage-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 29px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 9.5px;
}

.category-manage-chip .cat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cat-color);
}

.category-manage-chip .custom-badge {
  color: var(--faint);
  font-size: 7.5px;
}

.category-manage-chip button {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin-right: -3px;
  border-radius: 4px;
  background: transparent;
  color: var(--faint);
}

.category-manage-chip button:hover {
  background: var(--red-soft);
  color: var(--red);
}

.category-manage-chip button .icon {
  width: 10px;
  height: 10px;
}

.add-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 29px;
  padding: 0 9px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
}

.add-category-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.add-category-chip .icon {
  width: 11px;
  height: 11px;
}

.data-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.data-action {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--ink-2);
  text-align: left;
  transition: border-color var(--transition), background var(--transition);
}

.data-action:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.data-action-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: none;
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
}

.data-action-icon .icon {
  width: 13px;
  height: 13px;
}

.data-action-copy strong {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
}

.data-action-copy span {
  display: block;
  margin-top: 1px;
  color: var(--faint);
  font-size: 7.5px;
  line-height: 1.5;
}

.data-action--danger {
  border-color: color-mix(in srgb, var(--red) 15%, var(--line));
}

.data-action--danger .data-action-icon {
  background: var(--red-soft);
  color: var(--red);
}

.data-action--danger:hover {
  border-color: color-mix(in srgb, var(--red) 30%, var(--line));
  background: color-mix(in srgb, var(--red-soft) 40%, var(--surface));
}

.data-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 11px;
  color: var(--faint);
  font-size: 8px;
}

.data-meta strong {
  color: var(--muted);
  font-family: var(--font-num);
  font-weight: 550;
}

.shortcut-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 9.5px;
}

.shortcut-keys {
  display: flex;
  gap: 3px;
}

.about-block {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.about-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  background: linear-gradient(145deg, #2c6a4f, #194430);
  color: #f8f3e5;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
}

.about-copy strong {
  display: block;
  font-size: 11px;
  font-weight: 620;
}

.about-copy span {
  display: block;
  color: var(--faint);
  font-size: 8px;
}

.about-copy p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.6;
}

.about-version {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--font-num);
  font-size: 8px;
}

.share-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.share-action {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--ink-2);
  text-align: left;
  transition: border-color var(--transition), background var(--transition);
}

.share-action:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.share-action > .icon {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--faint);
}

.share-action-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 8px;
  background: var(--brand-tint);
  color: var(--brand);
}

.share-action-icon .icon {
  width: 14px;
  height: 14px;
}

.share-action-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.share-action-copy strong {
  font-size: 9.5px;
  font-weight: 600;
}

.share-action-copy span {
  overflow: hidden;
  color: var(--faint);
  font-size: 8px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-guide-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 9px;
  padding: 3px 0;
  background: transparent;
  color: var(--brand);
  font-size: 9px;
  font-weight: 600;
}

.share-guide-link .icon {
  width: 11px;
  height: 11px;
}

.install-guide {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 1px 0 5px;
}

.guide-lead {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.guide-lead-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: none;
  border-radius: 9px;
  background: var(--brand-tint);
  color: var(--brand);
}

.guide-lead-icon .icon {
  width: 16px;
  height: 16px;
}

.guide-lead strong {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
}

.guide-lead p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.guide-step {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.guide-step-number {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--faint);
  font-family: var(--font-num);
  font-size: 9px;
}

.guide-step h4 {
  font-size: 12px;
  font-weight: 620;
}

.guide-step p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.guide-step code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: var(--font-num);
  font-size: 9.5px;
}

.guide-callout {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--gold) 20%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--gold-soft) 35%, var(--surface));
  color: var(--muted);
}

.guide-callout .icon {
  width: 13px;
  height: 13px;
  flex: none;
  margin-top: 1px;
  color: var(--gold);
}

.guide-callout p {
  font-size: 9.5px;
  line-height: 1.7;
}

/* ---------- modal / composer ---------- */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-root[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, #101812 52%, transparent);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 180ms linear;
}

.modal-panel {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(560px, 100%);
  max-height: min(89vh, 900px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 25px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition: opacity 190ms var(--ease), transform 220ms var(--ease);
}

.modal-root.open .modal-backdrop {
  opacity: 1;
}

.modal-root.open .modal-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal-panel--wide {
  width: min(720px, 100%);
}

.modal-panel--composer {
  width: min(690px, 100%);
}

.modal-panel--search {
  width: min(610px, 100%);
}

.modal-header {
  position: relative;
  display: flex;
  flex: none;
  align-items: flex-start;
  gap: 12px;
  padding: 21px 23px 11px;
}

.modal-title-wrap {
  min-width: 0;
  flex: 1;
}

.modal-eyebrow {
  margin-bottom: 2px;
  color: var(--faint);
  font-family: var(--font-num);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.modal-title {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.modal-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.55;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: none;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  transition: background var(--transition), color var(--transition);
}

.modal-close:hover {
  background: var(--surface-3);
  color: var(--ink);
}

.modal-close .icon {
  width: 15px;
  height: 15px;
}

.modal-body {
  overflow: auto;
  padding: 7px 23px 21px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--line-strong);
}

.modal-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
  justify-content: flex-end;
  padding: 13px 23px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 38%, var(--surface));
}

.modal-footer .footer-left {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: auto;
}

.modal-footer .btn {
  height: 38px;
}

.confirm-panel {
  width: min(420px, 100%);
}

.confirm-body {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 4px 23px 19px;
}

.confirm-icon {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  flex: none;
  border-radius: 11px;
  background: var(--red-soft);
  color: var(--red);
}

.confirm-icon .icon {
  width: 18px;
  height: 18px;
}

.confirm-copy p {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.confirm-copy p strong {
  color: var(--ink-2);
  font-weight: 600;
}

/* composer */

.composer-body {
  padding: 0 23px 19px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.composer-body::-webkit-scrollbar {
  width: 6px;
}

.composer-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--line-strong);
}

.tx-type-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.tx-type-tabs button {
  flex: 1;
  height: 31px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.tx-type-tabs button:hover {
  color: var(--ink-2);
}

.tx-type-tabs button.active {
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--ink);
}

.tx-type-tabs button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.tx-type-tabs button[data-txtype="income"].active {
  color: var(--green);
}

.tx-type-tabs button[data-txtype="transfer"].active {
  color: var(--blue);
}

.amount-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 4px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.amount-field:focus-within {
  border-color: color-mix(in srgb, var(--brand) 34%, var(--line));
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 7%, transparent);
}

.amount-field .yen {
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 20px;
  font-weight: 500;
}

.amount-field input {
  width: 100%;
  height: 52px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-num);
  font-size: 33px;
  font-weight: 540;
  letter-spacing: -0.04em;
  outline: none;
}

.amount-field input::placeholder {
  color: var(--faint);
  opacity: 0.55;
}

.quick-amounts {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 7px;
}

.quick-amount {
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 9px;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.quick-amount:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--ink-2);
}

.composer-section {
  margin-top: 16px;
}

.composer-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 9.5px;
}

.composer-section-head em {
  color: var(--faint);
  font-size: 8.5px;
  font-style: normal;
}

.category-picker {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}

.category-option {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 2px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 8.5px;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.category-option:hover {
  background: var(--surface-2);
  color: var(--ink-2);
}

.category-option .category-option-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--cat-color) 10%, var(--surface));
  color: var(--cat-color);
}

.category-option .category-option-icon .icon {
  width: 15px;
  height: 15px;
}

.category-option .category-option-icon .cat-emoji {
  font-size: 14px;
}

.category-option.selected {
  border-color: color-mix(in srgb, var(--cat-color) 28%, var(--line));
  background: color-mix(in srgb, var(--cat-color) 6%, var(--surface));
  color: var(--ink-2);
  font-weight: 600;
}

.category-option.selected .category-option-icon {
  background: color-mix(in srgb, var(--cat-color) 18%, var(--surface));
}

.transfer-fields {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 7px;
}

.transfer-arrow {
  display: grid;
  place-items: center;
  width: 27px;
  height: 39px;
  color: var(--faint);
}

.transfer-arrow .icon {
  width: 15px;
  height: 15px;
}

.composer-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-top: 15px;
}

.field-full {
  grid-column: 1 / -1;
}

.composer-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.tag-suggestion {
  height: 21px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--faint);
  font-size: 8.5px;
}

.tag-suggestion:hover {
  border-color: var(--line-strong);
  color: var(--ink-2);
}

.tag-suggestion.active {
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  background: var(--brand-tint);
  color: var(--brand);
}

.composer-footer-note {
  color: var(--faint);
  font-size: 8px;
}

.modal-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 33px;
  padding: 0 8px;
  border-radius: 7px;
  background: transparent;
  color: var(--faint);
  font-size: 9.5px;
}

.modal-delete-btn:hover {
  background: var(--red-soft);
  color: var(--red);
}

.modal-delete-btn .icon {
  width: 13px;
  height: 13px;
}

.inline-confirm {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--red);
  font-size: 9.5px;
}

.inline-confirm .btn {
  height: 28px;
  padding: 0 8px;
  font-size: 9.5px;
}

/* search modal */

.search-modal-head {
  padding-bottom: 9px;
}

.search-modal-input {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 23px 12px;
}

.search-modal-input .icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--faint);
}

.search-modal-input input {
  width: 100%;
  height: 44px;
  padding: 0 37px 0 37px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  outline: none;
}

.search-modal-input input:focus {
  border-color: color-mix(in srgb, var(--brand) 36%, var(--line));
  background: var(--surface);
}

.search-modal-input .kbd {
  position: absolute;
  right: 10px;
}

.search-results {
  max-height: min(52vh, 430px);
  overflow: auto;
  padding: 0 15px 17px;
  scrollbar-width: thin;
}

.search-section-label {
  padding: 9px 8px 4px;
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.search-result {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}

.search-result:hover {
  background: var(--surface-2);
}

.search-result .cat-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.search-result .cat-badge .icon {
  width: 15px;
  height: 15px;
}

.search-result-copy {
  min-width: 0;
  flex: 1;
}

.search-result-copy strong {
  display: block;
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-copy span {
  display: block;
  color: var(--faint);
  font-size: 8.5px;
}

.search-result-amount {
  font-family: var(--font-num);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.search-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 23px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 8.5px;
}

.search-footer button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: none;
  color: var(--brand);
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}

.search-footer button .icon {
  width: 12px;
  height: 12px;
}

.search-empty {
  padding: 33px 14px;
  color: var(--faint);
  font-size: 10px;
  text-align: center;
}

/* generic modal forms */

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.modal-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 -1px;
  color: var(--muted);
  font-size: 9.5px;
}

.modal-section-title em {
  color: var(--faint);
  font-size: 8.5px;
  font-style: normal;
}

.type-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.type-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 9px;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.type-choice:hover {
  border-color: var(--line-strong);
}

.type-choice:has(input:checked) {
  border-color: color-mix(in srgb, var(--brand) 38%, var(--line));
  background: var(--brand-tint);
  color: var(--brand);
}

.type-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.type-choice .type-choice-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 7px;
  background: var(--surface);
}

.type-choice .type-choice-icon .icon {
  width: 13px;
  height: 13px;
}

.icon-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.icon-choice,
.color-choice {
  position: relative;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}

.icon-choice:has(input:checked),
.color-choice:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-tint);
  color: var(--brand);
}

.icon-choice input,
.color-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.icon-choice .icon {
  width: 14px;
  height: 14px;
}

.color-choice span {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--choice-color);
}

.emoji-choice {
  font-size: 14px;
}

.budget-editor-list {
  display: flex;
  flex-direction: column;
  max-height: 300px;
  overflow: auto;
  padding-right: 2px;
}

.budget-input-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.budget-input-row:last-child {
  border-bottom: 0;
}

.budget-input-row .cat-badge {
  width: 27px;
  height: 27px;
  border-radius: 8px;
}

.budget-input-row .cat-badge .icon {
  width: 13px;
  height: 13px;
}

.budget-input-row label {
  flex: 1;
  font-size: 10px;
}

.budget-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 94px;
}

.budget-input-wrap span {
  position: absolute;
  left: 8px;
  color: var(--faint);
  font-size: 9px;
}

.budget-input-wrap input {
  width: 100%;
  height: 30px;
  padding: 0 7px 0 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  font-family: var(--font-num);
  font-size: 9.5px;
  text-align: right;
  outline: none;
}

.budget-input-wrap input:focus {
  border-color: var(--brand);
}

.budget-editor-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9px;
}

.budget-editor-summary strong {
  color: var(--ink-2);
  font-family: var(--font-num);
  font-weight: 600;
}

.goal-preview {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.goal-preview-icon {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--goal-color, var(--brand)) 13%, var(--surface));
  color: var(--goal-color, var(--brand));
}

.goal-preview-icon .icon {
  width: 16px;
  height: 16px;
}

.goal-preview-copy strong {
  display: block;
  font-size: 10.5px;
}

.goal-preview-copy span {
  color: var(--faint);
  font-size: 8.5px;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.range-row input[type="range"] {
  flex: 1;
  accent-color: var(--brand);
}

.amount-preview {
  min-width: 76px;
  font-family: var(--font-num);
  font-size: 15px;
  font-weight: 600;
  text-align: right;
}

/* toast */

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 24px;
  left: 22px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  max-width: min(430px, 100%);
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 94%, transparent);
  box-shadow: 0 14px 38px -16px rgba(0, 0, 0, 0.5);
  color: var(--surface);
  font-size: 10.5px;
  line-height: 1.45;
  pointer-events: auto;
  animation: toastIn 260ms var(--ease) both;
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  flex: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #d9ead9;
}

.toast-icon .icon {
  width: 13px;
  height: 13px;
}

.toast--error .toast-icon {
  background: rgba(211, 100, 82, 0.16);
  color: #f0b0a0;
}

.toast-message {
  flex: 1;
}

.toast-action {
  flex: none;
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: #f2d6ad;
  font-size: 9.5px;
  font-weight: 600;
}

.toast-action:hover {
  background: rgba(255, 255, 255, 0.16);
}

.toast-close {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 5px;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
}

.toast-close:hover {
  color: #fff;
}

.toast-close .icon {
  width: 12px;
  height: 12px;
}

/* ---------- mobile nav ---------- */

.mobile-nav {
  display: none;
}

/* ---------- responsive ---------- */

@media (max-width: 1380px) {
  :root {
    --sidebar-w: 232px;
  }

  .sidebar {
    padding-left: 19px;
    padding-right: 17px;
  }

  .hero-layout,
  .dashboard-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(268px, 0.8fr);
  }

  .hero-number {
    font-size: clamp(45px, 5.2vw, 61px);
  }

  .category-picker {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 1240px) {
  :root {
    --sidebar-w: 220px;
  }

  .theme-toggle {
    display: none;
  }

  .hero-layout,
  .dashboard-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(255px, 0.8fr);
  }

  .hero-number {
    font-size: clamp(42px, 5vw, 55px);
  }

  .budget-grid {
    grid-template-columns: minmax(0, 1.24fr) minmax(260px, 0.76fr);
  }

  .goals-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 150;
    width: 274px;
    height: 100dvh;
    visibility: hidden;
    transform: translateX(-104%);
    border-right: 1px solid var(--line-strong);
    border-radius: 0 22px 22px 0;
    background: var(--surface);
    box-shadow: 24px 0 80px -30px rgba(0, 0, 0, 0.35);
    transition: transform 260ms var(--ease), visibility 260ms var(--ease);
  }

  body.menu-open .sidebar {
    visibility: visible;
    transform: translateX(0);
  }

  .sidebar-close {
    position: absolute;
    top: 20px;
    right: 15px;
    z-index: 1;
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--muted);
  }

  .sidebar-close:hover {
    background: var(--surface-3);
    color: var(--ink);
  }

  .sidebar-close .icon {
    width: 15px;
    height: 15px;
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: block;
    background: rgba(15, 25, 18, 0.38);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms linear;
  }

  body.menu-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .icon-btn--mobile {
    display: grid;
    margin-left: -3px;
  }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    height: calc(65px + env(safe-area-inset-bottom));
    padding: 6px max(12px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(12px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 91%, transparent);
    box-shadow: 0 -12px 40px -30px rgba(28, 45, 33, 0.45);
    backdrop-filter: blur(20px);
  }

  .mobile-nav-item {
    display: flex;
    height: 52px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 11px;
    background: transparent;
    color: var(--faint);
    font-size: 9px;
    transition: color var(--transition);
  }

  .mobile-nav-item .icon {
    width: 19px;
    height: 19px;
  }

  .mobile-nav-item.active {
    color: var(--brand);
    font-weight: 600;
  }

  .mobile-add {
    display: grid;
    place-items: center;
    width: 51px;
    height: 51px;
    margin: 0 auto;
    border: 3px solid var(--bg);
    border-radius: 17px;
    background: linear-gradient(145deg, #2c694f, #173f2e);
    box-shadow: 0 10px 22px -10px rgba(23, 63, 46, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.16);
    color: #faf6ea;
    transform: translateY(-15px);
  }

  .mobile-add .icon {
    width: 22px;
    height: 22px;
  }

  .mobile-add-label {
    display: none;
  }

  .main-shell {
    min-height: 100vh;
    padding-bottom: calc(65px + env(safe-area-inset-bottom));
  }

  .app-footer {
    padding-bottom: 22px;
  }

  .toast-region {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .sidebar-spacer {
    min-height: 12px;
  }

  .topbar {
    padding-top: 18px;
  }

  .overview-intro {
    padding-top: 2px;
  }

  .hero-layout {
    grid-template-columns: minmax(0, 1.55fr) minmax(270px, 0.85fr);
  }
}

@media (max-width: 960px) {
  .hero-layout,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .today-card {
    min-height: auto;
  }

  .today-card {
    min-height: 220px;
  }

  .quick-cats {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .dashboard-grid {
    margin-bottom: 15px;
  }

  .dashboard-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }

  .chart-card {
    min-height: 360px;
  }

  .category-card {
    min-height: auto;
  }

  .donut-layout {
    display: grid;
    grid-template-columns: 165px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
  }

  .donut-figure {
    width: 100%;
  }

  .category-analysis-body {
    grid-template-columns: 155px minmax(0, 1fr);
  }

  .stats-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .analysis-card {
    min-height: auto;
  }

  .stats-two {
    grid-template-columns: 1fr;
  }

  .insights-strip {
    grid-template-columns: 1fr;
  }

  .insights-strip .insight-card {
    align-items: center;
  }

  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .day-panel {
    position: static;
  }

  .day-totals {
    max-width: 330px;
  }

  .budget-hero {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .budget-grid {
    grid-template-columns: 1fr;
  }

  .budget-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .goals-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .accounts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-col--side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .savings-hero,
  .assets-hero {
    gap: 20px;
  }
}

@media (max-width: 760px) {
  :root {
    --page-pad: 15px;
    --topbar-h: 72px;
  }

  body {
    font-size: 13px;
  }

  .topbar {
    min-height: 72px;
    gap: 8px;
    padding: 12px 15px 8px;
  }

  .topbar-title-wrap {
    gap: 5px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .breadcrumb,
  .topbar-heading p {
    display: none;
  }

  .topbar-actions {
    gap: 4px;
  }

  .mobile-search-btn {
    display: grid;
    width: 32px;
    height: 32px;
    flex: none;
    border-color: transparent;
  }

  .mobile-search-btn .icon {
    width: 17px;
    height: 17px;
  }

  .month-switcher {
    height: 36px;
    padding: 3px;
    border-radius: 11px;
  }

  .month-pick {
    min-width: 76px;
    height: 28px;
    padding: 0 2px;
    font-size: 10.5px;
  }

  .month-pick #month-label {
    font-size: 10.5px;
  }

  .icon-btn--small {
    width: 24px;
    height: 24px;
  }

  .topbar-tools,
  .topbar-search,
  .privacy-toggle {
    display: none;
  }

  .btn-add {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 11px;
  }

  .btn-add-label {
    display: none;
  }

  .btn-add .icon {
    width: 18px;
    height: 18px;
  }

  .icon-btn--mobile {
    width: 32px;
    height: 32px;
    margin-left: -4px;
  }

  .view {
    padding-bottom: 23px;
  }

  .overview-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    padding-bottom: 17px;
  }

  .overview-title {
    font-size: 27px;
    letter-spacing: -0.05em;
  }

  .overview-sub {
    margin-top: 4px;
    font-size: 10.5px;
  }

  .streak-chip {
    margin-bottom: 0;
    padding: 5px 9px;
    font-size: 9.5px;
  }

  .demo-banner {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 11px;
    font-size: 9.5px;
  }

  .demo-banner-actions {
    margin-left: 35px;
  }

  .card {
    border-radius: 22px;
    padding: 17px;
  }

  .hero-card {
    min-height: 296px;
    padding: 20px;
    border-radius: 25px;
  }

  .hero-number {
    font-size: clamp(47px, 14vw, 60px);
  }

  .hero-currency {
    padding-bottom: 5px;
    font-size: 16px;
  }

  .hero-decimal {
    padding-bottom: 7px;
    font-size: 21px;
  }

  .hero-metrics {
    margin-top: 16px;
    padding-top: 12px;
  }

  .hero-metric {
    padding: 0 10px;
  }

  .hero-metric strong {
    font-size: 12px;
  }

  .hero-budget {
    margin-top: 15px;
  }

  .hero-leaf-mark {
    right: 13px;
    bottom: 17px;
    width: 75px;
    height: 75px;
  }

  .today-card {
    min-height: 231px;
    padding: 18px;
    border-radius: 25px;
  }

  .quick-caption {
    margin-top: 14px;
    padding-top: 0;
  }

  .quick-cats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dashboard-stack {
    display: flex;
    gap: 15px;
  }

  .chart-card {
    min-height: 335px;
  }

  .card .section-head {
    margin-bottom: 14px;
  }

  .section-title {
    font-size: 14px;
  }

  .section-link {
    font-size: 9.5px;
  }

  .chart-container {
    min-height: 200px;
  }

  .chart-tooltip {
    transform: translateX(-50%) scale(0.95);
    transform-origin: bottom center;
  }

  .donut-layout {
    display: flex;
    gap: 12px;
  }

  .donut-figure {
    width: 155px;
  }

  .donut-legend {
    width: 100%;
  }

  .category-card {
    min-height: 380px;
  }

  .recent-list .tx-row {
    padding: 8px 4px;
  }

  .mini-budget-card {
    padding: 18px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 1px 1px 16px;
  }

  .page-head h2 {
    font-size: 24px;
  }

  .page-head-actions {
    width: 100%;
  }

  .page-head-actions .btn {
    flex: 1;
  }

  .period-summary {
    grid-template-columns: 1fr 1fr;
    border-radius: 19px;
  }

  .summary-intro {
    grid-column: 1 / -1;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
  }

  .summary-stat {
    padding: 13px 15px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .summary-stat:nth-child(2) {
    border-right: 1px solid var(--line);
  }

  .summary-stat:nth-child(3) {
    border-right: 1px solid var(--line);
  }

  .summary-stat:last-child {
    display: none;
  }

  .filters-card {
    padding: 10px;
  }

  .filter-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .filter-row .segmented {
    grid-column: 1 / -1;
    width: 100%;
  }

  .filter-row .segmented button {
    flex: 1;
    padding: 0 6px;
    font-size: 9.5px;
  }

  .select-wrap {
    width: 100%;
    min-width: 0;
  }

  .select-wrap select {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 0 22px 0 9px;
    font-size: 9.5px;
  }

  .filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    margin-left: 0;
  }

  .filter-reset {
    height: 28px;
  }

  .tx-list-card {
    padding: 0 12px 5px;
  }

  .day-head {
    padding: 12px 3px 2px;
  }

  .day-sum {
    font-size: 8.5px;
  }

  .day-date {
    font-size: 10.5px;
  }

  .tx-row {
    gap: 9px;
    padding: 8px 3px;
  }

  .cat-badge {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .tx-note {
    font-size: 12px;
  }

  .tx-amount {
    font-size: 12px;
  }

  .tx-meta {
    font-size: 8.5px;
  }

  .calendar-card {
    padding: 13px 4px 13px;
  }

  .calendar-top {
    padding: 0 8px;
    margin-bottom: 12px;
  }

  .calendar-title h2 {
    font-size: 21px;
  }

  .calendar-stats .pill {
    font-size: 8.5px;
  }

  .cal-weekdays {
    gap: 3px;
  }

  .cal-grid {
    gap: 3px;
  }

  .cal-day {
    min-height: 63px;
    padding: 4px 3px;
    gap: 3px;
    border-radius: 8px;
  }

  .cal-day--blank {
    min-height: 63px;
    border-radius: 8px;
  }

  .cal-day-num {
    width: 19px;
    height: 19px;
    border-radius: 6px;
    font-size: 10px;
  }

  .cal-amount {
    font-size: 8.5px;
  }

  .cal-amount--empty {
    font-size: 7.5px;
  }

  .calendar-legend {
    padding: 0 8px;
    margin-top: 10px;
  }

  .day-panel {
    padding: 18px;
  }

  .stats-summary {
    gap: 8px;
    margin-bottom: 13px;
  }

  .stat-card {
    padding: 14px;
    border-radius: 17px;
  }

  .stat-value {
    margin-top: 9px;
    font-size: 23px;
  }

  .analysis-grid {
    gap: 13px;
    margin-bottom: 13px;
  }

  .category-analysis-body {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .category-analysis-body .donut-layout {
    display: flex;
  }

  .category-rank {
    gap: 9px;
  }

  .month-bars-card {
    min-height: 320px;
  }

  .mini-bars {
    min-height: 155px;
  }

  .budget-hero {
    grid-template-columns: 1fr;
    gap: 19px;
    padding: 20px;
    border-radius: 25px;
  }

  .budget-hero-amount strong {
    font-size: 38px;
  }

  .budget-ring-wrap {
    justify-content: flex-start;
    gap: 17px;
  }

  .budget-ring {
    width: 115px;
    height: 115px;
  }

  .budget-ring::before {
    inset: 9px;
  }

  .budget-ring-inner strong {
    font-size: 23px;
  }

  .budget-ring-note strong {
    font-size: 16px;
  }

  .budget-side {
    display: flex;
  }

  .budget-row {
    padding: 9px 5px;
  }

  .budget-row .cat-badge {
    width: 31px;
    height: 31px;
  }

  .budget-row-right {
    gap: 3px;
  }

  .budget-edit-btn {
    opacity: 1;
    width: 22px;
  }

  .savings-hero,
  .assets-hero {
    grid-template-columns: 1fr;
    gap: 17px;
    padding: 20px;
    border-radius: 25px;
  }

  .savings-ring-wrap {
    justify-content: flex-start;
    gap: 15px;
  }

  .savings-ring {
    width: 108px;
    height: 108px;
  }

  .savings-ring-center strong {
    font-size: 21px;
  }

  .savings-total strong {
    font-size: 42px;
  }

  .savings-meta {
    gap: 9px;
  }

  .goals-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
  }

  .goals-head .btn {
    height: 33px;
  }

  .goals-grid {
    grid-template-columns: 1fr;
  }

  .goal-card {
    padding: 17px;
  }

  .add-goal-card {
    min-height: 130px;
  }

  .assets-actions {
    flex-direction: row;
  }

  .assets-actions .btn {
    flex: 1;
  }

  .assets-amount strong {
    font-size: 41px;
  }

  .accounts-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .accounts-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .account-card {
    padding: 15px;
  }

  .account-card--add {
    min-height: 78px;
  }

  .account-balance-label {
    margin-top: 12px;
  }

  .account-balance strong {
    font-size: 22px;
  }

  .account-edit {
    opacity: 1;
  }

  .settings-col--side {
    display: flex;
  }

  .settings-card {
    padding: 17px;
  }

  .theme-options {
    gap: 6px;
  }

  .theme-option {
    padding: 10px 4px;
  }

  .data-actions {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    gap: 13px;
  }

  .settings-col {
    gap: 13px;
  }

  .modal-root {
    align-items: flex-end;
    padding: 0;
  }

  .modal-panel {
    width: 100%;
    max-height: 94dvh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 23px 23px 0 0;
    transform: translateY(18px);
  }

  .modal-panel--composer,
  .modal-panel--wide,
  .modal-panel--search {
    width: 100%;
  }

  .modal-header {
    padding: 18px 18px 8px;
  }

  .modal-body {
    padding: 5px 18px 18px;
  }

  .modal-footer {
    padding: 11px 18px calc(11px + env(safe-area-inset-bottom));
  }

  .composer-body {
    padding: 0 18px 16px;
  }

  .composer-fields {
    gap: 9px;
  }

  .category-picker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
  }

  .amount-field input {
    font-size: 29px;
  }

  .search-modal-input {
    margin: 0 18px 10px;
  }

  .search-modal-input .kbd {
    display: none;
  }

  .search-results {
    padding: 0 10px 12px;
  }

  .search-footer {
    padding: 9px 18px calc(9px + env(safe-area-inset-bottom));
  }

  .confirm-body {
    padding: 3px 18px 17px;
  }

  .type-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toast-region {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .app-footer {
    display: none;
  }

  .month-reset {
    display: none !important;
  }

  .topbar .icon-btn {
    border-color: transparent;
  }
}

@media (max-width: 390px) {
  .month-pick {
    min-width: 67px;
  }

  .month-pick #month-label {
    font-size: 9.5px;
  }

  .hero-number {
    font-size: 44px;
  }

  .hero-metric strong {
    font-size: 11px;
  }

  .quick-cat {
    font-size: 8px;
  }

  .quick-cat-icon {
    width: 27px;
    height: 27px;
  }

  .summary-stat strong {
    font-size: 17px;
  }

  .category-picker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .budget-ring-wrap {
    gap: 12px;
  }

  .budget-ring-note {
    max-width: 98px;
  }

  .topbar h1 {
    font-size: 17px;
  }
}

/* ---------- animation + motion ---------- */

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lineFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes donutFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes softPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

/* ---------- finishing touches ---------- */

.category-card {
  display: flex;
  flex-direction: column;
}

.category-card .donut-layout {
  flex: 1;
  justify-content: center;
}

.mini-cat-percent.over {
  color: var(--red) !important;
}

.category-card .donut-figure {
  width: min(178px, 70%);
}

.category-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 8.5px;
}

.category-foot-dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--faint);
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.mini-budget-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: auto;
  padding: 11px 2px 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 9px;
}

.mini-budget-foot:hover {
  color: var(--brand);
}

.mini-budget-foot .icon {
  width: 13px;
  height: 13px;
}

.weekday-card {
  display: flex;
  flex-direction: column;
}

.weekday-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 8.5px;
}

.weekday-foot strong {
  color: var(--ink-2);
  font-family: var(--font-num);
  font-weight: 600;
}

.calendar-recap {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.55fr);
  align-items: center;
  gap: 26px;
  margin-top: 16px;
  padding: clamp(18px, 2vw, 24px);
  background:
    radial-gradient(circle at 0 0, color-mix(in srgb, var(--gold) 8%, transparent), transparent 38%),
    var(--surface);
}

.recap-intro {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.recap-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 11px;
  background: var(--gold-soft);
  color: var(--gold);
}

.recap-icon .icon {
  width: 17px;
  height: 17px;
}

.recap-intro .eyebrow {
  margin-bottom: 3px;
  font-size: 8px;
}

.recap-intro h3 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.recap-intro p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.55;
}

.recap-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.recap-stat {
  min-width: 0;
  padding: 10px 12px;
  border-left: 1px solid var(--line);
}

.recap-stat:first-child {
  border-left: 0;
}

.recap-stat > span {
  display: block;
  color: var(--faint);
  font-size: 8.5px;
}

.recap-stat strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  font-family: var(--font-num);
  font-size: 17px;
  font-weight: 580;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recap-stat strong em {
  margin-left: 2px;
  color: var(--faint);
  font-family: var(--font-sans);
  font-size: 9px;
  font-style: normal;
  font-weight: 400;
}

.recap-stat small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--faint);
  font-size: 7.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.budget-editor-list {
  max-height: none;
  overflow: visible;
}

.budget-editor-summary {
  margin: 2px 0 7px;
}

.modal-form,
.tx-form {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.modal-body,
.composer-body {
  min-height: 0;
  flex: 1;
}

.modal-footer .footer-left:empty {
  display: none;
}

.hero-text-btn {
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: rgba(250, 246, 235, 0.84);
  font-size: 9.5px;
  line-height: 1.6;
}

.hero-text-btn:hover {
  color: #fff;
}

.icon-btn.is-active {
  border-color: color-mix(in srgb, var(--brand) 18%, var(--line));
  background: var(--brand-tint);
  color: var(--brand);
}

.sub-copy {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.sub-copy:hover strong {
  color: var(--brand);
}

.composer-footer-note {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.composer-footer-note .icon {
  width: 12px;
  height: 12px;
}

.mini-goal-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.mini-goal-copy .mini-goal-progress {
  display: block;
}

.mini-goal-copy .progress-track {
  height: 4px;
  margin-top: 3px;
  background: color-mix(in srgb, var(--goal-color) 12%, var(--surface-3));
}

.mini-goal-copy .progress-track > span {
  background: var(--goal-color);
}

.type-choice .type-choice-icon .icon {
  width: 13px;
  height: 13px;
}

.form-error span {
  min-width: 0;
}

.cal-day,
.tx-row,
.quick-cat,
.mini-goal-card,
.account-card--add,
.add-goal-card {
  appearance: none;
}

.field select.input {
  height: 39px;
  padding-right: 28px;
  appearance: none;
}

.field .select-wrap > .icon {
  top: 50%;
  transform: translateY(-50%);
}

.modal-panel .quick-amounts {
  align-items: center;
}

.switch > span {
  display: none;
}

.profile-edit-form .input {
  height: 37px;
}

.budget-input-row .cat-badge .cat-emoji {
  font-size: 14px;
}

.data-action .data-action-copy {
  min-width: 0;
}

@media (max-width: 960px) {
  .quick-cats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .filter-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .search-field {
    grid-column: 1 / 3;
  }

  .filter-row .segmented {
    grid-column: 3 / 5;
    width: 100%;
  }

  .filter-row .segmented button {
    flex: 1;
  }

  .select-wrap {
    width: 100%;
    min-width: 0;
  }

  .select-wrap select {
    width: 100%;
    min-width: 0;
  }

  .filter-actions {
    justify-content: flex-end;
    margin-left: 0;
  }

  .calendar-recap {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .recap-grid {
    gap: 4px;
  }

  .recap-stat {
    border-left: 0;
    border-radius: 10px;
    background: var(--surface-2);
  }
}

@media (max-width: 760px) {
  .recap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recap-stat {
    padding: 9px 10px;
  }

  .weekday-foot {
    flex-wrap: wrap;
  }

  .modal-panel {
    max-height: 94dvh;
  }

  .modal-form,
  .tx-form {
    min-height: 0;
  }

  .modal-footer .footer-left {
    max-width: 100%;
  }

  .inline-confirm {
    flex-wrap: wrap;
  }

  .pattern-choice-grid,
  .type-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .theme-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
