:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  color-scheme: light;
  --canvas:#f5f6fa;
  --hover:#f0f5fe;
  --divider:#eff1f5;
  --control:#dce3ec;
  --well:#edf1f6;
  --slider-track:#dce3ed;
  --slider-fill:#0973e6;
  --mobile-surface:#fffffff4;
  --ink: #172237;
  --muted: #59687e;
  --faint: #68788e;
  --line: #e7ebf1;
  --surface: #fff;
  --blue: #0964cf;
  --blue-strong: #0757b6;
  --soft: #eaf2ff;
  --green: #17795c;
  --red: #b63843;
  --radius: 19px;
  font-size: 14px;
  line-height: 1.5;
  font-synthesis: none;
}
[data-theme="dark"] {
  color-scheme: dark;
  --canvas:#171a20;
  --surface:#222630;
  --ink:#eef2fa;
  --muted:#bec8d9;
  --faint:#aab7cb;
  --line:#3a4353;
  --divider:#333b48;
  --control:#4f5c72;
  --well:#303847;
  --slider-track:#4a5568;
  --slider-fill:#56a3ff;
  --hover:#2e384a;
  --soft:#273951;
  --blue-strong:#9bc6ff;
  --green:#8edbb4;
  --red:#ff9da6;
  --mobile-surface:#222630f5;
}
[data-theme="dark"] .tile { --tile-bg:#273951; --tile-fg:#9bc6ff; }
[data-theme="dark"] .tile.green { --tile-bg:#243d36; --tile-fg:#8edbb4; }
[data-theme="dark"] .tile.orange { --tile-bg:#423429; --tile-fg:#ffc293; }
[data-theme="dark"] .tile.purple { --tile-bg:#392e50; --tile-fg:#d6c5ff; }
[data-theme="dark"] .tile.rose { --tile-bg:#492e3c; --tile-fg:#ffb4ce; }
[data-theme="dark"] .tile.gray { --tile-bg:#354050; --tile-fg:#c4d2e5; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
body:has(dialog[open]) { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #237be2; outline-offset: 3px; }
a { color: var(--blue-strong); }
h1,h2,h3,p { margin: 0; }
small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums lining-nums; }
.i { width: 19px; height: 19px; flex: none; vertical-align: middle; }
.i-sm { width: 15px; height: 15px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.layout { display: grid; grid-template-columns: 226px minmax(0, 1fr); min-height: 100vh; }
.rail { height: 100dvh; position: sticky; top: 0; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); padding: 27px 16px 18px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-align: left; border: 0; background: none; padding: 0; }
.rail > .brand { margin: 0 8px 36px; align-self: start; }
.brandmark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg,#318af1,#0964cf 78%); box-shadow: 0 3px 7px #0964cf36; }
.brandmark .i { width: 25px; height: 25px; }
.brand b { font-size: 19px; letter-spacing: .035em; display: block; line-height: 1.2; }
.brand small { color: var(--muted); display: block; margin-top: 3px; font-size: 10px; letter-spacing: .045em; }
.nav-group { margin-bottom: 24px; }
.nav-caption { padding: 0 12px; margin-bottom: 8px; font-size: 11px; letter-spacing: .13em; color: var(--faint); }
.nav-btn { width: 100%; min-height: 43px; display: flex; gap: 11px; align-items: center; text-align: left; border: 0; border-radius: 10px; background: transparent; padding: 8px 12px; color: var(--muted); margin: 2px 0; font-weight: 550; }
.nav-btn[aria-current="page"] { background: var(--soft); color: var(--blue-strong); }
.nav-btn:hover { background: var(--hover); color: var(--blue-strong); }
.rail-foot { margin-top: auto; }
.profile { display: flex; width: 100%; text-align: left; gap: 10px; align-items: center; background: transparent; border: 0; padding: 15px 7px 2px; margin-top: 14px; border-top: 1px solid var(--line); }
.profile > span:nth-child(2) { flex: 1; }
.profile small, .person small { display: block; color: var(--faint); margin-top: 1px; }
.profile > .i { color: var(--faint); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--soft); color: var(--blue-strong); font-weight: 650; flex: none; }
.stage { min-width: 0; }
.top { min-height: 63px; display: flex; align-items: center; justify-content: space-between; padding: 0 36px; background: var(--surface); border-bottom: 1px solid var(--line); }
.context { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.context strong { color: var(--ink); font-weight: 600; }
.context .i { color: var(--faint); }
.top-actions { display: flex; gap: 11px; align-items: center; }
.demo-label { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.demo-label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #6898ce; }
.main { min-width: 0; width: 100%; max-width: 1520px; margin: 0 auto; padding: 27px 36px 30px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 23px; }
h1 { font-size: clamp(26px, 2.6vw, 35px); letter-spacing: -.035em; line-height: 1.2; font-weight: 700; }
.page-head p { color: var(--muted); margin-top: 7px; font-size: 13px; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.btn, .icon-btn, .link-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 600; white-space: nowrap; transition: background .15s, color .15s, transform .12s; }
.btn:hover, .icon-btn:hover { background: var(--hover); }
.btn:active, .icon-btn:active, .link-btn:active { transform: scale(.97); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 2px 5px #0964cf25; }
.btn.primary:hover { background: #0757b6; }
.icon-btn { width: 37px; min-height: 37px; padding: 0; color: var(--muted); }
.link-btn { color: var(--blue-strong); background: transparent; border: 0; min-height: 34px; padding: 3px 0 3px 5px; font-size: 12px; }
.link-btn:hover { color: var(--blue-strong); text-decoration: underline; text-underline-offset: 3px; }
.month { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 9px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.month select { border: 0; background: transparent; min-height: 37px; padding: 0 2px; font-size: 13px; font-weight: 600; color: var(--ink); }
.hero { --hero-edge: #1a4a91; position: relative; isolation: isolate; overflow: hidden; color: #fff; background: radial-gradient(ellipse at 88% 130%,#2866ad 0%,transparent 54%), linear-gradient(113deg,#0e2041 10%,#132e5d 62%,var(--hero-edge)); border-radius: 22px; min-height: 204px; padding: 24px 27px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 5px 13px #162b5520; }
.hero-decor { position: absolute; pointer-events: none; z-index: -1; width: 520px; height: 326px; right: 2%; top: -15%; transform: rotate(-21deg); }
.orbit { position: absolute; inset: calc(var(--orbit) * 19px); border: 1px solid #a9d2ff32; border-radius: 50%; background: linear-gradient(105deg,transparent 36%,#9bcbff09); box-shadow: 0 0 30px #60aaff08 inset; }
.orbit-dot { position: absolute; width: 11px; height: 11px; top: 18%; left: 56%; border-radius: 50%; background: #c9e3ff; box-shadow: 0 0 18px 3px #81c4ffad; }
.orbit-dot:last-child { top: 59%; left: 17%; width: 6px; height: 6px; background: #a1cdfb; }
.hero-top, .card-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.hero-label { display: inline-flex; gap: 8px; align-items: center; color: #dce9fa; font-weight: 550; }
.hero-amount { font-size: clamp(32px, 4vw, 53px); font-weight: 660; letter-spacing: -.047em; line-height: 1.12; margin: 6px 0 9px; width: fit-content; }
.hero-amount .currency { font-size: .56em; color: #d6e6ff; margin-right: 5px; letter-spacing: 0; }
.hero-action { border: 1px solid #bad9ff66; background: #ffffff12; color: white; display: inline-flex; gap: 5px; align-items: center; min-height: 34px; border-radius: 8px; padding: 5px 9px; font-size: 12px; white-space: nowrap; align-self: flex-start; }
.hero-action:hover { background: #ffffff25; }
.hero-bottom { display: flex; align-items: center; gap: 10px; color: #d7e6fa; font-size: 12px; }
.hero-delta { display: inline-flex; align-items: center; gap: 4px; background: #ffffff1f; color: #edf5ff; border: 1px solid #ffffff18; border-radius: 6px; padding: 3px 7px; }
.metric-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; margin: 15px 0 16px; }
.card, .metric { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: 0 2px 4px #242f4605; min-width: 0; }
.metric { display: flex; align-items: center; gap: 13px; padding: 15px 16px; }
.tile { --tile-bg: #eaf2ff; --tile-fg: #0964cf; height: 38px; width: 38px; display: inline-grid; place-items: center; border-radius: 11px; flex: none; background: var(--tile-bg); color: var(--tile-fg); }
.tile.green { --tile-bg:#e9f6ee; --tile-fg:#17795c; }
.tile.orange { --tile-bg:#fff1e6; --tile-fg:#a25717; }
.tile.purple { --tile-bg:#f1ebff; --tile-fg:#7359bb; }
.tile.rose { --tile-bg:#fbecef; --tile-fg:#ae4a64; }
.tile.gray { --tile-bg:#eff2f6; --tile-fg:#53647c; }
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { display: block; width: fit-content; font-size: clamp(15px, 1.95vw, 26px); line-height: 1.23; letter-spacing: -.035em; margin: 3px 0 2px; font-weight: 680; }
.metric-note { color: var(--muted); font-size: 11px; }
.duo { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(0,1fr); gap: 16px; align-items: stretch; margin-bottom: 16px; }
.card { padding: 18px 20px; }
.card h2 { font-size: 16px; font-weight: 690; letter-spacing: -.015em; }
.card-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.legend { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 9px 14px; color: var(--muted); font-size: 11px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.swatch { display: inline-block; height: 8px; width: 8px; border-radius: 2px; background: #2375db; }
.swatch.pale { background: #a1c4f0; }
.chart { display: grid; grid-template-columns: 43px minmax(0,1fr); grid-template-rows: 143px 23px; padding-top: 17px; min-width: 0; }
.axis { display: flex; flex-direction: column; justify-content: space-between; text-align: right; padding-right: 9px; font-size: 10px; color: var(--faint); line-height: 1; transform: translateY(-4px); }
.bars { position: relative; display: grid; grid-template-columns: repeat(var(--count),minmax(0,1fr)); gap: 3px; align-items: end; grid-column: 2; grid-row: 1; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom,var(--line) 0 1px,transparent 1px 33.333%); }
.bar-group { height: 100%; display: flex; gap: clamp(3px,.5vw,7px); align-items: flex-end; justify-content: center; border: 0; background: transparent; padding: 0; border-radius: 7px 7px 0 0; }
.bar-group:hover, .bar-group:focus-visible { background: #e8f1ff7a; }
.bar { width: min(28%,25px); height: var(--size); background: #4d96eb; border-radius: 4px 4px 0 0; }
.bar.pale { background: #bed6f5; }
.bar-group[aria-current="true"] .bar { background: #0964cf; }
.bar-group[aria-current="true"] .bar.pale { background: #97bff0; }
.chart-labels { grid-column: 2; display: grid; grid-template-columns: repeat(var(--count),minmax(0,1fr)); gap: 3px; color: var(--muted); font-size: 11px; text-align: center; padding-top: 6px; }
.chart-labels b { color: var(--blue-strong); }
.budget-item { display: block; width: 100%; border: 0; border-bottom: 1px solid var(--divider); background: transparent; padding: 10px 0 11px; text-align: left; }
.budget-item:last-child { border-bottom: 0; padding-bottom: 0; }
.budget-item:hover strong { color: var(--blue-strong); }
.budget-label, .budget-meta, .spread { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.budget-label { font-size: 12px; }
.budget-label span { color: var(--muted); white-space: nowrap; }
.track { display: block; height: 5px; background: var(--well); border-radius: 5px; overflow: hidden; margin: 7px 0 5px; }
.track > i { display: block; width: var(--fill); height: 100%; background: var(--track-color,#4b94ee); border-radius: inherit; }
.budget-meta { font-size: 11px; color: var(--muted); }
.red { color: var(--red) !important; }
.green-text { color: var(--green) !important; }
.list { margin-top: 6px; }
.tx, .item { width: 100%; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 0; background: none; border: 0; border-bottom: 1px solid var(--divider); }
.tx:last-child, .item:last-child { border-bottom: 0; }
button.tx:hover strong, button.item:hover strong { color: var(--blue-strong); }
.tx .tile, .item .tile { width: 33px; height: 33px; border-radius: 9px; }
.tx .tile .i, .item .tile .i { width: 17px; height: 17px; }
.tx-main, .item-main { flex: 1; min-width: 0; }
.tx strong, .item strong { overflow-wrap: anywhere; font-size: 13px; }
.tx small, .item small { display: block; color: var(--faint); margin-top: 1px; overflow-wrap: anywhere; }
.tx .num, .item .num { white-space: nowrap; font-weight: 620; }
.tx .i:last-child, button.item > .i:last-child { color: var(--faint); }
.person { display: flex; align-items: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 6px; background: var(--soft); color: var(--blue-strong); font-size: 11px; white-space: nowrap; font-weight: 600; }
.chip.done { color: var(--green); background: #e9f6ee; }
.chip.alert { color: var(--red); background: #fbecef; }
.footer { color: var(--faint); font-size: 11px; text-align: center; padding-top: 4px; }
.mobile-brand, .mobile-nav { display: none; }
.empty { padding: 24px 10px; color: var(--muted); text-align: center; }
.content-card { margin-bottom: 16px; }
.filters { display: flex; gap: 9px; flex-wrap: wrap; padding: 12px 0 7px; }
.filters label { flex: 1 1 135px; }
.filters label:first-child { flex: 2 1 180px; }
input, select, textarea { border: 1px solid var(--control); border-radius: 9px; background: var(--surface); font-size: 14px; min-width: 0; min-height: 41px; padding: 8px 10px; }
.filters input, .filters select { width: 100%; }
.date-group { font-size: 12px; color: var(--muted); padding: 11px 0 2px; font-weight: 650; }
.date-group:not(:first-child) { border-top: 1px solid var(--line); margin-top: 5px; }
.card-big { font-size: 29px; font-weight: 690; letter-spacing: -.035em; margin: 8px 0 2px; }
.item .amount-stack { text-align: right; }
.item .amount-stack small { white-space: normal; max-width: 160px; }
.group-title { display: flex; align-items: center; gap: 8px; }
.analysis-legend { padding: 9px 0 3px; }
.allocation-bar { display: flex; gap: 3px; height: 13px; border-radius: 8px; overflow: hidden; background: var(--well); margin: 15px 0 5px; }
.allocation-bar i { width: var(--fill); background: var(--track-color); }
.card .section-gap { margin-top: 17px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.settings-row:last-child { border: 0; }
.settings-row p { color: var(--muted); font-size: 12px; margin-top: 3px; }
dialog { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 20px 85px #10234046; color: var(--ink); width: min(505px,calc(100% - 28px)); max-height: calc(100dvh - 32px); padding: 0; overflow: hidden; }
dialog[open] { display: flex; flex-direction: column; animation: enter .16s ease-out; }
dialog::backdrop { background: #12233e60; backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 19px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; }
#entry-form { display: flex; min-height: 0; flex-direction: column; }
.modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 17px 19px 20px; }
.modal-foot { padding: 12px 19px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.modal-foot .primary { min-width: 99px; }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.fields label { display: grid; gap: 5px; min-width: 0; align-content: start; color: var(--muted); font-size: 12px; }
.fields :is(input,select) { width: 100%; color: var(--ink); }
.fields .wide { grid-column: 1/-1; }
.fields #amount { font-size: 21px; font-weight: 650; }
.field-help { font-size: 11px; color: var(--faint); }
.error { min-height: 19px; margin-top: 8px; color: var(--red); font-size: 12px; }
.segment { display: flex; padding: 4px; margin-bottom: 14px; gap: 3px; background: var(--well); border-radius: 10px; }
.segment button { flex: 1; min-height: 33px; padding: 4px 3px; border: 0; border-radius: 7px; white-space: nowrap; background: transparent; color: var(--muted); }
.segment button[aria-pressed="true"] { background: var(--surface); color: var(--blue-strong); font-weight: 650; box-shadow: 0 1px 4px #212d4820; }
.detail-list { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 10px 15px; margin: 12px 0 0; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.login-preview { text-align: center; padding: 12px 6px 7px; }
.login-preview .brandmark { margin: 0 auto 12px; width: 52px; height: 52px; border-radius: 16px; }
.login-preview h3 { font-size: 21px; }
.login-preview p { color: var(--muted); font-size: 13px; margin: 8px 0 18px; }
#toast { position: fixed; z-index: 5; bottom: 21px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 30px); border-radius: 10px; padding: 9px 15px; background: #1c2e4f; color: white; box-shadow: 0 3px 15px #192a522d; pointer-events: none; font-size: 13px; transition: opacity .15s; }
#toast:empty { opacity: 0; }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1130px) {
  .layout { grid-template-columns: 190px minmax(0,1fr); }
  .main { padding-inline: 24px; }
  .top { padding-inline: 24px; }
  .duo { grid-template-columns: minmax(0,1.28fr) minmax(0,1fr); }
}
@media (max-width: 865px) {
  .layout { grid-template-columns: 1fr; }
  .rail, .context { display: none; }
  .mobile-brand { display: inline-flex; }
  .mobile-brand .brandmark { width: 32px; height: 32px; border-radius: 9px; }
  .mobile-brand .brandmark .i { width: 21px; height: 21px; }
  .mobile-brand b { font-size: 16px; }
  .mobile-brand small { display: none; }
  .main { padding-bottom: calc(85px + env(safe-area-inset-bottom)); }
  .mobile-nav { display: grid; grid-template-columns: repeat(5,1fr); position: fixed; z-index: 3; bottom: 0; left: 0; right: 0; padding: 3px 8px max(5px,env(safe-area-inset-bottom)); background: var(--mobile-surface); backdrop-filter: blur(12px); border-top: 1px solid var(--line); justify-items: stretch; }
  .mobile-nav button { background: transparent; border: 0; color: var(--muted); padding: 4px 1px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10px; min-height: 51px; }
  .mobile-nav button[aria-current="page"] { color: var(--blue-strong); font-weight: 700; }
  .mobile-nav .mobile-add .tile { background: var(--blue); color: white; width: 35px; height: 31px; border-radius: 9px; }
  .head-actions .new-head { display: none; }
  #toast { bottom: calc(73px + env(safe-area-inset-bottom)); }
}
@media (max-width: 635px) {
  .top { min-height: 56px; padding-inline: 16px; }
  .main { padding: 20px 15px calc(78px + env(safe-area-inset-bottom)); }
  .page-head { align-items: center; gap: 8px; margin-bottom: 16px; }
  .page-head p { display: none; }
  .month { padding: 0 6px; gap: 3px; }
  .month select { min-height: 40px; font-size: 12px; }
  .hero { min-height: 176px; border-radius: 19px; padding: 17px 15px; }
  .hero-decor { right: -76%; top: -69%; transform: rotate(-25deg) scale(.8); }
  .hero-amount { margin: 8px 0 6px; font-size: clamp(31px,9vw,42px); }
  .hero-action { padding-inline: 7px; min-height: 36px; }
  .hero-bottom { gap: 6px; flex-wrap: wrap; }
  .metric-grid { gap: 7px; margin: 10px 0 12px; }
  .metric { border-radius: 13px; padding: 9px 7px; gap: 5px; flex-direction: column; align-items: flex-start; }
  .metric .tile { width: 26px; height: 26px; border-radius: 7px; }
  .metric .tile .i { width: 15px; height: 15px; }
  .metric-label, .metric-note { font-size: 10px; }
  .metric-value { font-size: clamp(12px,4.04vw,23px); letter-spacing: -.045em; }
  .duo { grid-template-columns: minmax(0,1fr); gap: 11px; margin-bottom: 11px; }
  .card { border-radius: 15px; padding: 13px 13px; }
  .card h2 { font-size: 15px; }
  .card-sub { font-size: 11px; }
  .chart { grid-template-rows: 124px 22px; padding-top: 15px; }
  .card .link-btn { min-height: 40px; }
  .top .icon-btn { width: 42px; min-height: 42px; }
  .settings-row { flex-wrap: wrap; }
  .dialog, dialog { width: 100%; max-width: 100%; max-height: calc(100dvh - 16px); margin: auto auto 0; border-radius: 20px 20px 0 0; }
  .modal-head, .modal-body, .modal-foot { padding-inline: 15px; }
  .modal-foot { padding-bottom: max(12px,env(safe-area-inset-bottom)); }
  .modal-foot .primary { flex: 1; }
  .fields :is(input,select), .filters :is(input,select) { min-height: 44px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.small-actions, .amount-keys { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.allocation-heading { background: var(--well); padding: 8px 10px; border-radius: 10px; }
.allocation-heading h3 { font-size: 14px; overflow-wrap: anywhere; }
.allocation-heading .group-title { min-width: 0; flex-wrap: wrap; }
.allocation-heading .num { font-size: 12px; color: var(--muted); white-space: nowrap; }
.allocation-row .item-main, .settings-row > div:first-child { min-width: 0; }
.allocation-row .num { font-size: 13px; }
.group-title strong { overflow-wrap: anywhere; }
.goal-row { padding: 15px 0; border-bottom: 1px solid var(--line); }
.goal-row:last-of-type { border-bottom: 0; padding-bottom: 0; }
.goal-amount { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 10px; margin-top: 8px; }
.goal-amount strong { font-size: 16px; }
.goal-amount span { color: var(--muted); font-size: 12px; }
.goal-month { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 10px 0 7px; }
.goal-month > div { background: var(--well); border-radius: 10px; padding: 8px 9px; }
.goal-month small, .goal-month strong { display: block; }
.goal-month small { color: var(--muted); }
.goal-month strong { overflow-wrap: anywhere; }
.goal-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 9px; }
.goal-actions .small-actions { margin-left: auto; }
.theme-choice { margin: 0; min-width: 145px; }
.danger-action { color: var(--red); }
.allocation-balance { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-bottom: 13px; }
.allocation-balance > div, .range-box { padding: 9px 12px; background: var(--well); border-radius: 11px; }
.allocation-balance small { display: block; color: var(--muted); }
.allocation-balance strong { display: block; font-size: 17px; margin-top: 3px; overflow-wrap: anywhere; }
.range-box { margin-bottom: 13px; padding: 13px 14px 5px; background: var(--surface); border: 1px solid var(--line); }
.range-box label { font-size: 13px; font-weight: 650; }
.range-box output { color: var(--blue-strong); font-size: 16px; font-weight: 680; font-variant-numeric: tabular-nums; }
.range-box input[type="range"] {
  --range-fill: 0%;
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
#allocation-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right,var(--slider-fill) var(--range-fill),var(--slider-track) var(--range-fill));
}
#allocation-range::-moz-range-track { height: 6px; border-radius: 999px; background: var(--slider-track); }
#allocation-range::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--slider-fill); }
#allocation-range::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -11px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 5px #10224437, 0 0 0 1px #1022440d;
}
#allocation-range::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 5px #10224437, 0 0 0 1px #1022440d;
}
.range-limits { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.range-actions { display: flex; justify-content: flex-end; }
.range-actions .link-btn { min-height: 33px; }
.field-select > small { display: block; margin-top: 5px; }
.amount-field { display: grid; min-width: 0; gap: 8px; }
.amount-input { position: relative; }
.amount-input input { display: block; padding-right: 56px; }
#amount-scale { position: absolute; top: 50%; right: 11px; transform: translateY(-50%); pointer-events: none; }
.amount-tools { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; }
.amount-keys { flex-wrap: nowrap; gap: 8px; }
.amount-keys .btn { width: 42px; min-height: 37px; font-size: 16px; padding: 0; }
@media (max-width: 635px) {
  .card-head:has(> .small-actions) { flex-wrap: wrap; }
  .card-head > .small-actions { margin-left: auto; }
  .allocation-heading .icon-btn, .allocation-row .icon-btn, .amount-keys .btn { width: 44px; min-height: 44px; }
  .range-actions .link-btn, .goal-actions button { min-height: 44px; }
  .allocation-row .small-actions { gap: 2px; }
}

.split-field { border-top: 1px solid var(--line); }
.split-field > .link-btn { min-height: 44px; }
.split-part { padding: 6px 10px 10px; border: 1px solid var(--line); border-radius: 10px; margin-top: 7px; }
.split-part > .link-btn { float: right; }
.split-part > strong { display: inline-block; padding: 6px 0; }
.split-part > .fields { clear: both; }
