:root {
  color-scheme: light;
  --ink: #151613;
  --ink-soft: #5f615c;
  --night: #111210;
  --night-raised: #20211e;
  --paper: #f6f3eb;
  --paper-deep: #ebe7dd;
  --line: #d9d5cb;
  --lime: #d7f70f;
  --lime-dark: #819500;
  --income: #168840;
  --income-soft: #dceccf;
  --expense: #f04b2f;
  --expense-soft: #f9d4c4;
  --danger: #b52f22;
  --shadow: 0 28px 80px rgb(0 0 0 / 34%);
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: #090a09;
  font-family: var(--font);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 4%, rgb(215 247 15 / 7%), transparent 23rem),
    #090a09;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
label,
select,
input[type="month"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.month-control:has(input:focus-visible) {
  outline: 3px solid rgb(126 151 0 / 38%);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  position: relative;
  width: min(100%, 520px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: clip;
  background: var(--night);
  box-shadow: var(--shadow);
}

.app-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 130px;
  padding: calc(20px + env(safe-area-inset-top)) 22px 30px;
  color: #fff;
  background:
    radial-gradient(circle at 84% 20%, rgb(255 255 255 / 7%) 0 1px, transparent 1.5px) 0 0 / 7px 7px,
    linear-gradient(155deg, #181916, #0e0f0d 72%);
}

.brand {
  color: #fff;
  font-size: 2.7rem;
  font-weight: 780;
  letter-spacing: -0.075em;
  line-height: 1;
  text-decoration: none;
}

.brand span {
  color: var(--lime);
}

.month-control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 185px;
  min-height: 49px;
  padding: 0 13px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 18px;
  background: rgb(255 255 255 / 8%);
  box-shadow: inset 0 1px rgb(255 255 255 / 6%);
}

.month-control svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: var(--lime);
}

.month-control button {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.month-control span {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
  clip-path: inset(50%);
}

.paper {
  position: relative;
  z-index: 3;
  min-height: calc(100dvh - 210px);
  margin-top: -12px;
  padding: 30px 22px 22px;
  border-radius: 42px 42px 0 0;
  background:
    linear-gradient(90deg, transparent, rgb(255 255 255 / 52%) 50%, transparent),
    radial-gradient(circle at 30% 10%, rgb(255 255 255 / 65%), transparent 22rem),
    var(--paper);
  box-shadow: 0 -9px 24px rgb(0 0 0 / 15%);
}

.paper::before {
  position: absolute;
  top: 0;
  right: 44px;
  width: 70px;
  height: 15px;
  border-radius: 0 0 28px 28px;
  background: var(--night);
  content: "";
}

.view {
  min-height: 540px;
  animation: enter-view 280ms ease both;
}

@keyframes enter-view {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.intro-title {
  margin: 3px 0 34px;
  font-size: clamp(1.32rem, 5.5vw, 1.68rem);
  font-weight: 720;
  letter-spacing: -0.035em;
}

.balance-label {
  margin: 0 0 5px;
  color: var(--ink-soft);
  font-size: 0.93rem;
  font-weight: 600;
}

.balance-value {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(2.75rem, 13vw, 4.2rem);
  font-variant-numeric: tabular-nums;
  font-weight: 790;
  letter-spacing: -0.065em;
  line-height: 1.04;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.balance-value.negative {
  color: var(--expense);
}

.flow-summary {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 15px;
  align-items: stretch;
  margin-top: 27px;
  padding-bottom: 8px;
}

.flow-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.flow-item > div {
  min-width: 0;
}

.flow-item span:not(.flow-icon) {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.flow-item strong {
  display: block;
  overflow: hidden;
  font-size: clamp(0.88rem, 4vw, 1.08rem);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-icon {
  display: grid;
  flex: 0 0 39px;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 50%;
}

.flow-icon svg {
  width: 21px;
  height: 21px;
}

.flow-income .flow-icon {
  color: var(--income);
  background: var(--income-soft);
}

.flow-income strong {
  color: var(--income);
}

.flow-expense .flow-icon {
  color: var(--expense);
  background: var(--expense-soft);
}

.flow-expense strong {
  color: var(--expense);
}

.flow-divider {
  background: var(--line);
}

.content-section {
  margin-top: 28px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 760;
  letter-spacing: -0.035em;
}

.section-heading > span,
.text-button {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
}

.text-button {
  padding: 7px 0 7px 10px;
  border: 0;
  color: var(--lime-dark);
  background: transparent;
  cursor: pointer;
}

.chart-wrap {
  position: relative;
  min-height: 154px;
}

.chart-grid {
  position: absolute;
  inset: 11px 0 35px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.chart-grid i {
  display: block;
  border-top: 1px dashed #d9d5ca;
}

.weekly-chart {
  position: relative;
  z-index: 1;
  width: 100%;
}

.weekly-chart svg {
  display: block;
  width: 100%;
  height: 154px;
  overflow: visible;
}

.weekly-chart line {
  stroke: #cbc7bd;
  stroke-width: 1;
}

.weekly-chart text {
  fill: var(--ink-soft);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
}

.chart-bar {
  fill: var(--expense);
  filter: drop-shadow(0 4px 5px rgb(240 75 47 / 16%));
  animation: grow-bar 440ms cubic-bezier(.2,.8,.2,1) both;
  transform-box: fill-box;
  transform-origin: center bottom;
}

@keyframes grow-bar {
  from { opacity: 0.25; transform: scaleY(0.05); }
  to { opacity: 1; transform: scaleY(1); }
}

.weekly-chart.is-empty {
  opacity: 0.26;
}

.empty-inline {
  margin-top: -7px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-align: center;
}

.category-list {
  display: grid;
}

.category-row {
  display: grid;
  grid-template-columns: 43px 1fr 36px;
  gap: 11px;
  align-items: center;
  min-height: 69px;
  border-bottom: 1px solid var(--line);
}

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

.category-icon,
.transaction-icon {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 50%;
  color: var(--expense);
  background: var(--expense-soft);
}

.category-icon svg,
.transaction-icon svg {
  width: 23px;
  height: 23px;
}

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

.category-label {
  display: flex;
  justify-content: space-between;
  gap: 9px;
  margin-bottom: 8px;
}

.category-label strong {
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 690;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-label span {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.category-main progress {
  display: block;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border: 0;
  border-radius: 9px;
  appearance: none;
  background: #d9d6cd;
}

.category-main progress::-webkit-progress-bar {
  border-radius: 9px;
  background: #d9d6cd;
}

.category-main progress::-webkit-progress-value {
  border-radius: 9px;
  background: var(--expense);
}

.category-main progress::-moz-progress-bar {
  border-radius: 9px;
  background: var(--expense);
}

.category-row > b {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.transaction-list {
  display: grid;
}

.transaction-row {
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  min-height: 69px;
  border-bottom: 1px solid var(--line);
}

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

.transaction-row.income .transaction-icon {
  color: var(--income);
  background: var(--income-soft);
}

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

.transaction-copy strong,
.transaction-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transaction-copy strong {
  margin-bottom: 3px;
  font-size: 0.93rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.transaction-copy span {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.transaction-value {
  color: var(--expense);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  font-weight: 690;
  white-space: nowrap;
}

.transaction-row.income .transaction-value {
  color: var(--income);
}

.transaction-list.full .transaction-row {
  grid-template-columns: 43px minmax(0, 1fr) auto 34px;
  min-height: 78px;
}

.delete-button,
.icon-button {
  display: grid;
  border: 0;
  place-items: center;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
}

.delete-button {
  width: 34px;
  height: 42px;
}

.delete-button svg {
  width: 19px;
  height: 19px;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 20px 10px 7px;
  color: var(--ink-soft);
  text-align: center;
}

.empty-state svg {
  width: 34px;
  height: 34px;
  margin-bottom: 5px;
  color: var(--lime-dark);
}

.empty-state strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.empty-state span {
  font-size: 0.79rem;
}

.empty-state.large {
  min-height: 330px;
  align-content: center;
}

.view-title {
  padding: 4px 0 24px;
  border-bottom: 1px solid var(--line);
}

.view-title p {
  margin: 0 0 7px;
  color: var(--lime-dark);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.view-title h1 {
  margin: 0;
  font-size: 2.35rem;
  font-weight: 790;
  letter-spacing: -0.06em;
}

.primary-add {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 350px);
  min-height: 58px;
  margin: 25px auto 0;
  padding: 0 22px;
  border: 1px solid #bbd500;
  border-radius: 22px;
  color: #14150f;
  background: var(--lime);
  box-shadow: 0 12px 24px rgb(72 80 0 / 22%), inset 0 1px rgb(255 255 255 / 52%);
  font-size: 0.95rem;
  font-weight: 760;
  cursor: pointer;
}

.sidebar-add {
  display: none;
}

.primary-add svg {
  width: 25px;
  height: 25px;
  margin-right: 10px;
}

.primary-add:active,
.save-button:active {
  transform: translateY(1px) scale(0.995);
}

.bottom-nav {
  position: sticky;
  z-index: 10;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-height: calc(78px + env(safe-area-inset-bottom));
  padding: 8px 8px env(safe-area-inset-bottom);
  color: #bdbfba;
  background: rgb(17 18 16 / 96%);
  border-top: 1px solid rgb(255 255 255 / 6%);
  backdrop-filter: blur(18px);
}

.nav-item {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 64px;
  padding: 5px;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: 0.69rem;
  cursor: pointer;
}

.nav-item svg {
  width: 24px;
  height: 24px;
}

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

.nav-item.active::after {
  position: absolute;
  bottom: 0;
  width: 34px;
  height: 3px;
  border-radius: 3px;
  background: var(--lime);
  content: "";
}

.settings-group {
  margin-top: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
}

.settings-copy {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}

.settings-icon {
  display: grid;
  flex: 0 0 43px;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 15px;
  color: #5e6e00;
  background: #e6efad;
}

.settings-icon svg {
  width: 23px;
  height: 23px;
}

.settings-group h2 {
  margin: 1px 0 5px;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.settings-group p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.45;
}

.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  margin-top: 17px;
  padding: 0 16px;
  border-radius: 14px;
  font-size: 0.81rem;
  font-weight: 720;
  cursor: pointer;
}

.secondary-button {
  border: 1px solid #cac6bb;
  background: transparent;
}

.secondary-button:disabled {
  cursor: default;
  opacity: 0.58;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.install-hint {
  margin-top: 13px !important;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 0;
}

.danger-button {
  flex: 0 0 auto;
  margin-top: 0;
  border: 1px solid #e0b6ae;
  color: var(--danger);
  background: #f9e5e0;
}

.entry-dialog {
  width: min(100%, 520px);
  max-width: none;
  max-height: min(92dvh, 780px);
  margin: auto auto 0;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 30px 30px 0 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 -25px 80px rgb(0 0 0 / 42%);
}

.entry-dialog[open] {
  animation: slide-dialog 280ms cubic-bezier(.2,.8,.2,1) both;
}

.entry-dialog::backdrop {
  background: rgb(0 0 0 / 62%);
  backdrop-filter: blur(3px);
}

@keyframes slide-dialog {
  from { opacity: 0; transform: translateY(45px); }
  to { opacity: 1; transform: translateY(0); }
}

.entry-dialog form {
  padding: 12px 22px calc(24px + env(safe-area-inset-bottom));
}

.dialog-handle {
  width: 40px;
  height: 4px;
  margin: 0 auto 19px;
  border-radius: 4px;
  background: #c9c5bb;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 21px;
}

.dialog-header p {
  margin: 0 0 4px;
  color: var(--lime-dark);
  font-size: 0.75rem;
  font-weight: 750;
  text-transform: uppercase;
}

.dialog-header h2 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -0.045em;
}

.icon-button {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--paper-deep);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.type-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 19px;
  padding: 4px;
  border: 1px solid #d2cec4;
  border-radius: 16px;
  background: var(--paper-deep);
}

.type-switch legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.type-switch label {
  display: block;
  cursor: pointer;
}

.type-switch input {
  position: absolute;
  opacity: 0;
}

.type-switch span {
  display: grid;
  min-height: 43px;
  place-items: center;
  border-radius: 12px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 710;
}

.type-switch input:checked + span {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 13px rgb(0 0 0 / 8%);
}

.field {
  display: block;
  margin-top: 15px;
}

.field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 700;
}

.field > input,
.field select,
.amount-field > div,
.date-control {
  width: 100%;
  min-height: 51px;
  border: 1px solid #cfcbc0;
  border-radius: 14px;
  color: var(--ink);
  background: #fffcf6;
}

.field > input,
.field select {
  display: block;
  min-width: 0;
  max-width: 100%;
  padding: 0 14px;
  outline: 0;
}

.amount-field > div {
  display: flex;
  align-items: center;
  padding: 0 14px;
}

.amount-field b {
  margin-right: 9px;
  color: var(--ink-soft);
  font-size: 0.91rem;
}

.amount-field input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.date-control {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  overflow: hidden;
}

.date-control input {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 49px;
  padding: 0 46px 0 14px;
  border: 0;
  border-radius: inherit;
  outline: 0;
  color: var(--ink);
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.date-control input::-webkit-date-and-time-value {
  min-width: 0;
  text-align: left;
}

.date-control input::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.date-control svg {
  position: absolute;
  right: 15px;
  width: 19px;
  height: 19px;
  color: var(--lime-dark);
  pointer-events: none;
}

.date-control:has(input:focus-visible) {
  outline: 3px solid rgb(126 151 0 / 38%);
  outline-offset: 3px;
}

.date-control input:focus-visible {
  outline: 0;
}

.field small {
  display: block;
  min-height: 16px;
  margin-top: 4px;
  color: var(--danger);
  font-size: 0.72rem;
}

.save-button {
  width: 100%;
  min-height: 56px;
  margin-top: 22px;
  border: 1px solid #bad500;
  border-radius: 17px;
  color: var(--ink);
  background: var(--lime);
  box-shadow: inset 0 1px rgb(255 255 255 / 55%);
  font-weight: 780;
  cursor: pointer;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 50%;
  bottom: calc(94px + env(safe-area-inset-bottom));
  max-width: min(330px, calc(100% - 34px));
  padding: 12px 17px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 14px;
  color: #fff;
  background: #252622;
  box-shadow: 0 12px 30px rgb(0 0 0 / 30%);
  font-size: 0.82rem;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(50%, 0);
}

@media (max-width: 370px) {
  .app-header,
  .paper {
    padding-right: 17px;
    padding-left: 17px;
  }

  .brand {
    font-size: 2.25rem;
  }

  .month-control {
    width: 167px;
  }

  .month-control span {
    font-size: 0.76rem;
  }

  .flow-summary {
    gap: 9px;
  }

  .flow-icon {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }

  .transaction-list.full .transaction-row {
    grid-template-columns: 38px minmax(0, 1fr) 31px;
  }

  .transaction-list.full .transaction-value {
    grid-column: 2;
  }

  .transaction-list.full .delete-button {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

@media (min-width: 700px) {
  body {
    padding: 24px 0;
  }

  .app-shell {
    min-height: calc(100dvh - 48px);
    border: 1px solid rgb(255 255 255 / 8%);
    border-radius: 34px;
  }

  .bottom-nav {
    border-radius: 0 0 34px 34px;
  }
}

@media (min-width: 900px) {
  :root {
    --sidebar-width: 250px;
  }

  html,
  body {
    background: var(--paper);
  }

  body {
    padding: 0;
  }

  .app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    grid-template-rows: 112px minmax(calc(100dvh - 112px), auto);
    width: 100%;
    min-height: 100dvh;
    margin: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: var(--paper);
    box-shadow: none;
  }

  .app-header {
    position: sticky;
    z-index: 30;
    top: 0;
    grid-column: 1 / -1;
    grid-row: 1;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 112px;
    padding: 0;
    background: linear-gradient(90deg, var(--night) 0 var(--sidebar-width), rgb(246 243 235 / 94%) var(--sidebar-width));
    border-bottom: 1px solid rgb(21 22 19 / 7%);
    backdrop-filter: blur(18px);
  }

  .brand {
    grid-column: 1;
    align-self: center;
    padding-left: 34px;
    font-size: 2.65rem;
  }

  .month-control {
    grid-column: 2;
    justify-self: end;
    width: 205px;
    min-height: 56px;
    margin-right: 42px;
    padding: 0 17px;
    border-color: rgb(255 255 255 / 8%);
    border-radius: 18px;
    background: var(--night);
    box-shadow: 0 12px 28px rgb(0 0 0 / 13%), inset 0 1px rgb(255 255 255 / 8%);
  }

  .month-control span {
    font-size: 0.91rem;
  }

  .bottom-nav {
    position: sticky;
    top: 112px;
    bottom: auto;
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    align-self: start;
    width: var(--sidebar-width);
    height: calc(100dvh - 112px);
    min-height: 600px;
    padding: 18px 18px 30px;
    border: 0;
    border-radius: 0;
    color: #c6c8c2;
    background:
      radial-gradient(circle at 1px 1px, rgb(215 247 15 / 9%) 1px, transparent 1.4px) 0 0 / 13px 13px,
      linear-gradient(165deg, #151613, #090a09 78%);
    backdrop-filter: none;
  }

  .bottom-nav::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 42%;
    background: radial-gradient(circle at 10% 100%, rgb(215 247 15 / 16%), transparent 68%);
    pointer-events: none;
    content: "";
  }

  .nav-item,
  .sidebar-add {
    position: relative;
    z-index: 1;
  }

  .nav-item {
    display: grid;
    grid-template-columns: 31px minmax(0, 1fr);
    justify-items: start;
    align-content: center;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 68px;
    margin-bottom: 9px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 20px;
    font-size: 0.94rem;
    font-weight: 650;
    text-align: left;
  }

  .nav-item svg {
    width: 25px;
    height: 25px;
  }

  .nav-item:hover {
    color: #fff;
    background: rgb(255 255 255 / 5%);
  }

  .nav-item.active {
    color: var(--lime);
    border-color: rgb(255 255 255 / 11%);
    background: linear-gradient(110deg, rgb(255 255 255 / 10%), rgb(255 255 255 / 6%));
    box-shadow: inset 0 1px rgb(255 255 255 / 6%), 0 14px 30px rgb(0 0 0 / 16%);
  }

  .nav-item.active::after {
    top: 16px;
    bottom: 16px;
    left: -18px;
    width: 4px;
    height: auto;
    border-radius: 0 5px 5px 0;
  }

  .sidebar-add {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 61px;
    margin-top: 22px;
    padding: 0 16px;
    border: 1px solid #bfd900;
    border-radius: 19px;
    color: #11120e;
    background: linear-gradient(135deg, #e4ff28, var(--lime));
    box-shadow: 0 17px 36px rgb(97 110 0 / 24%), inset 0 1px rgb(255 255 255 / 62%);
    font-size: 0.87rem;
    font-weight: 760;
    cursor: pointer;
  }

  .sidebar-add:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
  }

  .sidebar-add-icon {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    color: var(--lime);
    background: var(--night);
  }

  .sidebar-add-icon svg {
    width: 20px;
    height: 20px;
  }

  .paper {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    min-height: calc(100dvh - 112px);
    margin: 0;
    padding: 0 34px 42px;
    border-radius: 0;
    background:
      radial-gradient(circle at 70% 0, rgb(255 255 255 / 75%), transparent 33rem),
      linear-gradient(110deg, rgb(255 255 255 / 20%), transparent 48%),
      var(--paper);
    box-shadow: none;
  }

  .paper::before {
    display: none;
  }

  .view {
    width: min(100%, 1280px);
    min-height: 600px;
    margin: 0 auto;
  }

  .view-home {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
    align-items: start;
  }

  .intro-block {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
    grid-template-rows: auto auto auto;
    grid-column: 1 / -1;
    column-gap: 40px;
    min-width: 0;
    padding: 0 16px 30px;
  }

  .intro-title {
    grid-column: 1 / -1;
    margin: 0 0 26px;
    font-size: clamp(1.9rem, 2.6vw, 2.55rem);
    font-weight: 790;
    letter-spacing: -0.055em;
  }

  .balance-label {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    margin-bottom: 6px;
    font-size: 1rem;
  }

  .balance-value {
    grid-column: 1;
    grid-row: 3;
    font-size: clamp(3.9rem, 5.2vw, 5.8rem);
  }

  .flow-summary {
    grid-column: 2;
    grid-row: 2 / 4;
    align-self: end;
    gap: 14px;
    margin: 0 0 8px;
    padding: 0;
  }

  .flow-item {
    gap: 11px;
  }

  .flow-icon {
    flex-basis: 49px;
    width: 49px;
    height: 49px;
  }

  .flow-icon svg {
    width: 25px;
    height: 25px;
  }

  .flow-item span:not(.flow-icon) {
    font-size: 0.9rem;
  }

  .flow-item strong {
    font-size: clamp(0.96rem, 1.15vw, 1.14rem);
  }

  .content-section {
    min-width: 0;
    margin: 0;
    padding: 22px 24px;
    border: 1px solid rgb(132 126 112 / 23%);
    border-radius: 19px;
    background: rgb(255 255 255 / 22%);
    box-shadow: 0 14px 40px rgb(71 63 45 / 4%), inset 0 1px rgb(255 255 255 / 72%);
  }

  .section-heading {
    margin-bottom: 17px;
  }

  .section-heading h2 {
    font-size: 1.18rem;
  }

  .weekly-chart svg {
    height: 230px;
  }

  .chart-wrap {
    min-height: 230px;
  }

  .chart-grid {
    inset: 11px 0 40px;
  }

  .weekly-chart text {
    font-size: 12px;
  }

  .weekly-chart .chart-value {
    fill: var(--ink);
    font-size: 11px;
    font-weight: 760;
  }

  .category-row {
    grid-template-columns: 40px 1fr 40px;
    min-height: 56px;
  }

  .category-icon,
  .category-icon svg {
    width: 38px;
    height: 38px;
  }

  .category-icon svg {
    width: 20px;
    height: 20px;
  }

  .latest-section {
    grid-column: 1 / -1;
  }

  .latest-section .transaction-row {
    min-height: 58px;
  }

  .primary-add {
    display: none;
  }

  .view-title {
    padding: 8px 4px 30px;
  }

  .view-title h1 {
    font-size: clamp(2.8rem, 4.5vw, 4.4rem);
  }

  .view-transactions .transaction-list.full {
    padding: 5px 24px;
    border: 1px solid rgb(132 126 112 / 23%);
    border-radius: 20px;
    background: rgb(255 255 255 / 24%);
    box-shadow: inset 0 1px rgb(255 255 255 / 72%);
  }

  .transaction-list.full .transaction-row {
    min-height: 82px;
  }

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

  .view-settings .view-title,
  .view-settings .danger-zone {
    grid-column: 1 / -1;
  }

  .settings-group {
    margin: 0;
    padding: 25px;
    border: 1px solid rgb(132 126 112 / 23%);
    border-radius: 20px;
    background: rgb(255 255 255 / 24%);
    box-shadow: inset 0 1px rgb(255 255 255 / 72%);
  }

  .danger-zone {
    margin-top: 0;
  }

  .entry-dialog {
    width: min(620px, calc(100% - 48px));
    max-height: min(88dvh, 820px);
    margin: auto;
    border: 1px solid rgb(255 255 255 / 15%);
    border-radius: 28px;
    box-shadow: 0 35px 110px rgb(0 0 0 / 48%);
  }

  .entry-dialog[open] {
    animation-name: enter-dialog-desktop;
  }

  @keyframes enter-dialog-desktop {
    from { opacity: 0; transform: translateY(18px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .entry-dialog form {
    padding: 30px 32px 32px;
  }

  .dialog-handle {
    display: none;
  }

  .toast {
    right: 32px;
    bottom: 30px;
    transform: translateY(12px);
  }

  .toast.visible {
    transform: translateY(0);
  }
}

@media (min-width: 900px) and (max-width: 1199px) {
  .intro-block {
    grid-template-columns: minmax(0, 1fr);
  }

  .intro-title,
  .balance-label,
  .balance-value,
  .flow-summary {
    grid-column: 1;
  }

  .balance-label {
    grid-row: 2;
  }

  .balance-value {
    grid-row: 3;
  }

  .flow-summary {
    grid-row: 4;
    width: min(100%, 520px);
    margin-top: 25px;
  }
}

@media (min-width: 1100px) {
  .view-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  :root {
    --sidebar-width: 276px;
  }

  .brand {
    padding-left: 38px;
  }

  .month-control {
    margin-right: 48px;
  }

  .paper {
    padding-right: 48px;
    padding-left: 48px;
  }

  .view-home {
    grid-template-columns: minmax(0, 1.03fr) minmax(390px, 0.97fr);
  }

  .intro-block {
    grid-template-columns: minmax(0, 0.96fr) minmax(400px, 1.04fr);
  }

  .weekly-section {
    grid-column: 1;
  }

  .category-section {
    grid-column: 2;
  }
}

@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;
  }
}
