:root {
  color-scheme: light;
  --navy: #0f172a;
  --ink: #182638;
  --muted: #566879;
  --line: #dce4e9;
  --emerald: #059669;
  --rose: #e11d48;
  --canvas: #f8fafc;
  --font: "Inter", "Segoe UI", Arial, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
button,
input,
select {
  font: inherit;
}
button,
select {
  cursor: pointer;
}
button {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid #259c98;
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
button {
  border: 0;
  background: none;
}
svg.ico {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.top {
  background: var(--navy);
  color: white;
  padding-top: env(safe-area-inset-top);
}
.top-inner,
main {
  max-width: 1512px;
  margin: auto;
  padding-left: clamp(20px, 4.4vw, 76px);
  padding-right: clamp(20px, 4.4vw, 76px);
}
.top-inner {
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 78px);
  min-height: 76px;
}
.brand {
  color: white;
  text-decoration: none;
  font-size: 29px;
  font-weight: 720;
  letter-spacing: -1.6px;
  display: flex;
  align-items: center;
}
.brand svg {
  width: 35px;
  height: 33px;
  fill: #6de9bd;
  margin-right: 9px;
}
.brand span,
.footbrand span {
  color: #50d8aa;
}
nav {
  display: flex;
  gap: 6px;
  align-items: center;
}
nav button {
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 9px;
  padding: 11px 15px;
  color: #b7c2d0;
  font-weight: 560;
}
nav button:hover,
.gear:hover {
  background: #253148;
  color: white;
}
nav button[aria-current="page"] {
  background: #263549;
  color: #a5f3d5;
}
nav .ico {
  width: 17px;
}
.tools {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-left: auto;
}
.status {
  white-space: nowrap;
  color: #d6e0e8;
  font-size: 12px;
  padding: 7px 11px;
  border: 1px solid #3b4656;
  border-radius: 20px;
}
.status:before,
.live-dot:before {
  content: "";
  width: 6px;
  height: 6px;
  display: inline-block;
  border-radius: 50%;
  background: #83dfb6;
  margin-right: 7px;
  vertical-align: 2px;
}
.gear {
  width: 38px;
  height: 38px;
  color: #c3d0dc;
  display: grid;
  place-items: center;
  border-radius: 9px;
}
.page-head,
.actions,
.card-head,
.modal-head,
.pair,
.card-title,
.metric-name,
.tx,
.rank,
.legend-line {
  display: flex;
  align-items: center;
}
.page-head {
  justify-content: space-between;
  gap: 14px;
  padding: 36px 0 25px;
}
.dateline,
.eyebrow {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.55px;
  text-transform: uppercase;
  color: #506771;
}
.dateline {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dateline:before {
  content: "";
  height: 2px;
  width: 20px;
  background: var(--emerald);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(31px, 3vw, 46px);
  letter-spacing: -2px;
  line-height: 1.2;
  margin: 6px 0 0;
  font-weight: 650;
}
h2 {
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.8px;
  font-weight: 650;
}
h3 {
  font-size: 15px;
  letter-spacing: -0.3px;
}
.actions {
  gap: 10px;
}
.primary,
.secondary,
.period {
  min-height: 44px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 600;
}
.primary {
  background: #087b5c;
  color: white;
  padding: 10px 18px;
  box-shadow: 0 2px 3px #0f382a14;
}
.primary:hover {
  background: #04684e;
}
.primary b {
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
}
.secondary,
.period {
  background: white;
  border: 1px solid #d3dde2;
}
.period {
  position: relative;
  padding: 0 12px;
}
.period select {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 9px 0;
  outline-offset: 1px;
  font-weight: 600;
}
.secondary {
  padding: 9px 14px;
}
.metrics {
  display: grid;
  grid-template-columns: 1.13fr 1fr 1fr;
  gap: 17px;
  margin-bottom: 24px;
}
.card,
.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 2px 4px #17354604;
}
.metric {
  position: relative;
  overflow: hidden;
  min-height: 174px;
  padding: 22px 24px;
}
.metric-name {
  gap: 10px;
  font-weight: 600;
  color: #475869;
  font-size: 14px;
}
.tile {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  flex: none;
}
.mint {
  color: #087a5c;
  background: #e0f7ee;
}
.pink {
  color: var(--rose);
  background: #ffedf1;
}
.metric-value {
  font-size: clamp(28px, 2.65vw, 44px);
  font-weight: 645;
  letter-spacing: -1.8px;
  line-height: 1.24;
  margin: 14px 0 8px;
  position: relative;
  font-variant-numeric: tabular-nums;
}
.currency {
  font-size: 0.56em;
  letter-spacing: -0.4px;
  font-weight: 550;
  margin-right: 6px;
}
.metric-foot {
  font-size: 12px;
  color: var(--muted);
  position: relative;
}
.metric.balance {
  background: #084e42;
  background-image: linear-gradient(115deg, #063d35, #0b594a);
  border-color: #07483c;
  color: white;
}
.balance .metric-name,
.balance .metric-foot {
  color: #d7f4e9;
}
.balance .tile {
  background: #ffffff1c;
  color: #b5f8da;
}
.contours {
  position: absolute;
  right: -1px;
  top: 0;
  width: 57%;
  height: 100%;
  opacity: 0.4;
  pointer-events: none;
}
.balance .metric-name {
  position: relative;
}
.trend {
  position: absolute;
  right: 14px;
  bottom: 12px;
  width: 30%;
  height: 48px;
  opacity: 0.9;
}
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.46fr) minmax(0, 1fr);
  gap: 20px;
}
.card {
  padding: 23px;
  min-width: 0;
}
.card-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.subtitle,
.help {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}
.card-icon {
  border: 1px solid #dce5e5;
  border-radius: 9px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #59736c;
}
.subtag {
  font-size: 11px;
  color: #586a72;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 7px;
  white-space: nowrap;
}
.breakbody {
  display: grid;
  grid-template-columns: minmax(145px, 0.9fr) minmax(165px, 1.1fr);
  gap: clamp(10px, 2vw, 32px);
  align-items: center;
  padding: 17px 0 24px;
}
.donut-box {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  width: 100%;
  max-width: 238px;
  margin: auto;
}
.donut-box canvas,
.chart-block canvas {
  width: 100% !important;
  height: 100% !important;
}
.donut-center {
  pointer-events: none;
  position: absolute;
  inset: 22%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.25;
}
.donut-center small {
  color: var(--muted);
  font-size: 11px;
}
.donut-center strong {
  font-size: clamp(19px, 1.8vw, 30px);
  font-weight: 650;
  letter-spacing: -1px;
}
.donut-center .unit {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.3px;
  color: #677682;
  margin-top: 3px;
}
.breakrows {
  display: grid;
  gap: 14px;
}
.bar-row {
  min-width: 0;
}
.legend-line {
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  justify-content: space-between;
}
.legend-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.legend-line strong {
  font-weight: 650;
  white-space: nowrap;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--c);
  display: inline-block;
  flex: none;
}
.track {
  height: 5px;
  background: #f0f3f5;
  border-radius: 10px;
  overflow: hidden;
  flex: 1;
}
.fill {
  display: block;
  height: 100%;
  border-radius: 10px;
  background: var(--c);
}
.bar-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 5px 0 0 15px;
}
.bar-foot small {
  color: #677682;
  font-size: 10px;
  min-width: 28px;
  text-align: right;
}
.insight {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #51656a;
  font-size: 12px;
}
.insight .ico {
  color: var(--emerald);
  width: 16px;
}
.card-link {
  color: #087d60;
  font-size: 12px;
  white-space: nowrap;
  font-weight: 650;
  padding: 8px 0;
}
.tx {
  gap: 10px;
  border-top: 1px solid #edf0f3;
  padding: 12px 0;
}
.tx:first-child {
  border-top: 0;
  padding-top: 0;
}
.tx:last-child {
  padding-bottom: 0;
}
.tx .tile {
  width: 37px;
  height: 37px;
}
.tx-main {
  min-width: 0;
  flex: 1;
}
.tx-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 620;
  font-size: 13px;
}
.tx small,
.under {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.money {
  font-weight: 650;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.income {
  color: #07815e;
}
.expense {
  color: #c72850;
}
.tx-end {
  text-align: right;
  font-size: 13px;
}
.empty {
  padding: 30px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
footer {
  margin: 29px 0 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 15px;
  font-size: 11px;
  color: #647582;
}
.footbrand {
  font-size: 16px;
  font-weight: 750;
  color: #3d535a;
  letter-spacing: -0.8px;
}
footer i {
  display: inline-block;
  height: 3px;
  width: 3px;
  background: #86959d;
  border-radius: 50%;
  margin: 0 4px;
  vertical-align: 2px;
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.stack {
  display: grid;
  gap: 20px;
}
.chart-block {
  position: relative;
  height: 245px;
}
.large-chart {
  height: 310px;
}
.rank {
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.rank .money {
  margin-left: auto;
}
.rank-num {
  width: 22px;
  font-size: 12px;
  color: #667681;
}
.scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #e7edef;
  white-space: nowrap;
}
th {
  font-size: 11px;
  color: #52636f;
  letter-spacing: 0.2px;
  font-weight: 650;
  background: #f5f8fa;
}
.history td:first-child {
  white-space: normal;
  min-width: 150px;
}
.table-name {
  display: flex;
  align-items: center;
  gap: 9px;
}
.pill {
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  display: inline-block;
  padding: 4px 9px;
}
.pill.income {
  background: #dff6ed;
}
.pill.expense {
  background: #fff0f3;
}
.filters {
  display: flex;
  gap: 9px;
  margin: 0 0 17px;
  flex-wrap: wrap;
}
.filters input,
.filters select,
.field input,
.field select {
  width: 100%;
  min-height: 43px;
  border: 1px solid #cfd9df;
  border-radius: 8px;
  padding: 9px 11px;
  background: white;
  color: var(--ink);
  min-width: 0;
}
.filters input {
  flex: 1;
  min-width: 160px;
}
.filters select {
  width: auto;
  max-width: 100%;
}
.months th:first-child,
.months td:first-child {
  position: sticky;
  left: 0;
  background: #f5f8fa;
  z-index: 1;
  font-weight: 600;
}
.months td,
.months th {
  text-align: right;
}
.months td:first-child,
.months th:first-child {
  text-align: left;
}
.table-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}
dialog {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  width: min(468px, calc(100% - 24px));
  max-height: 90dvh;
  padding: 25px;
  box-shadow: 0 24px 80px #0f172a33;
}
dialog::backdrop {
  background: #10233283;
  backdrop-filter: blur(3px);
}
.modal-head {
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}
.modal-head h2 {
  font-size: 26px;
  margin: 3px 0;
}
.close {
  font-size: 23px;
  border-radius: 50%;
  background: #f2f5f7;
  width: 35px;
  height: 35px;
  line-height: 1;
}
.eyebrow {
  color: #08775b;
}
.switch {
  display: flex;
  background: #f1f5f7;
  padding: 4px;
  border-radius: 10px;
}
.switch button {
  min-height: 36px;
  flex: 1;
  border-radius: 7px;
  font-weight: 600;
}
.switch button[aria-pressed="true"] {
  background: white;
  box-shadow: 0 1px 5px #0f172a13;
}
.field,
legend {
  display: block;
  font-size: 13px;
  font-weight: 600;
}
.field {
  margin-top: 13px;
}
.field small {
  color: var(--muted);
  font-weight: 400;
}
.field > input,
.field > select,
.amount-field {
  margin-top: 5px;
}
.amount-field {
  display: flex;
  align-items: center;
  border: 1px solid #ccd9de;
  border-radius: 9px;
  padding-left: 12px;
  gap: 6px;
}
.amount-field > span {
  color: #5a6e78;
}
.amount-field input {
  font-size: 24px;
  border: 0;
  background: transparent;
}
.pair {
  gap: 10px;
  align-items: flex-start;
}
.pair > * {
  flex: 1;
  min-width: 0;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 14px 0 0;
}
legend {
  padding: 0;
  margin-bottom: 6px;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.category-grid button {
  border: 1px solid var(--line);
  border-radius: 9px;
  min-height: 60px;
  padding: 7px 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
}
.category-grid button[aria-pressed="true"] {
  background: #ebf9f2;
  border-color: #148660;
  color: #066749;
}
.full {
  width: 100%;
  margin-top: 10px;
}
.error {
  font-size: 13px;
  color: #bb2347;
  margin-top: 7px;
}
.error:empty,
.help:empty {
  display: none;
}
.help {
  margin: 10px 0;
}
.notice,
#notice {
  border: 1px solid #e0d3a8;
  background: #fff9e9;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 15px;
  font-size: 13px;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: white;
  border-radius: 9px;
  padding: 10px 18px;
  z-index: 5;
  box-shadow: 0 3px 15px #10182924;
  font-size: 13px;
}
#toast:empty {
  display: none;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1350px) {
  .card {
    padding: 28px;
  }
  .metric {
    min-height: 182px;
  }
  .breakbody {
    padding: 18px 0 26px;
  }
  .breakrows {
    gap: 17px;
  }
  .legend-line,
  .tx-main strong {
    font-size: 14px;
  }
  .tx {
    padding: 14px 0;
  }
}
@media (max-width: 1100px) {
  .top-inner {
    gap: 20px;
  }
  nav button {
    padding: 10px 12px;
  }
  .overview-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  }
  .card {
    padding: 18px;
  }
  .breakbody {
    gap: 15px;
  }
  .metric {
    padding: 19px;
  }
  .legend-line {
    flex-wrap: wrap;
    gap: 2px 6px;
  }
  .breakbody {
    grid-template-columns: minmax(120px, 0.8fr) minmax(155px, 1.2fr);
  }
}
@media (max-width: 840px) {
  .overview-grid,
  .two {
    grid-template-columns: 1fr;
  }
  .top-inner {
    flex-wrap: wrap;
    gap: 0;
    min-height: 62px;
  }
  .brand {
    margin: 12px 0;
  }
  .tools {
    order: 1;
  }
  nav {
    order: 2;
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid #334052;
    padding: 5px 0;
  }
  nav button {
    justify-content: center;
    flex: 1;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 16px;
    min-height: 154px;
  }
  .metric-value {
    font-size: 28px;
  }
  .breakbody {
    grid-template-columns: 0.85fr 1.15fr;
    padding: 5px 0 20px;
  }
  .card {
    padding: 22px;
  }
  .breakrows {
    gap: 14px;
  }
  .donut-box {
    max-width: 210px;
  }
  .donut-center strong {
    font-size: 26px;
  }
}
@media (max-width: 600px) {
  main,
  .top-inner {
    padding-left: 16px;
    padding-right: 16px;
  }
  .top-inner {
    min-height: 58px;
  }
  .brand {
    font-size: 25px;
  }
  .brand svg {
    width: 29px;
  }
  .tools {
    gap: 4px;
  }
  .status {
    font-size: 11px;
  }
  .gear {
    width: 34px;
  }
  nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    background: #fff;
    box-shadow: 0 -3px 18px #1224370a;
    border-top: 1px solid var(--line);
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
    gap: 2px;
  }
  nav button {
    flex-direction: column;
    gap: 3px;
    color: #60717b;
    font-size: 10px;
    padding: 7px 2px;
    border-radius: 8px;
  }
  nav button[aria-current="page"] {
    color: #067757;
    background: #e7f7ee;
  }
  nav button:hover {
    color: #09644e;
    background: #ecf4f0;
  }
  main {
    padding-bottom: 75px;
  }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px 0 17px;
    gap: 14px;
  }
  .actions {
    width: 100%;
  }
  .actions > .primary {
    margin-left: auto;
  }
  .dateline {
    font-size: 9px;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 13px;
  }
  .balance {
    grid-column: 1/-1;
  }
  .metric.balance {
    min-height: 143px;
    padding: 17px 19px;
  }
  .balance .metric-value {
    font-size: 37px;
  }
  .metric {
    min-height: 124px;
    padding: 13px;
  }
  .metric-value {
    font-size: clamp(21px, 5.7vw, 30px);
    letter-spacing: -1px;
    margin: 13px 0 5px;
  }
  .metric-name {
    font-size: 12px;
    gap: 6px;
  }
  .metric-name .tile {
    width: 27px;
    height: 27px;
    border-radius: 8px;
  }
  .metric-name .ico {
    width: 16px;
  }
  .metric-foot {
    font-size: 10px;
  }
  .trend {
    height: 25px;
    width: 24%;
    right: 8px;
    bottom: 9px;
  }
  .overview-grid,
  .two,
  .stack {
    gap: 13px;
  }
  .card {
    padding: 17px;
    border-radius: 13px;
  }
  .card-head {
    margin-bottom: 15px;
  }
  h2 {
    font-size: 19px;
  }
  .breakbody {
    grid-template-columns: minmax(110px, 0.8fr) minmax(143px, 1.2fr);
    gap: 10px;
  }
  .breakrows {
    gap: 10px;
  }
  .legend-line {
    font-size: 11px;
  }
  .donut-center strong {
    font-size: clamp(16px, 4.5vw, 25px);
  }
  .donut-center small {
    font-size: 9px;
  }
  .donut-center .unit {
    font-size: 9px;
  }
  .bar-foot {
    margin-top: 2px;
  }
  .chart-block {
    height: 210px;
  }
  .large-chart {
    height: 245px;
  }
  .insight {
    font-size: 11px;
  }
  .filters select {
    flex: 1;
    min-width: 100px;
  }
  .status:before {
    width: 5px;
    height: 5px;
  }
  .table-meta {
    gap: 10px;
  }
  .pair {
    flex-wrap: wrap;
  }
  .pair .field {
    min-width: 135px;
  }
  dialog {
    padding: 18px;
  }
  #toast {
    bottom: 85px;
  }
  .card-link {
    font-size: 11px;
  }
}
@media (max-width: 350px) {
  .breakbody {
    grid-template-columns: 1fr;
  }
  .donut-box {
    max-width: 160px;
  }
  .breakrows {
    width: 100%;
  }
  .metric-name {
    font-size: 11px;
  }
  .tools .status {
    padding: 5px 7px;
  }
  .legend-line {
    flex-wrap: nowrap;
  }
}
