:root {
  color-scheme: light dark;
  --bg: #f7f8fc;
  --card: rgba(255, 255, 255, 0.88);
  --card-solid: #ffffff;
  --text: #141824;
  --muted: #7c8497;
  --line: rgba(121, 132, 160, 0.18);
  --accent: #6d5cff;
  --accent-2: #2f7bff;
  --income: #18bf78;
  --expense: #ff5c67;
  --sheet-surface: color-mix(in srgb, var(--card-solid), transparent 3%);
  --sheet-row: color-mix(in srgb, var(--card-solid), transparent 8%);
  --sheet-backdrop: rgba(6, 10, 20, 0.34);
  --shadow: 0 18px 48px rgba(34, 42, 78, 0.14);
  --soft-shadow: 0 10px 28px rgba(34, 42, 78, 0.09);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --motion-duration-fast: 180ms;
  --motion-duration: 220ms;
  --motion-duration-slow: 280ms;
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-spring: cubic-bezier(0.34, 1.24, 0.44, 1);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 85% -10%, rgba(109, 92, 255, 0.20), transparent 32%),
    linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--bg), #ffffff 26%));
}

body.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

body.modal-open .selector-sheet,
body.modal-open .right-menu-panel,
body.modal-open .report-period-sheet,
body.modal-open .date-picker-sheet,
body.modal-open .operation-sheet,
body.modal-open .operation-category-sheet,
body.modal-open .category-sheet {
  touch-action: pan-y;
}

.pull-refresh-indicator {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  z-index: 35;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--card-solid), transparent 8%);
  box-shadow: var(--soft-shadow);
  opacity: var(--pull-progress, 0);
  pointer-events: none;
  transform: translate(-50%, calc(-54px + var(--pull-distance, 0px)));
  transition:
    opacity var(--motion-duration-fast) var(--motion-ease),
    transform var(--motion-duration-fast) var(--motion-ease);
  backdrop-filter: blur(18px);
}

.pull-refresh-indicator.is-visible {
  will-change: transform, opacity;
}

.pull-refresh-indicator span {
  width: 16px;
  height: 16px;
  border: 2px solid color-mix(in srgb, var(--accent), transparent 70%);
  border-top-color: var(--accent);
  border-radius: 50%;
  transform: rotate(var(--pull-rotation, 0deg));
}

.pull-refresh-indicator.is-ready span,
.pull-refresh-indicator.is-refreshing span {
  border-color: color-mix(in srgb, var(--accent), transparent 50%);
  border-top-color: var(--accent);
}

.pull-refresh-indicator.is-refreshing span {
  animation: pull-refresh-spin 0.72s linear infinite;
}

button {
  font: inherit;
}

.app-shell {
  position: relative;
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px calc(112px + env(safe-area-inset-bottom));
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
}

.telegram-only-mode .app-shell {
  display: grid;
  width: min(100%, 460px);
  min-height: 100vh;
  padding: max(22px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
  place-items: center;
}

.telegram-only-screen {
  display: grid;
  width: 100%;
  min-height: min(680px, calc(100vh - 44px));
  place-items: center;
}

.telegram-only-card {
  display: grid;
  width: min(100%, 380px);
  gap: 24px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(18px);
}

.telegram-only-logo {
  display: flex;
  justify-content: center;
}

.telegram-only-logo .brand-logo {
  max-width: 150px;
  max-height: 52px;
}

.telegram-only-copy {
  display: grid;
  gap: 10px;
}

.telegram-only-copy h1 {
  font-size: 28px;
  line-height: 1.08;
  font-weight: 850;
  letter-spacing: 0;
}

.telegram-only-copy p {
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.45;
}

.telegram-only-button {
  display: grid;
  min-height: 54px;
  place-items: center;
  border-radius: 18px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 32px color-mix(in srgb, var(--accent), transparent 72%);
  font-size: 15px;
  font-weight: 850;
  text-decoration: none;
}

.telegram-only-button:active {
  transform: scale(0.985);
}

.telegram-only-mode .bottom-nav {
  display: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 18px;
}

h1,
h2,
p {
  margin: 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 42px;
}

.brand-logo {
  display: block;
  width: auto;
  max-width: min(150px, calc(100vw - 112px));
  height: auto;
  max-height: 48px;
  object-fit: contain;
}

.brand-wordmark {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-size: 34px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: 0;
}

.brand-wordmark[hidden],
.brand-logo[hidden] {
  display: none;
}

.menu-button {
  transform: translateY(-4px);
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: var(--card);
  box-shadow: var(--soft-shadow);
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
}

.active-budget-card,
.hero-card,
.metric-card,
.panel {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.active-budget-card {
  display: block;
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 178px;
  padding: 22px;
  border-radius: var(--radius-xl);
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(47, 123, 255, 0.96), rgba(137, 55, 255, 0.98)),
    var(--accent);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -18% -36% 18%;
  height: 150px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  filter: blur(20px);
}

.card-label {
  font-size: 12px;
  font-weight: 750;
  color: var(--muted);
}

.balance-label {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.76);
}

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

.budget-row h2 {
  min-width: 0;
  overflow: hidden;
  font-size: 18px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.budget-chevron {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}

.balance {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  font-size: 40px;
  line-height: 1;
  font-weight: 850;
}

.sync-text {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 700;
}

.budgets-screen {
  padding-bottom: 10px;
}

.budgets-title {
  display: grid;
  gap: 8px;
  margin: 8px 0 18px;
}

.budgets-title h1 {
  font-size: 38px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
}

.budgets-title p {
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
}

.budgets-hero-card {
  position: relative;
  display: grid;
  gap: 20px;
  min-height: 244px;
  margin-bottom: 24px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 28%);
  border-radius: 28px;
  color: #ffffff;
  background:
    radial-gradient(circle at 86% 34%, rgba(111, 90, 255, 0.40), transparent 24%),
    linear-gradient(135deg, rgba(111, 90, 255, 0.86), rgba(22, 27, 58, 0.92) 58%, rgba(16, 22, 38, 0.94));
  box-shadow: 0 22px 48px rgba(72, 55, 202, 0.22);
  backdrop-filter: blur(20px);
  cursor: pointer;
}

.budgets-hero-card:active {
  transform: scale(0.99);
}

body.tg-light .budgets-hero-card {
  background:
    radial-gradient(circle at 86% 34%, rgba(111, 90, 255, 0.30), transparent 24%),
    linear-gradient(135deg, rgba(111, 90, 255, 0.88), rgba(52, 62, 124, 0.90));
}

.budgets-hero-top,
.budgets-hero-main,
.budgets-hero-stats {
  position: relative;
  z-index: 1;
}

.budgets-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.budgets-hero-top span,
.budgets-hero-top strong {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.budgets-hero-top strong {
  color: #39e493;
  background: rgba(34, 197, 94, 0.16);
  text-transform: none;
}

.budgets-hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  align-items: center;
  gap: 10px;
}

.budgets-hero-main h2 {
  overflow: hidden;
  max-width: 100%;
  margin-bottom: 28px;
  font-size: 28px;
  line-height: 1.08;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.budgets-hero-main p,
.budgets-hero-stats span {
  color: rgba(255, 255, 255, 0.70);
  font-size: 14px;
  font-weight: 700;
}

.budgets-hero-main b {
  display: block;
  margin-top: 6px;
  font-size: 36px;
  line-height: 1;
  font-weight: 900;
}

.budgets-wallet {
  position: relative;
  width: 132px;
  height: 104px;
  border-radius: 22px 28px 28px 20px;
  background:
    linear-gradient(150deg, rgba(132, 99, 255, 0.95), rgba(47, 36, 126, 0.98));
  box-shadow: inset 0 13px 20px rgba(255, 255, 255, 0.15), 0 20px 36px rgba(0, 0, 0, 0.20);
  transform: perspective(220px) rotateY(-10deg) rotateZ(-4deg);
}

.budgets-wallet::before {
  content: "";
  position: absolute;
  inset: 20px 12px auto -14px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px 18px 6px 18px;
  background: linear-gradient(135deg, rgba(126, 105, 255, 0.95), rgba(77, 54, 206, 0.80));
  transform: rotate(-8deg);
}

.budgets-wallet::after {
  content: "";
  position: absolute;
  right: 15px;
  bottom: 28px;
  width: 34px;
  height: 20px;
  border-radius: 9px;
  background: rgba(8, 10, 27, 0.44);
  box-shadow: inset 11px 0 0 rgba(255, 255, 255, 0.08);
}

.budgets-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.budgets-hero-stats div + div {
  padding-left: 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.budgets-hero-stats strong {
  display: block;
  margin-top: 8px;
  font-size: 21px;
  line-height: 1;
  font-weight: 900;
}

.budgets-hero-stats .income {
  color: #31e08a;
}

.budgets-hero-stats .expense {
  color: #ff6b72;
}

.budgets-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.budgets-section-head h2 {
  font-size: 21px;
  line-height: 1.1;
  font-weight: 900;
}

.budgets-section-head span {
  display: grid;
  min-width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 16px;
  color: var(--text);
  background: color-mix(in srgb, var(--card-solid), transparent 5%);
  font-size: 13px;
  font-weight: 850;
  box-shadow: var(--soft-shadow);
}

.budgets-list {
  display: grid;
  gap: 10px;
}

.budget-list-card {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 18px;
  grid-template-areas:
    "icon main chevron"
    "icon balance chevron";
  align-items: center;
  gap: 10px 14px;
  width: 100%;
  min-height: 122px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--text);
  background: color-mix(in srgb, var(--card), transparent 7%);
  box-shadow: var(--soft-shadow);
  text-align: left;
  backdrop-filter: blur(18px);
  cursor: pointer;
}

.budget-list-card.is-active {
  border-color: color-mix(in srgb, var(--accent), transparent 32%);
  box-shadow: 0 16px 38px color-mix(in srgb, var(--accent), transparent 82%);
}

.budget-list-icon {
  grid-area: icon;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 18px;
  color: #ffffff;
  background: linear-gradient(135deg, #7a6aff, #332c86);
  box-shadow: inset 0 12px 20px rgba(255, 255, 255, 0.12);
  font-size: 24px;
  font-weight: 900;
}

.budget-list-card:nth-child(2n) .budget-list-icon {
  background: linear-gradient(135deg, #23c987, #174f3d);
}

.budget-list-card:nth-child(3n) .budget-list-icon {
  background: linear-gradient(135deg, #ffb057, #8a3900);
}

.budget-list-main {
  grid-area: main;
  display: grid;
  min-width: 0;
  gap: 8px;
}

.budget-list-title {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.budget-list-title strong {
  overflow: hidden;
  min-width: 0;
  font-size: 17px;
  line-height: 1.12;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.budget-list-title i {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  justify-self: start;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 82%);
  border-radius: 999px;
  color: color-mix(in srgb, var(--accent), var(--text) 24%);
  background: color-mix(in srgb, var(--accent), transparent 92%);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.budget-list-main small {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: normal;
}

.budget-income-remaining {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  color: color-mix(in srgb, var(--income), white 8%);
  background: color-mix(in srgb, var(--income), transparent 88%);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.15;
}

.budget-income-remaining.negative {
  color: var(--expense);
  background: color-mix(in srgb, var(--expense), transparent 88%);
}

.budget-income-remaining.neutral {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted), transparent 90%);
}

.budget-list-balance {
  grid-area: balance;
  display: grid;
  justify-items: start;
  gap: 4px;
  min-width: 0;
}

.budget-list-balance strong {
  color: var(--income);
  font-size: 17px;
  line-height: 1.1;
  font-weight: 900;
  white-space: nowrap;
}

.budget-list-balance.negative strong {
  color: var(--expense);
}

.budget-list-balance small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.budget-active-check {
  display: none;
  grid-area: check;
  width: 0;
  height: 0;
}

.budget-active-check:not([hidden]) {
  display: grid;
  position: absolute;
  top: 12px;
  right: 36px;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 14px;
  color: #0f1020;
  background: linear-gradient(135deg, #8d7cff, #4a3dff);
  font-size: 15px;
  font-weight: 950;
}

.budget-active-check[hidden] {
  display: none;
}

.budget-card-chevron {
  grid-area: chevron;
  color: var(--muted);
  font-size: 26px;
  font-style: normal;
  font-weight: 700;
}

.budgets-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0 16px;
}

.budget-action-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--text);
  background: color-mix(in srgb, var(--card), transparent 7%);
  box-shadow: var(--soft-shadow);
  text-align: left;
  backdrop-filter: blur(18px);
}

.budget-action-card.primary {
  border: 0;
  color: #ffffff;
  background: linear-gradient(135deg, #5147ff, #8e72ff);
  box-shadow: 0 18px 36px color-mix(in srgb, var(--accent), transparent 72%);
}

.budget-action-card span {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 19px;
  color: inherit;
  background: rgba(255, 255, 255, 0.16);
  font-size: 28px;
  font-weight: 600;
}

.budget-action-card:not(.primary) span {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  font-size: 22px;
}

.budget-action-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.15;
  font-weight: 900;
}

.budgets-empty-card {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--card), transparent 7%);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
}

.budgets-empty-card[hidden] {
  display: none;
}

.budgets-empty-icon {
  width: 62px;
  height: 50px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 24% 16%, #ffffff 0 3px, transparent 4px),
    linear-gradient(135deg, #7968ff, #3423bd);
  box-shadow: inset 0 10px 18px rgba(255, 255, 255, 0.18), 0 14px 26px color-mix(in srgb, var(--accent), transparent 74%);
}

.budgets-empty-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
  line-height: 1.12;
  font-weight: 900;
}

.budgets-empty-card p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}

.budgets-empty-card button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 30%);
  border-radius: 16px;
  color: var(--accent);
  background: transparent;
  font-size: 14px;
  font-weight: 900;
}

.budget-create-sheet {
  display: grid;
  gap: 18px;
}

.budget-name-field {
  display: grid;
  gap: 8px;
}

.budget-name-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.budget-name-field input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--text);
  background: var(--sheet-row);
  font-size: 16px;
  font-weight: 780;
  outline: 0;
}

.budget-name-field input:focus {
  border-color: color-mix(in srgb, var(--accent), transparent 28%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 86%);
}

.budget-type-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--muted), transparent 88%);
}

.budget-type-button {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 850;
}

.budget-type-button.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 24px color-mix(in srgb, var(--accent), transparent 76%);
}

.limits-title {
  margin: 8px 0 18px;
}

.limits-title h1 {
  font-size: 38px;
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: 0;
}

.limits-title p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 650;
}

.limits-overview-card {
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 42%);
  border-radius: 20px;
  background:
    radial-gradient(circle at 22% 8%, color-mix(in srgb, var(--accent), transparent 72%), transparent 36%),
    linear-gradient(145deg, color-mix(in srgb, var(--card-solid), var(--accent) 10%), color-mix(in srgb, var(--card-solid), transparent 2%));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.limits-overview-title {
  color: color-mix(in srgb, var(--text), transparent 10%);
  font-size: 15px;
  font-weight: 820;
}

.limits-overview-content {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 18px;
}

.limits-ring {
  display: grid;
  width: 132px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--card-solid) 0 54%, transparent 55%),
    conic-gradient(var(--accent) var(--limit-progress), color-mix(in srgb, var(--accent), transparent 82%) 0);
  box-shadow: inset 0 0 26px color-mix(in srgb, var(--accent), transparent 78%), 0 16px 36px color-mix(in srgb, var(--accent), transparent 78%);
}

.limits-ring div {
  display: grid;
  place-items: center;
}

.limits-ring strong {
  font-size: 31px;
  line-height: 1;
  font-weight: 900;
}

.limits-ring span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.limits-overview-stats {
  display: grid;
  gap: 13px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.limits-overview-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.limits-overview-stats strong {
  display: block;
  margin-top: 3px;
  font-size: 20px;
  line-height: 1.12;
  font-weight: 900;
}

.limits-overview-stats strong.income {
  color: var(--income);
}

.limits-overview-stats strong.expense {
  color: var(--expense);
}

.limits-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 12px;
}

.limits-section-head h2 {
  font-size: 18px;
  line-height: 1.15;
  font-weight: 900;
}

.limits-add-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 26px color-mix(in srgb, var(--accent), transparent 72%);
  cursor: pointer;
}

.limits-add-button span {
  font-size: 20px;
  line-height: 1;
}

.limits-add-button strong {
  font-size: 13px;
  font-weight: 880;
}

.limits-list {
  display: grid;
  gap: 10px;
}

.limit-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 116px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  background: color-mix(in srgb, var(--card), transparent 5%);
  box-shadow: var(--soft-shadow);
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(18px);
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.limit-card:active {
  transform: scale(0.985);
}

.limit-card-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-2), #000000 10%));
  box-shadow: inset 0 10px 18px rgba(255, 255, 255, 0.16);
  font-size: 22px;
  font-weight: 900;
}

.limit-card.status-near .limit-card-icon {
  background: linear-gradient(135deg, #f5a524, #9a5b09);
}

.limit-card.status-exceeded .limit-card-icon {
  background: linear-gradient(135deg, #ff5c67, #992432);
}

.limit-card-content {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.limit-card-top,
.limit-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 10px;
}

.limit-card-title {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.limit-card-title strong {
  overflow: hidden;
  font-size: 16px;
  line-height: 1.12;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.limit-card-title small,
.limit-card-meta small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 730;
}

.limit-status-badge {
  flex: 0 0 auto;
  max-width: 128px;
  overflow: hidden;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--income);
  background: color-mix(in srgb, var(--income), transparent 84%);
  font-size: 12px;
  line-height: 1.1;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.limit-card.status-near .limit-status-badge {
  color: #d28412;
  background: color-mix(in srgb, #f5a524, transparent 84%);
}

.limit-card.status-exceeded .limit-status-badge {
  color: var(--expense);
  background: color-mix(in srgb, var(--expense), transparent 84%);
}

.limit-card-amount {
  justify-self: end;
  font-size: 16px;
  font-weight: 880;
}

.limit-progress {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted), transparent 90%);
}

.limit-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--income);
}

.limit-card.status-near .limit-progress span {
  background: #f5a524;
}

.limit-card.status-exceeded .limit-progress span {
  background: var(--expense);
}

.limit-card-chevron {
  color: var(--muted);
  font-size: 26px;
  font-style: normal;
  line-height: 1;
}

.limits-empty-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--card), transparent 7%);
  box-shadow: var(--soft-shadow);
}

.limits-empty-card[hidden] {
  display: none;
}

.limits-empty-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 18px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 24px;
  font-weight: 900;
}

.limits-empty-card strong {
  display: block;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 900;
}

.limits-empty-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 650;
}

.limits-empty-card button {
  grid-column: 1 / -1;
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 14px;
  font-weight: 880;
}

.sparkline-chart {
  position: absolute;
  right: 20px;
  bottom: 24px;
  z-index: 1;
  width: 132px;
  height: 62px;
  overflow: visible;
  color: rgba(255, 255, 255, 0.72);
}

.sparkline-line {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  filter: drop-shadow(0 7px 12px rgba(0, 0, 0, 0.18));
}

.sparkline-fill {
  fill: currentColor;
  opacity: 0.14;
}

.sparkline-dot {
  fill: #ffffff;
  stroke: currentColor;
  stroke-width: 2;
}

.sparkline-chart.positive {
  color: #40e29a;
}

.sparkline-chart.negative {
  color: #ff8a92;
}

.sparkline-chart.neutral {
  color: rgba(255, 255, 255, 0.72);
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.metric-card {
  min-height: 126px;
  padding: 16px;
  border-radius: var(--radius-lg);
}

.metric-button {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.metric-button:active {
  transform: scale(0.985);
}

.metric-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent), transparent 25%);
  outline-offset: 3px;
}

.metric-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 12px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
}

.metric-icon.income {
  background: var(--income);
}

.metric-icon.expense {
  background: var(--expense);
}

.metric-card p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.metric-card strong {
  display: block;
  margin-top: 5px;
  font-size: 21px;
}

.delta {
  display: inline-flex;
  width: fit-content;
  margin-top: 9px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.delta.positive {
  color: var(--income);
  background: color-mix(in srgb, var(--income), transparent 88%);
}

.delta.negative {
  color: var(--expense);
  background: color-mix(in srgb, var(--expense), transparent 88%);
}

.delta.neutral {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted), transparent 90%);
}

.delta-caption {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.panel {
  margin-top: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.section-heading h2 {
  font-size: 18px;
  font-weight: 800;
}

.section-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.operations-list {
  display: grid;
  gap: 10px;
}

.operation {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--card-solid), transparent 8%);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.operation:active {
  transform: scale(0.985);
}

.operation:focus-visible,
.active-budget-card:focus-visible,
.budgets-hero-card:focus-visible,
.selector-option:focus-visible,
.right-menu-close:focus-visible,
.right-menu-item:focus-visible,
.limits-add-button:focus-visible,
.limit-card:focus-visible,
.sheet-close:focus-visible,
.sheet-primary-button:focus-visible,
.operation-sheet-close:focus-visible,
.operation-type-button:focus-visible,
.operation-form-row:focus-visible,
.operation-save-button:focus-visible,
.operation-category-option:focus-visible,
.limit-period-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent), transparent 25%);
  outline-offset: 3px;
}

.operation-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  color: currentColor;
}

.operation-icon.income {
  color: var(--income);
  background: color-mix(in srgb, var(--income), transparent 86%);
}

.operation-icon.expense {
  color: var(--expense);
  background: color-mix(in srgb, var(--expense), transparent 86%);
}

.operation-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.operation-title {
  display: grid;
  justify-items: start;
  min-width: 0;
}

.operation-title strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  margin-top: 6px;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 82%);
  border-radius: 999px;
  color: color-mix(in srgb, var(--accent), var(--text) 24%);
  background: color-mix(in srgb, var(--accent), transparent 92%);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
  text-align: left;
  word-break: break-word;
}

.operation-date {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.operation-amount {
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
}

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

.operation-amount.expense {
  color: var(--expense);
}

.empty-state {
  padding: 22px 10px 12px;
  text-align: center;
}

.empty-state strong {
  display: block;
  font-size: 16px;
}

.empty-state p {
  width: min(260px, 100%);
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.actions-grid button {
  display: grid;
  min-height: 86px;
  place-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--text);
  background: color-mix(in srgb, var(--card-solid), transparent 10%);
  box-shadow: var(--soft-shadow);
  font-size: 13px;
  font-weight: 750;
}

.actions-grid b {
  font: inherit;
}

.actions-grid span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 18px;
}

.analytics-screen {
  padding-top: 6px;
}

.detail-bar {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}

.detail-bar h1 {
  overflow: hidden;
  font-size: 24px;
  line-height: 1.12;
  font-weight: 850;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-subtitle {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 720;
  line-height: 1.35;
}

.analytics-month-controls {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  gap: 18px;
  align-items: center;
  margin: 0 0 14px;
}

.analytics-month-controls[hidden],
.analytics-period-button[hidden],
.analytics-subtitle[hidden] {
  display: none;
}

body.analytics-expanded-mode #analyticsHero,
body.analytics-expanded-mode #analyticsPeriodButton,
body.analytics-expanded-mode #analyticsMonthControls {
  display: none !important;
}

.analytics-month-arrow {
  display: grid;
  min-height: 62px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--accent);
  background: color-mix(in srgb, var(--card-solid), transparent 8%);
  box-shadow: var(--soft-shadow);
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
}

.analytics-month-label {
  display: grid;
  min-height: 62px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--card-solid), transparent 10%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.analytics-month-label strong {
  overflow: hidden;
  max-width: 100%;
  padding: 0 12px;
  font-size: 18px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-period-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: fit-content;
  min-height: 58px;
  margin: 10px auto 22px;
  padding: 0 24px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 30%);
  border-radius: 19px;
  color: color-mix(in srgb, var(--accent), #ffffff 15%);
  background: color-mix(in srgb, var(--accent), transparent 88%);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--accent), transparent 86%);
  font-weight: 850;
}

.back-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: var(--card);
  box-shadow: var(--soft-shadow);
  font-size: 22px;
  font-weight: 850;
}

.back-button:active {
  transform: scale(0.97);
}

.analytics-hero {
  position: relative;
  display: grid;
  gap: 18px;
  overflow: hidden;
  min-height: 216px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  color: #ffffff;
  box-shadow: var(--shadow);
}

.analytics-hero.income {
  background:
    radial-gradient(circle at 88% 12%, rgba(113, 255, 167, 0.38), transparent 28%),
    linear-gradient(135deg, rgba(9, 82, 54, 0.96), rgba(20, 165, 96, 0.86));
}

.analytics-hero.expense {
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 151, 126, 0.34), transparent 28%),
    linear-gradient(135deg, rgba(91, 20, 34, 0.96), rgba(226, 71, 83, 0.84));
}

.analytics-hero::after {
  content: "";
  position: absolute;
  inset: auto -18% -32% 12%;
  height: 170px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  filter: blur(22px);
}

.analytics-hero-copy,
.analytics-hero-stats,
.analytics-sparkline {
  position: relative;
  z-index: 1;
}

.analytics-hero-copy {
  display: grid;
  gap: 8px;
  padding-right: 136px;
}

.analytics-hero-copy span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  font-weight: 760;
}

.analytics-hero-copy strong {
  overflow-wrap: anywhere;
  font-size: 34px;
  line-height: 1.02;
  font-weight: 850;
}

.analytics-trend {
  width: fit-content;
  font-size: 14px;
  font-weight: 850;
}

.analytics-trend.positive {
  color: #62f29c;
}

.analytics-trend.negative {
  color: #ff9aa1;
}

.analytics-trend.neutral {
  color: rgba(255, 255, 255, 0.74);
}

.analytics-sparkline {
  position: absolute;
  right: 18px;
  top: 54px;
  width: 150px;
  height: 72px;
  overflow: visible;
  color: currentColor;
}

.analytics-sparkline-line {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.4;
  filter: drop-shadow(0 7px 14px rgba(0, 0, 0, 0.18));
}

.analytics-sparkline-fill {
  fill: currentColor;
  opacity: 0.12;
}

.analytics-sparkline-dot {
  fill: #ffffff;
  stroke: currentColor;
  stroke-width: 2.2;
}

.analytics-hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.analytics-hero-stats article {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.hero-stat-icon {
  display: grid;
  grid-row: span 2;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-size: 18px;
  font-weight: 850;
}

.analytics-hero-stats p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 720;
  line-height: 1.25;
}

.analytics-hero-stats strong {
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 850;
}

.analytics-panel {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.analytics-category-layout {
  display: grid;
  gap: 12px;
}

.analytics-category-layout.has-donut {
  grid-template-columns: 116px 1fr;
  align-items: center;
}

.analytics-category-layout.has-expanded-donut {
  justify-items: center;
}

.category-chart-area {
  display: grid;
  width: 116px;
  height: 116px;
  place-items: center;
}

.has-expanded-donut .category-chart-area {
  width: 100%;
  height: auto;
  margin: 0 auto 20px;
}

.expanded-expense-period {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(100%, 320px);
  margin: 0 auto 6px;
}

.expanded-expense-period.is-custom-period {
  gap: 6px;
}

.expanded-expense-period-controls {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
}

.expanded-expense-period-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 6px;
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.1;
  text-align: center;
}

.expanded-expense-period-label:active {
  opacity: 0.72;
}

.expanded-expense-period-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--muted), transparent 55%);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--card-solid), transparent 12%);
  font-size: 12px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
}

.expanded-expense-period-reset:active {
  opacity: 0.72;
}

.expanded-expense-donut-row.is-custom-period {
  grid-template-columns: minmax(0, 1fr);
}

.expanded-expense-donut-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.expanded-expense-donut-arrow {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: color-mix(in srgb, var(--muted), var(--text) 18%);
  background: transparent;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  opacity: 0.42;
}

.expanded-expense-donut-arrow:active {
  opacity: 0.72;
}

.expanded-expense-donut-wrap {
  width: min(74vw, 272px);
  margin: 0 auto;
}

.expanded-expense-donut {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  box-shadow: 0 24px 54px color-mix(in srgb, var(--accent), transparent 82%);
}

.expanded-expense-donut::before {
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent), transparent 80%), transparent 68%);
  content: "";
  filter: blur(12px);
  z-index: -1;
}

.expanded-expense-donut-center {
  display: grid;
  width: 58%;
  max-width: 58%;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg), #020617 16%);
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.24);
  text-align: center;
}

.expanded-expense-donut-center span {
  align-self: end;
  max-width: 100%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.expanded-expense-donut-center strong {
  display: block;
  align-self: start;
  width: 100%;
  max-width: 100%;
  margin-top: 8px;
  padding: 0 8px;
  overflow: hidden;
  box-sizing: border-box;
  font-size: clamp(16px, 5vw, 34px);
  line-height: 1.02;
  font-weight: 900;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.category-chart-area[hidden] {
  display: none;
}

.donut-chart {
  width: 116px;
  height: 116px;
  overflow: visible;
  transform: rotate(-90deg);
}

.donut-track,
.donut-segment {
  fill: none;
  stroke-linecap: butt;
  stroke-width: 18;
}

.donut-track {
  stroke: color-mix(in srgb, var(--muted), transparent 84%);
}

.donut-segment {
  transition: stroke-dasharray 0.22s ease;
}

.category-list {
  display: grid;
  gap: 13px;
}

.category-item {
  display: grid;
  gap: 8px;
}

.category-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.category-item strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 830;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
}

.category-progress {
  overflow: hidden;
  height: 7px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--muted), transparent 88%);
}

.category-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--category-color);
}

.expanded-expense-panel {
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.expanded-expense-panel .section-heading {
  display: none;
}

.expanded-expense-panel .category-list {
  width: 100%;
  overflow: hidden;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--card-solid), transparent 8%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.expanded-category-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 48px auto;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.expanded-category-item:active {
  background: color-mix(in srgb, var(--accent), transparent 94%);
}

body.analytics-category-operations-mode #analyticsCategoriesPanel,
body.analytics-category-operations-mode .expanded-expense-period,
body.analytics-category-operations-mode .expanded-expense-donut-row,
body.analytics-category-operations-mode #analyticsHero,
body.analytics-category-operations-mode #analyticsMonthControls,
body.analytics-category-operations-mode #analyticsPeriodButton {
  display: none !important;
}

body.analytics-category-operations-mode #analyticsOperationsPanel {
  display: block;
}

body.analytics-category-operations-mode #analyticsSubtitle {
  display: none !important;
}

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

.expanded-category-marker {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--category-color);
  box-shadow: 0 12px 22px color-mix(in srgb, var(--category-color), transparent 68%);
}

.expanded-category-copy {
  display: grid;
  min-width: 0;
  gap: 9px;
}

.expanded-category-copy strong {
  overflow: hidden;
  font-size: 16px;
  font-weight: 870;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expanded-category-copy i,
.expanded-category-progress {
  display: block;
  width: 100%;
  max-width: 178px;
  height: 7px;
  border-radius: 99px;
  background: var(--category-color);
}

.expanded-category-item b {
  color: var(--category-color);
  font-size: 14px;
  font-weight: 850;
  text-align: right;
}

.expanded-category-item em {
  color: var(--text);
  font-size: 15px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.empty-state.compact {
  padding: 10px 0 2px;
}

.report-screen {
  padding-top: 6px;
  color: var(--text);
}

.report-screen.is-active,
.report-screen.is-entering,
.report-screen.is-leaving {
  display: block;
}

.is-report-capturing *,
.is-report-capturing *::before,
.is-report-capturing *::after {
  animation: none !important;
  transition: none !important;
}

body.is-report-capturing .bottom-nav,
body.is-report-capturing .pull-refresh-indicator,
body.is-report-capturing .report-share-button {
  visibility: hidden !important;
  pointer-events: none !important;
}

body.is-report-capturing {
  background: #f7f8fc !important;
  --sheet-surface: #ffffff;
  --sheet-row: rgba(255, 255, 255, 0.92);
}

body.is-report-capturing.tg-dark,
body.tg-dark.is-report-capturing {
  background: #0d1118 !important;
  --sheet-surface: #151a22;
  --sheet-row: rgba(21, 26, 34, 0.93);
}

body.is-report-capturing .report-screen {
  overflow: visible;
  background: #f7f8fc;
  --card: rgba(255, 255, 255, 0.95);
  --card-solid: #ffffff;
  --sheet-surface: #ffffff;
  --sheet-row: rgba(255, 255, 255, 0.92);
  --line: rgba(121, 132, 160, 0.18);
  --shadow: 0 18px 48px rgba(34, 42, 78, 0.14);
  --soft-shadow: 0 10px 28px rgba(34, 42, 78, 0.09);
}

body.is-report-capturing .report-screen,
body.is-report-capturing .report-screen * {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.is-report-capturing .report-screen .report-metric-card,
body.is-report-capturing .report-screen .report-panel,
body.is-report-capturing .report-screen .report-back-button,
body.is-report-capturing .report-screen .report-share-button,
body.is-report-capturing .report-screen .report-period-badge {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(121, 132, 160, 0.18) !important;
  box-shadow: 0 10px 28px rgba(34, 42, 78, 0.09) !important;
}

body.is-report-capturing .report-screen .report-insight-card.good {
  background: linear-gradient(145deg, rgba(24, 191, 120, 0.16), rgba(255, 255, 255, 0.95)) !important;
}

body.is-report-capturing .report-screen .report-insight-card.attention {
  background: linear-gradient(145deg, rgba(255, 196, 92, 0.18), rgba(255, 255, 255, 0.95)) !important;
}

body.is-report-capturing .report-screen .report-insight-card.recommendation {
  background: linear-gradient(145deg, rgba(109, 92, 255, 0.18), rgba(255, 255, 255, 0.95)) !important;
}

body.is-report-capturing .report-screen .report-insight-card.good h2 span {
  background: rgba(69, 222, 143, 0.12) !important;
}

body.is-report-capturing .report-screen .report-insight-card.attention h2 span {
  background: rgba(255, 196, 92, 0.12) !important;
}

body.is-report-capturing .report-screen .report-insight-card.recommendation h2 span {
  background: rgba(192, 132, 255, 0.12) !important;
}

body.is-report-capturing .report-screen .report-insight-card p {
  color: rgba(20, 24, 36, 0.88) !important;
}

body.is-report-capturing .report-screen .report-donut-track {
  stroke: rgba(124, 132, 151, 0.14) !important;
}

body.is-report-capturing .report-screen .report-trend-grid {
  stroke: rgba(124, 132, 151, 0.12) !important;
}

body.is-report-capturing .report-screen .report-empty.trend {
  background: rgba(255, 255, 255, 0.82) !important;
}

body.tg-dark.is-report-capturing .report-screen,
body.is-report-capturing.tg-dark .report-screen {
  background: #0d1118;
  --card: rgba(24, 29, 38, 0.95);
  --card-solid: #151a22;
  --sheet-surface: #151a22;
  --sheet-row: rgba(21, 26, 34, 0.93);
  --line: rgba(221, 230, 255, 0.1);
  --shadow: 0 18px 52px rgba(0, 0, 0, 0.34);
  --soft-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

body.tg-dark.is-report-capturing .report-screen .report-metric-card,
body.tg-dark.is-report-capturing .report-screen .report-panel,
body.tg-dark.is-report-capturing .report-screen .report-back-button,
body.tg-dark.is-report-capturing .report-screen .report-share-button,
body.tg-dark.is-report-capturing .report-screen .report-period-badge,
body.is-report-capturing.tg-dark .report-screen .report-metric-card,
body.is-report-capturing.tg-dark .report-screen .report-panel,
body.is-report-capturing.tg-dark .report-screen .report-back-button,
body.is-report-capturing.tg-dark .report-screen .report-share-button,
body.is-report-capturing.tg-dark .report-screen .report-period-badge {
  background: rgba(24, 29, 38, 0.95) !important;
  border-color: rgba(221, 230, 255, 0.1) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22) !important;
}

body.tg-dark.is-report-capturing .report-screen .report-insight-card.good,
body.is-report-capturing.tg-dark .report-screen .report-insight-card.good {
  background: linear-gradient(145deg, rgba(24, 191, 120, 0.16), rgba(24, 29, 38, 0.95)) !important;
}

body.tg-dark.is-report-capturing .report-screen .report-insight-card.attention,
body.is-report-capturing.tg-dark .report-screen .report-insight-card.attention {
  background: linear-gradient(145deg, rgba(255, 196, 92, 0.18), rgba(24, 29, 38, 0.95)) !important;
}

body.tg-dark.is-report-capturing .report-screen .report-insight-card.recommendation,
body.is-report-capturing.tg-dark .report-screen .report-insight-card.recommendation {
  background: linear-gradient(145deg, rgba(109, 92, 255, 0.18), rgba(24, 29, 38, 0.95)) !important;
}

body.tg-dark.is-report-capturing .report-screen .report-insight-card p,
body.is-report-capturing.tg-dark .report-screen .report-insight-card p {
  color: rgba(244, 247, 251, 0.88) !important;
}

body.tg-dark.is-report-capturing .report-screen .report-donut-track,
body.is-report-capturing.tg-dark .report-screen .report-donut-track {
  stroke: rgba(142, 152, 170, 0.14) !important;
}

body.tg-dark.is-report-capturing .report-screen .report-trend-grid,
body.is-report-capturing.tg-dark .report-screen .report-trend-grid {
  stroke: rgba(142, 152, 170, 0.12) !important;
}

body.tg-dark.is-report-capturing .report-screen .report-empty.trend,
body.is-report-capturing.tg-dark .report-screen .report-empty.trend {
  background: rgba(21, 26, 34, 0.82) !important;
}

@media (prefers-color-scheme: dark) {
  body.is-report-capturing:not(.tg-light) .report-screen {
    background: #0d1118;
    --card: rgba(24, 29, 38, 0.95);
    --card-solid: #151a22;
    --sheet-surface: #151a22;
    --sheet-row: rgba(21, 26, 34, 0.93);
    --line: rgba(221, 230, 255, 0.1);
    --shadow: 0 18px 52px rgba(0, 0, 0, 0.34);
    --soft-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  }

  body.is-report-capturing:not(.tg-light) .report-screen .report-metric-card,
  body.is-report-capturing:not(.tg-light) .report-screen .report-panel,
  body.is-report-capturing:not(.tg-light) .report-screen .report-back-button,
  body.is-report-capturing:not(.tg-light) .report-screen .report-share-button,
  body.is-report-capturing:not(.tg-light) .report-screen .report-period-badge {
    background: rgba(24, 29, 38, 0.95) !important;
    border-color: rgba(221, 230, 255, 0.1) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22) !important;
  }

  body.is-report-capturing:not(.tg-light) .report-screen .report-insight-card.good {
    background: linear-gradient(145deg, rgba(24, 191, 120, 0.16), rgba(24, 29, 38, 0.95)) !important;
  }

  body.is-report-capturing:not(.tg-light) .report-screen .report-insight-card.attention {
    background: linear-gradient(145deg, rgba(255, 196, 92, 0.18), rgba(24, 29, 38, 0.95)) !important;
  }

  body.is-report-capturing:not(.tg-light) .report-screen .report-insight-card.recommendation {
    background: linear-gradient(145deg, rgba(109, 92, 255, 0.18), rgba(24, 29, 38, 0.95)) !important;
  }

  body.is-report-capturing:not(.tg-light) .report-screen .report-insight-card p {
    color: rgba(244, 247, 251, 0.88) !important;
  }

  body.is-report-capturing:not(.tg-light) .report-screen .report-donut-track {
    stroke: rgba(142, 152, 170, 0.14) !important;
  }

  body.is-report-capturing:not(.tg-light) .report-screen .report-trend-grid {
    stroke: rgba(142, 152, 170, 0.12) !important;
  }

  body.is-report-capturing:not(.tg-light) .report-screen .report-empty.trend {
    background: rgba(21, 26, 34, 0.82) !important;
  }
}

.report-detail-bar {
  display: grid;
  grid-template-columns: 50px 1fr 50px;
  align-items: center;
  gap: 12px;
}

.report-detail-bar h1 {
  overflow: hidden;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 850;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-back-button,
.report-share-button {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: var(--card);
  box-shadow: var(--soft-shadow);
  font-size: 24px;
  font-weight: 400;
}

.report-share-button svg,
.report-period-badge svg,
.report-ask-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.report-period-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 42px;
  margin: 12px auto 18px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--text);
  background: var(--card);
  box-shadow: var(--soft-shadow);
}

.report-period-badge span {
  display: grid;
  place-items: center;
}

.report-period-badge strong {
  font-size: 14px;
  font-weight: 800;
}

.report-period-badge i {
  color: var(--muted);
  font-style: normal;
  font-size: 18px;
}

.report-ai-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  min-height: 154px;
  overflow: hidden;
  padding: 22px 18px 22px 20px;
  border: 1px solid rgba(140, 112, 255, 0.42);
  border-radius: 19px;
  background:
    radial-gradient(circle at 88% 46%, rgba(121, 111, 255, 0.64), transparent 28%),
    radial-gradient(circle at 4% 100%, rgba(140, 47, 255, 0.48), transparent 34%),
    linear-gradient(135deg, #3920a5 0%, #211b78 43%, #4630c8 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 18px 48px rgba(75, 48, 197, 0.42);
}

.report-ai-hero::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 20px;
  width: 118px;
  height: 28px;
  border-radius: 50%;
  background: rgba(113, 91, 255, 0.58);
  filter: blur(10px);
}

.report-ai-copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 14px;
  padding-right: 2px;
}

.report-ai-copy h2 {
  color: #ffffff;
  font-size: 19px;
  font-weight: 850;
}

.report-ai-copy p {
  color: rgba(255, 255, 255, 0.92);
  font-size: 16px;
  line-height: 1.42;
  font-weight: 620;
}

.report-ai-bot {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: end;
  width: 106px;
  height: 106px;
  color: #ffffff;
  filter: drop-shadow(0 0 22px rgba(151, 132, 255, 0.72));
}

.report-ai-bot svg,
.report-assistant-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.report-ai-bot rect:first-of-type {
  fill: url("#richAiBotGradient");
  opacity: 0.94;
  stroke: rgba(255, 255, 255, 0.86);
}

.report-ai-bot rect:nth-of-type(2) {
  fill: #17143d;
  stroke: rgba(255, 255, 255, 0.36);
}

.report-ai-bot circle {
  fill: #ffffff;
  stroke: none;
}

.report-ai-bot ellipse {
  fill: rgba(104, 89, 255, 0.5);
  stroke: rgba(151, 132, 255, 0.42);
}

.report-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  grid-auto-rows: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.report-metric-card,
.report-insight-card,
.report-panel {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.report-metric-card {
  display: grid;
  box-sizing: border-box;
  grid-template-rows: 27px minmax(30px, auto) minmax(24px, 1fr);
  align-content: stretch;
  align-items: start;
  height: 100%;
  min-height: 118px;
  padding: 12px;
  border-radius: 13px;
}

.report-metric-icon {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
}

.report-metric-card.report-metric-income .report-metric-icon {
  background: linear-gradient(135deg, #43df8d, #18b96e);
}

.report-metric-card.report-metric-expense .report-metric-icon {
  background: linear-gradient(135deg, #ff737b, #ff435f);
}

.report-metric-card.report-metric-balance .report-metric-icon {
  background: linear-gradient(135deg, #8a4dff, #6a4bff);
}

.report-metric-card.report-metric-rate .report-metric-icon {
  background: linear-gradient(135deg, #4f88ff, #2c67ff);
}

.report-metric-card p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.22;
  font-weight: 680;
  overflow-wrap: anywhere;
}

.report-metric-card strong {
  align-self: end;
  margin-top: 7px;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 18px;
  line-height: 1.12;
  font-weight: 850;
}

.report-insights-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
  margin-top: 18px;
}

.report-insight-card {
  min-width: 0;
  min-height: 126px;
  height: auto;
  padding: 16px 12px;
  border-radius: 13px;
}

.report-insight-card.good {
  background: linear-gradient(145deg, color-mix(in srgb, var(--income), transparent 84%), var(--card));
}

.report-insight-card.attention {
  background: linear-gradient(145deg, color-mix(in srgb, #ffc45c, transparent 82%), var(--card));
}

.report-insight-card.recommendation {
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent), transparent 82%), var(--card));
}

.report-insight-card h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.report-insight-card.good h2 {
  color: #45de8f;
}

.report-insight-card.attention h2 {
  color: #ffc45c;
}

.report-insight-card.recommendation h2 {
  color: #c084ff;
}

.report-insight-card h2 span {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: currentColor;
  background: color-mix(in srgb, currentColor, transparent 88%);
  font-size: 12px;
}

.report-insight-card p {
  margin-top: 16px;
  color: color-mix(in srgb, var(--text), transparent 12%);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 560;
  overflow-wrap: anywhere;
  word-break: normal;
}

.report-grid-row {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(122px, 0.9fr);
  gap: 10px;
  margin-top: 18px;
}

.report-panel {
  overflow: hidden;
  min-height: 194px;
  padding: 14px;
  border-radius: 13px;
}

.report-panel h2,
.report-panel-title-row h2 {
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 840;
}

.report-category-layout {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.report-donut {
  position: relative;
  display: grid;
  width: 118px;
  height: 118px;
  place-items: center;
}

.report-donut svg {
  width: 118px;
  height: 118px;
  overflow: visible;
  transform: rotate(-90deg);
}

.report-donut-track,
.report-donut-segment {
  fill: none;
  stroke-linecap: butt;
  stroke-width: 18;
}

.report-donut-track {
  stroke: color-mix(in srgb, var(--muted), transparent 86%);
}

.report-donut-center {
  position: absolute;
  inset: 26px;
  display: grid;
  place-items: center;
  text-align: center;
}

.report-donut-center strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
  line-height: 1.15;
  font-weight: 850;
}

.report-donut-center span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
}

.report-categories {
  display: grid;
  gap: 9px;
}

.report-category-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 34px 64px;
  align-items: center;
  gap: 8px;
}

.report-category-item i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--category-color);
}

.report-category-item strong {
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-category-item span,
.report-category-item b {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  text-align: right;
  white-space: nowrap;
}

.report-category-item b {
  font-weight: 760;
}

.report-empty {
  display: grid;
  min-height: 74px;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
  text-align: center;
}

.report-panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.report-panel-title-row span {
  padding: 7px 9px;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, #7d42ff, #5234c9);
  font-size: 12px;
  font-weight: 850;
}

.report-panel-title-row span.negative {
  background: linear-gradient(135deg, #ff6573, #d93f55);
}

.report-trend-chart {
  position: relative;
  min-height: 142px;
  margin-top: 10px;
}

.report-trend-chart svg {
  display: block;
  width: 100%;
  height: 112px;
  overflow: visible;
}

.report-trend-grid {
  fill: none;
  stroke: color-mix(in srgb, var(--muted), transparent 88%);
  stroke-width: 1;
}

.report-trend-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.4;
  filter: drop-shadow(0 9px 14px rgba(108, 75, 255, 0.34));
}

.report-trend-line.income {
  stroke: #42df91;
}

.report-trend-line.expense {
  stroke: #8a4dff;
}

.report-trend-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
}

.report-empty.trend {
  position: absolute;
  inset: 30px 0 auto;
  min-height: 38px;
  background: color-mix(in srgb, var(--card-solid), transparent 18%);
  border-radius: 14px;
}

.report-assistant-card {
  position: relative;
  display: grid;
  gap: 16px;
  overflow: hidden;
  margin-top: 18px;
  padding: 18px 14px 12px;
  border: 1px solid rgba(125, 85, 255, 0.35);
  border-radius: 19px;
  background:
    radial-gradient(circle at 92% 12%, rgba(151, 74, 255, 0.5), transparent 26%),
    radial-gradient(circle at 6% 72%, rgba(83, 78, 255, 0.54), transparent 32%),
    linear-gradient(135deg, #291c84, #132166 58%, #1e39a8);
  box-shadow: 0 18px 48px rgba(54, 54, 176, 0.36);
}

.report-assistant-card::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -8px;
  width: 74px;
  height: 74px;
  border-radius: 24px;
  background: rgba(151, 74, 255, 0.32);
  filter: blur(1px);
  transform: rotate(18deg);
}

.report-assistant-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 62px 1fr;
  align-items: center;
  gap: 12px;
}

.report-assistant-icon {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  color: #ffffff;
  filter: drop-shadow(0 0 18px rgba(168, 147, 255, 0.7));
}

.report-assistant-icon rect:first-of-type {
  fill: rgba(255, 255, 255, 0.86);
  stroke: rgba(255, 255, 255, 0.86);
}

.report-assistant-icon rect:nth-of-type(2) {
  fill: #17143d;
}

.report-assistant-icon circle {
  fill: #ffffff;
  stroke: none;
}

.report-assistant-content h2 {
  color: #ffffff;
  font-size: 16px;
  font-weight: 850;
}

.report-assistant-content p {
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 620;
}

.report-ask-button {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #862dff, #2f7bff);
  box-shadow: 0 14px 30px rgba(67, 105, 255, 0.34);
  font-size: 16px;
  font-weight: 850;
}

.report-period-backdrop {
  position: fixed;
  inset: 0;
  z-index: 48;
  display: grid;
  align-items: end;
  padding: 0 12px max(10px, env(safe-area-inset-bottom));
  background: var(--sheet-backdrop);
  backdrop-filter: blur(11px);
}

.report-period-backdrop[hidden] {
  display: none;
}

.report-period-sheet {
  width: min(100%, 430px);
  max-height: min(86vh, 720px);
  margin: 0 auto;
  padding: 16px 20px 28px;
  border: 1px solid var(--line);
  border-radius: 32px 32px 28px 28px;
  color: var(--text);
  background:
    radial-gradient(circle at 48% 0%, color-mix(in srgb, var(--accent), transparent 86%), transparent 34%),
    var(--sheet-surface);
  box-shadow: var(--shadow);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(var(--sheet-drag, 0px));
}

.report-period-handle {
  width: 48px;
  height: 5px;
  margin: 2px auto 24px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted), transparent 46%);
}

.report-period-heading {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.report-period-heading h2 {
  grid-column: 2;
  font-size: 23px;
  line-height: 1.14;
  font-weight: 850;
  text-align: center;
  letter-spacing: 0;
}

.report-period-close {
  grid-column: 3;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--text);
  background: color-mix(in srgb, var(--card-solid), transparent 8%);
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
}

.report-period-options {
  display: grid;
  gap: 12px;
}

.report-period-submit {
  width: 100%;
  min-height: 58px;
  margin-top: 18px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #8c22ff, #2e7bff);
  box-shadow: 0 18px 34px rgba(61, 96, 255, 0.32), 0 14px 30px rgba(142, 34, 255, 0.24);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1.2px;
}

.report-period-submit:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.report-period-option {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 84px;
  padding: 12px 18px 12px 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--text);
  background: var(--sheet-row);
  box-shadow: var(--soft-shadow);
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.report-period-option:hover,
.report-period-option:active,
.report-period-option.is-selected {
  border-color: color-mix(in srgb, var(--accent), transparent 42%);
  color: #ffffff;
  background:
    radial-gradient(circle at 12% 50%, rgba(127, 59, 255, 0.42), transparent 36%),
    linear-gradient(135deg, var(--accent), var(--accent-2));
  transform: translateY(-1px);
}

.report-period-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 11px;
  color: #ffffff;
  background: linear-gradient(135deg, #8c35ff, #3b66ff);
  box-shadow: 0 10px 24px rgba(76, 89, 255, 0.32);
}

.report-period-icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.report-period-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.report-period-copy strong {
  overflow: hidden;
  font-size: 20px;
  line-height: 1.1;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-period-copy small {
  overflow: hidden;
  color: color-mix(in srgb, currentColor, transparent 34%);
  font-size: 14px;
  font-weight: 660;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-period-radio {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 2px solid color-mix(in srgb, var(--muted), transparent 26%);
  border-radius: 50%;
  color: currentColor;
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
}

.report-period-option.is-selected .report-period-radio {
  border-color: currentColor;
  background: color-mix(in srgb, currentColor, transparent 84%);
}

.date-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 56;
  display: grid;
  align-items: end;
  padding: 14px;
  background: var(--sheet-backdrop);
  backdrop-filter: blur(11px);
}

.date-picker-backdrop[hidden] {
  display: none;
}

.date-picker-sheet {
  width: min(100%, 430px);
  max-height: min(86vh, 720px);
  margin: 0 auto;
  padding: 10px 20px max(22px, env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-radius: 30px 30px 26px 26px;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 12%, color-mix(in srgb, var(--accent), transparent 86%), transparent 28%),
    var(--sheet-surface);
  box-shadow: var(--shadow);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(var(--sheet-drag, 0px));
}

.date-picker-monthbar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
  margin: 4px 0 18px;
}

.date-picker-monthbar strong {
  overflow: hidden;
  font-size: 20px;
  line-height: 1.15;
  font-weight: 850;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-picker-arrow {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--text);
  background: color-mix(in srgb, var(--card-solid), transparent 7%);
  box-shadow: var(--soft-shadow);
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
}

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

.date-picker-weekdays {
  margin-bottom: 8px;
}

.date-picker-weekdays span {
  display: grid;
  min-height: 26px;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.date-picker-empty-day,
.date-picker-day {
  min-width: 0;
  aspect-ratio: 1;
}

.date-picker-day {
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--text);
  background: color-mix(in srgb, var(--card-solid), transparent 8%);
  font-size: 14px;
  font-weight: 830;
}

.date-picker-day.is-today {
  border-color: color-mix(in srgb, var(--accent), transparent 45%);
  color: color-mix(in srgb, var(--accent), var(--text) 14%);
}

.date-picker-day.is-selected {
  border-color: transparent;
  color: #ffffff;
  background: linear-gradient(135deg, #8c22ff, #2e7bff);
  box-shadow: 0 12px 26px rgba(61, 96, 255, 0.28);
}

.date-picker-day.is-range-start,
.date-picker-day.is-range-end {
  border-color: transparent;
  color: #ffffff;
  background: linear-gradient(135deg, #8c22ff, #2e7bff);
  box-shadow: 0 12px 26px rgba(61, 96, 255, 0.28);
}

.date-picker-day.is-in-range {
  border-color: color-mix(in srgb, var(--accent), transparent 76%);
  color: color-mix(in srgb, var(--accent), var(--text) 18%);
  background: color-mix(in srgb, var(--accent), transparent 84%);
}

.date-picker-submit {
  width: 100%;
  min-height: 58px;
  margin-top: 18px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #8c22ff, #2e7bff);
  box-shadow: 0 18px 34px rgba(61, 96, 255, 0.32), 0 14px 30px rgba(142, 34, 255, 0.24);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1.2px;
}

.date-picker-submit:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.is-loading-detail {
  opacity: 0.76;
}

.operations-screen {
  display: none;
}

.operations-screen.is-active,
.operations-screen.is-entering,
.operations-screen.is-leaving {
  display: block;
}

.operations-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 0 16px;
}

.operations-heading h1 {
  font-size: clamp(34px, 12vw, 50px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.operations-category-panel {
  border: 1px solid color-mix(in srgb, var(--accent), var(--line) 72%);
  border-radius: 24px;
  background:
    radial-gradient(circle at 15% 0%, color-mix(in srgb, var(--accent), transparent 84%), transparent 34%),
    color-mix(in srgb, var(--card-solid), transparent 8%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.operations-card-head,
.operations-section-head,
.operations-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.operations-card-head h2,
.operations-section-head h2 {
  font-size: 18px;
  line-height: 1.15;
  font-weight: 870;
}

.operations-card-head span {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 30%);
  border-radius: 50%;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

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

.operations-summary-grid div {
  min-width: 0;
}

.operations-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.operations-summary-grid strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  font-size: clamp(17px, 5vw, 24px);
  line-height: 1.12;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operations-summary-grid .income,
.operations-history-head .income,
#operationsBalance.income {
  color: var(--income);
}

.operations-summary-grid .expense,
.operations-history-head .expense,
#operationsBalance.expense {
  color: var(--expense);
}

.operations-trend {
  height: 126px;
  color: var(--accent);
}

.operations-trend svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.operations-trend-grid path {
  fill: none;
  stroke: var(--line);
  stroke-dasharray: 3 7;
  stroke-width: 1;
}

.operations-trend polyline {
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent), transparent 35%));
}

.operations-trend circle {
  fill: #ffffff;
  stroke: currentColor;
  stroke-width: 3;
}

.operations-category-panel {
  display: grid;
  width: 100%;
  gap: 16px;
  margin-top: 0;
  padding: 16px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.operations-category-panel:active {
  transform: scale(0.99);
}

.operations-section-head > span {
  color: var(--muted);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.operations-category-content {
  display: grid;
  grid-template-columns: minmax(112px, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 14px;
}

.operations-donut {
  position: relative;
  display: grid;
  width: 132px;
  max-width: 100%;
  aspect-ratio: 1;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
}

.operations-donut::after {
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: var(--card-solid);
  content: "";
}

.operations-donut strong,
.operations-donut span {
  position: relative;
  z-index: 1;
  text-align: center;
}

.operations-donut strong {
  align-self: end;
  font-size: 18px;
  font-weight: 900;
}

.operations-donut span {
  align-self: start;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.operations-category-list {
  display: grid;
}

.operations-category-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto 36px;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border-bottom: 1px solid var(--line);
}

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

.operations-category-row span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--category-color);
}

.operations-category-row strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operations-category-row b {
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.operations-category-row em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 760;
  text-align: right;
}

.operations-search {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  margin-top: 14px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--accent);
  background: color-mix(in srgb, var(--card-solid), transparent 7%);
  box-shadow: var(--soft-shadow);
}

.operations-search span {
  font-size: 28px;
  line-height: 1;
}

.operations-search input {
  min-width: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: 15px;
  font-weight: 720;
  outline: 0;
}

.operations-search input::placeholder {
  color: var(--muted);
}

.operations-segments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 12px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--card-solid), transparent 8%);
}

.operations-segments button,
.operations-category-pills button {
  min-width: 0;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

.operations-segments button {
  min-height: 38px;
  border-radius: 14px;
  font-size: 13px;
}

.operations-segments button.is-active,
.operations-category-pills button.is-active {
  border-color: color-mix(in srgb, var(--accent), transparent 50%);
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent), transparent 74%);
}

.operations-category-pills {
  display: flex;
  gap: 8px;
  margin: 12px -18px 6px;
  padding: 0 18px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.operations-category-pills::-webkit-scrollbar {
  display: none;
}

.operations-category-pills button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border-color: var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card-solid), transparent 10%);
  font-size: 13px;
  white-space: nowrap;
}

.operations-history {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.operations-history-group {
  display: grid;
  gap: 8px;
}

.operations-history-head {
  padding: 0 14px;
}

.operations-history-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 860;
}

.operations-history-head strong {
  font-size: 14px;
  font-weight: 900;
}

.operations-history-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--card-solid), transparent 8%);
  box-shadow: var(--soft-shadow);
}

.operations-history-item {
  grid-template-columns: 42px minmax(0, 1fr) auto 16px;
  min-height: 70px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.operations-history-item + .operations-history-item {
  border-top: 1px solid var(--line);
}

.operations-history-item .operation-title strong {
  color: var(--text);
  font-size: 15px;
}

.operations-history-item .category-chip {
  display: inline-flex;
  align-self: start;
  justify-content: flex-start;
  max-width: min(100%, 220px);
  vertical-align: middle;
  font-style: normal;
  font-synthesis: none;
}

.operations-chevron {
  color: var(--muted);
  font-size: 26px;
  font-style: normal;
  line-height: 1;
}

.placeholder-screen {
  min-height: calc(100vh - 150px);
  place-items: center;
}

.placeholder-screen.is-active {
  display: grid;
}

.placeholder-card {
  display: grid;
  width: min(100%, 280px);
  min-height: 150px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--text);
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 22px;
  font-weight: 850;
  backdrop-filter: blur(18px);
}

.profile-screen {
  display: none;
  padding-top: 6px;
}

.profile-screen.is-active {
  display: block;
}

.profile-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 184px;
  padding: 22px 20px 20px;
  text-align: center;
}

.settings-button {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: color-mix(in srgb, var(--card-solid), transparent 10%);
  box-shadow: 0 8px 20px rgba(34, 42, 78, 0.10);
  font-size: 15px;
}

.avatar {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent), #ffffff 26%);
  border-radius: 50%;
  color: #ffffff;
  background:
    radial-gradient(circle at 72% 24%, rgba(255, 255, 255, 0.42), transparent 24%),
    linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 30px color-mix(in srgb, var(--accent), transparent 74%);
  font-size: 29px;
  font-weight: 850;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.has-photo {
  background: var(--card-solid);
}

.profile-copy h2 {
  margin-top: 2px;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 850;
}

.profile-copy p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.settings-list {
  display: grid;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--card-solid), transparent 7%);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
}

.settings-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 12px 14px;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

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

.settings-row-button {
  cursor: pointer;
}

.settings-row-button:hover {
  background: color-mix(in srgb, var(--accent), transparent 94%);
}

.settings-row-button:active,
.profile-summary-list .settings-row-button:active,
.nav-item:active,
.settings-button:active,
.menu-button:active {
  transform: scale(0.98);
}

.menu-button:active {
  transform: translateY(-4px) scale(0.98);
}

.settings-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent), transparent 88%);
  font-size: 17px;
}

.settings-row strong {
  display: block;
  font-size: 15px;
  font-weight: 820;
}

.settings-row p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  text-align: right;
  white-space: nowrap;
}

.profile-logout-button[hidden] {
  display: none !important;
}

.profile-logout-button .profile-logout-icon {
  background: color-mix(in srgb, var(--expense), transparent 88%);
}

.profile-logout-button strong {
  color: var(--expense);
}

.profile-summary-list {
  margin-top: 14px;
}

.profile-settings-chevron {
  color: var(--muted);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.settings-screen {
  display: none;
  padding-top: 6px;
}

.settings-screen.is-active {
  display: block;
}

.settings-detail-bar {
  margin-bottom: 18px;
}

.settings-sections {
  display: grid;
  gap: 22px;
  padding-bottom: 24px;
}

.settings-section-title {
  margin: 0 0 8px 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.settings-section-group.settings-list {
  margin-top: 0;
}

.settings-row-static {
  cursor: default;
}

.settings-row-static:hover {
  background: transparent;
}

.settings-row-copy {
  display: grid;
  gap: 2px;
}

.settings-row-copy strong {
  display: block;
  font-size: 15px;
  font-weight: 820;
}

.settings-row-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.settings-row-toggle {
  grid-template-columns: 34px 1fr auto;
}

.settings-row-toggle.is-disabled {
  opacity: 0.72;
}

.settings-toggle {
  position: relative;
  width: 54px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted), transparent 74%);
  box-shadow: inset 0 0 0 1px var(--line);
  pointer-events: none;
}

.settings-toggle span {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.settings-icon-account {
  font-size: 15px;
  font-weight: 850;
}

.bottom-nav {
  --nav-active-duration: 80ms;
  --nav-active-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: min(calc(100% - 24px), 430px);
  margin: 0 auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--card-solid), transparent 10%);
  box-shadow: 0 18px 46px rgba(17, 24, 39, 0.18);
  backdrop-filter: blur(22px);
}

.bottom-nav-indicator {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  z-index: 0;
  width: 0;
  border-radius: 18px;
  background: color-mix(in srgb, var(--accent), transparent 90%);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #ffffff, transparent 82%),
    0 8px 22px color-mix(in srgb, var(--accent), transparent 82%);
  transform: translate3d(0, 0, 0);
  transition: none;
  pointer-events: none;
  will-change: transform, width;
}

.nav-item {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  min-height: 62px;
  place-items: center;
  gap: 4px;
  border: 0;
  border-radius: 18px;
  color: var(--muted);
  background: transparent;
  transition:
    color var(--nav-active-duration) var(--nav-active-ease),
    opacity var(--nav-active-duration) var(--nav-active-ease);
}

.nav-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 12px;
  transition:
    transform var(--nav-active-duration) var(--nav-active-ease),
    color var(--nav-active-duration) var(--nav-active-ease),
    background var(--nav-active-duration) var(--nav-active-ease),
    box-shadow var(--nav-active-duration) var(--nav-active-ease),
    opacity var(--nav-active-duration) var(--nav-active-ease);
}

.nav-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.15;
}

.nav-icon svg path:first-child {
  fill: currentColor;
  opacity: 0.12;
}

.nav-item strong {
  overflow: hidden;
  max-width: 100%;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition:
    transform var(--nav-active-duration) var(--nav-active-ease),
    color var(--nav-active-duration) var(--nav-active-ease),
    opacity var(--nav-active-duration) var(--nav-active-ease);
}

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

.nav-item.is-active .nav-icon {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent), transparent 70%);
  transform: translate3d(0, -1px, 0) scale(1.03);
}

.nav-item.is-active strong {
  transform: translate3d(0, -1px, 0);
  opacity: 1;
}

.nav-item.is-active .nav-icon svg path:first-child {
  opacity: 0.24;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: end;
  padding: 18px;
  background: rgba(6, 10, 20, 0.34);
  backdrop-filter: blur(8px);
}

.sheet-backdrop[hidden] {
  display: none;
}

.selector-sheet {
  width: min(100%, 430px);
  max-height: min(84vh, 680px);
  margin: 0 auto;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: color-mix(in srgb, var(--card-solid), transparent 3%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: 2px auto 14px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--muted), transparent 58%);
}

.sheet-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px 10px 6px;
}

.selector-sheet h2 {
  font-size: 17px;
  font-weight: 850;
}

.sheet-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: color-mix(in srgb, var(--card-solid), transparent 8%);
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.selector-options {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--card), transparent 15%);
}

.sheet-mode-details .selector-options {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.selector-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 14px;
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: 15px;
  font-weight: 780;
  text-align: left;
}

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

.selector-option.is-selected {
  color: var(--accent);
}

.selector-check {
  color: var(--accent);
  font-size: 18px;
  font-weight: 850;
}

.operation-details {
  display: grid;
  gap: 14px;
}

.operation-detail-summary {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--card), transparent 10%);
}

.operation-detail-summary .operation-icon {
  grid-row: span 2;
  width: 44px;
  height: 44px;
  border-radius: 16px;
}

.operation-detail-amount {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 25px;
  line-height: 1.05;
  font-weight: 850;
}

.operation-detail-amount.income {
  color: var(--income);
}

.operation-detail-amount.expense {
  color: var(--expense);
}

.operation-detail-type {
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.operation-detail-rows {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--card), transparent 14%);
}

.operation-detail-row {
  display: grid;
  grid-template-columns: minmax(88px, 0.75fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
}

.operation-detail-row + .operation-detail-row {
  border-top: 1px solid var(--line);
}

.operation-detail-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.operation-detail-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 820;
  text-align: right;
}

.budget-details {
  display: grid;
  gap: 14px;
}

.budget-detail-summary {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 65%);
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent), transparent 78%), transparent 46%),
    color-mix(in srgb, var(--card), transparent 8%);
}

.budget-detail-summary strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 18px;
  font-weight: 900;
}

.budget-detail-summary b {
  color: var(--income);
  font-size: 28px;
  line-height: 1.05;
  font-weight: 950;
}

.budget-members-block {
  display: grid;
  gap: 10px;
}

.budget-members-block h3 {
  padding: 0 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.budget-members-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--card), transparent 14%);
}

.budget-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
}

.budget-member-row + .budget-member-row {
  border-top: 1px solid var(--line);
}

.budget-member-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.budget-member-copy strong,
.budget-member-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.budget-member-copy strong {
  font-size: 15px;
  font-weight: 850;
}

.budget-member-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.budget-member-row i {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--muted), transparent 90%);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.budget-member-row i.owner {
  color: color-mix(in srgb, var(--accent), white 14%);
  background: color-mix(in srgb, var(--accent), transparent 84%);
}

.budget-detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.categories-title {
  display: grid;
  gap: 10px;
  margin: 8px 0 24px;
}

.categories-title h1 {
  font-size: 36px;
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: 0;
}

.categories-title p {
  max-width: 330px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.4;
}

.categories-segments {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-height: 64px;
  margin-bottom: 20px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--card-solid), transparent 16%);
  box-shadow: var(--soft-shadow);
}

.categories-segments button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  font-size: 15px;
  font-weight: 850;
}

.categories-segments button span {
  font-size: 24px;
  line-height: 1;
}

.categories-segments button[data-category-type="expense"].is-active {
  color: var(--expense);
  background: color-mix(in srgb, var(--expense), transparent 82%);
}

.categories-segments button[data-category-type="income"].is-active {
  color: var(--income);
  background: color-mix(in srgb, var(--income), transparent 84%);
}

.categories-mode-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 48%);
  border-radius: 20px;
  background:
    radial-gradient(circle at 22% 0%, color-mix(in srgb, var(--accent), transparent 82%), transparent 40%),
    var(--card);
  box-shadow: var(--shadow);
}

.categories-mode-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--expense), #ffffff 12%), color-mix(in srgb, var(--accent), #000000 5%));
  font-size: 24px;
  font-weight: 900;
}

.categories-mode-card h2 {
  margin-bottom: 7px;
  font-size: 17px;
  font-weight: 900;
}

.categories-mode-card p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.38;
}

.categories-mode-switch {
  position: relative;
  width: 54px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted), transparent 74%);
  box-shadow: inset 0 0 0 1px var(--line);
}

.categories-mode-switch span {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  transition: transform 0.18s ease;
}

.categories-mode-switch.is-on {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.categories-mode-switch.is-on span {
  transform: translateX(20px);
}

.categories-list-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.categories-list-head h2 {
  font-size: 19px;
  font-weight: 900;
}

.categories-list-head span {
  display: none;
  color: color-mix(in srgb, var(--accent), #ffffff 6%);
  font-size: 14px;
  font-weight: 800;
}

.categories-readonly-banner {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 42%);
  border-radius: 16px;
  color: color-mix(in srgb, var(--accent), #ffffff 10%);
  background: color-mix(in srgb, var(--accent), transparent 88%);
  font-size: 13px;
  font-weight: 820;
  line-height: 1.3;
  text-align: center;
}

.categories-readonly-banner[hidden] {
  display: none;
}

.categories-screen.is-automatic-mode .categories-list,
.categories-screen.is-automatic-mode .categories-empty-card,
.categories-screen.is-automatic-mode .categories-add-button {
  opacity: 0.5;
  filter: blur(1.5px);
  pointer-events: none;
}

.categories-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--card-solid), transparent 8%);
  box-shadow: var(--shadow);
}

.category-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 92px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  text-align: left;
}

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

.category-card-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--expense), #ffffff 12%), color-mix(in srgb, var(--accent), #000000 5%));
  font-size: 24px;
  font-weight: 900;
}

.category-card.income .category-card-icon {
  background: linear-gradient(135deg, color-mix(in srgb, var(--income), #ffffff 8%), color-mix(in srgb, #176c45, #000000 10%));
}

.category-card-main {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.category-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.category-card-title strong {
  overflow: hidden;
  font-size: 17px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-card-title i,
.category-type-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--expense);
  background: color-mix(in srgb, var(--expense), transparent 84%);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.category-card.income .category-card-title i,
.category-type-badge.income {
  color: var(--income);
  background: color-mix(in srgb, var(--income), transparent 84%);
}

.category-card-main small {
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.36;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-card-meta {
  display: grid;
  grid-template-columns: auto 16px;
  gap: 12px;
  align-items: center;
  color: var(--muted);
}

.category-card-meta b {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.category-card-chevron {
  font-size: 30px;
  font-style: normal;
  line-height: 1;
}

.categories-add-button,
.categories-empty-card button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  margin-top: 24px;
  border: 0;
  border-radius: 18px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-2), #3418a8 22%));
  box-shadow: 0 16px 34px color-mix(in srgb, var(--accent), transparent 72%);
  font-size: 16px;
  font-weight: 900;
}

.categories-add-button span,
.categories-empty-card button span {
  font-size: 31px;
  line-height: 1;
}

.categories-empty-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 34px 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--card-solid), transparent 8%);
  box-shadow: var(--shadow);
  text-align: center;
}

.categories-empty-icon {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 22px;
  color: color-mix(in srgb, var(--accent), #ffffff 10%);
  background: color-mix(in srgb, var(--accent), transparent 82%);
  font-size: 34px;
  font-weight: 900;
}

.categories-empty-card strong {
  font-size: 21px;
  font-weight: 900;
}

.categories-empty-card p {
  max-width: 270px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.42;
}

.category-sheet {
  max-height: min(88vh, 760px);
}

.category-details,
.category-form {
  display: grid;
  gap: 18px;
  padding-top: 8px;
}

.category-details-hero {
  display: flex;
  align-items: center;
  gap: 14px;
}

.category-details-icon {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border-radius: 22px;
  color: #ffffff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--expense), #ffffff 12%), color-mix(in srgb, var(--accent), #000000 5%));
  font-size: 30px;
  font-weight: 900;
}

.category-details-icon.income {
  background: linear-gradient(135deg, color-mix(in srgb, var(--income), #ffffff 8%), color-mix(in srgb, #176c45, #000000 10%));
}

.category-details-copy {
  display: grid;
  gap: 8px;
}

.category-details-copy strong {
  font-size: 23px;
  line-height: 1.12;
  font-weight: 900;
}

.category-details h3 {
  font-size: 14px;
  font-weight: 850;
}

.category-keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.category-keyword-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  color: var(--expense);
  background: color-mix(in srgb, var(--expense), transparent 82%);
  font-size: 13px;
  font-weight: 800;
}

.category-keyword-chip i {
  font-style: normal;
  font-size: 16px;
  line-height: 1;
}

.category-outline-button {
  width: fit-content;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 38%);
  border-radius: 14px;
  color: color-mix(in srgb, var(--accent), #ffffff 10%);
  background: color-mix(in srgb, var(--accent), transparent 90%);
  font-size: 14px;
  font-weight: 850;
}

.category-detail-actions {
  display: grid;
  gap: 10px;
}

.sheet-primary-button.danger {
  color: var(--expense);
  background: color-mix(in srgb, var(--expense), transparent 90%);
  border: 1px solid color-mix(in srgb, var(--expense), transparent 76%);
  box-shadow: none;
}

.category-form-field {
  display: grid;
  gap: 8px;
}

.category-form-field span,
.category-form-type strong {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.category-form-field input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: var(--sheet-row);
  font-size: 15px;
  font-weight: 750;
  outline: 0;
}

.category-form-type {
  display: grid;
  gap: 10px;
}

.category-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.category-type-toggle button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: var(--sheet-row);
  font-size: 15px;
  font-weight: 850;
}

.category-type-toggle button.is-active:first-child {
  color: var(--expense);
  border-color: color-mix(in srgb, var(--expense), transparent 58%);
  background: color-mix(in srgb, var(--expense), transparent 86%);
}

.category-type-toggle button.is-active:last-child {
  color: var(--income);
  border-color: color-mix(in srgb, var(--income), transparent 58%);
  background: color-mix(in srgb, var(--income), transparent 86%);
}

.right-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  justify-content: flex-end;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  background: rgba(5, 8, 18, 0.42);
  opacity: 0;
  backdrop-filter: blur(10px);
  transition: opacity var(--motion-duration-fast) var(--motion-ease);
}

.right-menu-backdrop.is-open {
  opacity: 1;
}

.right-menu-backdrop[hidden] {
  display: none;
}

.right-menu-panel {
  position: relative;
  display: grid;
  align-content: start;
  gap: 18px;
  width: min(86vw, 342px);
  min-height: min(100%, 720px);
  padding: 64px 18px 18px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 50%);
  border-radius: 26px;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent), transparent 78%), transparent 32%),
    var(--sheet-surface);
  box-shadow: -18px 0 52px rgba(0, 0, 0, 0.20);
  overflow-y: auto;
  transform: translate3d(calc(100% + 18px), 0, 0) scale(0.985);
  opacity: 0.94;
  transition:
    transform var(--motion-duration-slow) var(--motion-spring),
    opacity var(--motion-duration-fast) var(--motion-ease);
}

.right-menu-backdrop.is-open .right-menu-panel {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
}

.right-menu-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent), #ffffff 10%), color-mix(in srgb, var(--accent-2), #000000 8%));
  box-shadow: 0 12px 24px color-mix(in srgb, var(--accent), transparent 76%);
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
}

.right-menu-user-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 46%);
  border-radius: 20px;
  background: color-mix(in srgb, var(--card-solid), var(--accent) 8%);
  box-shadow: var(--soft-shadow);
}

.right-menu-avatar {
  display: grid;
  overflow: hidden;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 23px;
  font-weight: 900;
}

.right-menu-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.right-menu-user-copy {
  min-width: 0;
}

.right-menu-user-copy h2 {
  overflow: hidden;
  font-size: 19px;
  line-height: 1.15;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.right-menu-user-copy p {
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.right-menu-user-copy span {
  display: inline-flex;
  width: fit-content;
  margin-top: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  color: color-mix(in srgb, var(--accent), #ffffff 16%);
  background: color-mix(in srgb, var(--accent), transparent 82%);
  font-size: 13px;
  font-weight: 850;
}

.right-menu-items {
  display: grid;
  gap: 12px;
}

.right-menu-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--text);
  background: color-mix(in srgb, var(--card), transparent 8%);
  box-shadow: var(--soft-shadow);
  text-align: left;
}

.right-menu-item.is-active {
  border-color: color-mix(in srgb, var(--accent), transparent 34%);
  color: #ffffff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent), #ffffff 10%), color-mix(in srgb, var(--accent-2), #000000 8%));
}

.right-menu-item span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  color: color-mix(in srgb, var(--accent), #ffffff 12%);
  background: color-mix(in srgb, var(--accent), transparent 86%);
  font-size: 22px;
  font-weight: 900;
}

.right-menu-item.is-active span {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
}

.right-menu-item strong {
  min-width: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 880;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.right-menu-item i {
  color: currentColor;
  font-size: 26px;
  font-style: normal;
  line-height: 1;
  opacity: 0.72;
}

.sheet-primary-button {
  min-height: 52px;
  border: 0;
  border-radius: 18px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 28px color-mix(in srgb, var(--accent), transparent 72%);
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
}

.sheet-primary-button.secondary {
  color: var(--text);
  background: color-mix(in srgb, var(--card-solid), transparent 5%);
  border: 1px solid var(--line);
  box-shadow: none;
}

.operation-sheet-backdrop,
.operation-category-backdrop {
  position: fixed;
  inset: 0;
  z-index: 46;
  display: grid;
  align-items: end;
  padding: 14px;
  background: var(--sheet-backdrop);
  backdrop-filter: blur(10px);
}

.operation-category-backdrop {
  z-index: 52;
}

.operation-sheet-backdrop[hidden],
.operation-category-backdrop[hidden],
.toast[hidden] {
  display: none;
}

.operation-sheet,
.operation-category-sheet {
  width: min(100%, 430px);
  max-height: min(86vh, 720px);
  margin: 0 auto;
  padding: 10px 28px max(20px, env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-radius: 30px 30px 26px 26px;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--accent), transparent 86%), transparent 22%),
    var(--sheet-surface);
  box-shadow: var(--shadow);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(var(--sheet-drag, 0px));
}

.operation-category-sheet {
  max-height: min(68vh, 520px);
  padding-inline: 18px;
}

.operation-sheet-handle {
  width: 48px;
  height: 5px;
  margin: 2px auto 22px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent-2), #ffffff 28%));
  box-shadow: 0 0 18px rgba(126, 87, 255, 0.36);
}

.operation-sheet-heading {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.operation-sheet-heading h2 {
  grid-column: 2;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 1.6px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-sheet-close {
  grid-column: 3;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--text);
  background: transparent;
  font-size: 31px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

.operation-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  min-height: 58px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted), transparent 88%);
}

.operation-type-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  color: rgba(255, 255, 255, 0.92);
  background: transparent;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.18s ease, filter 0.18s ease, transform 0.18s ease;
}

.operation-type-button strong {
  font: inherit;
}

.operation-type-button.expense {
  background: linear-gradient(135deg, #ff5148, #ff1f6d);
}

.operation-type-button.income {
  background: linear-gradient(135deg, #00a6a3, #20b15d);
}

.operation-type-button.is-active {
  opacity: 1;
  filter: saturate(1.18) brightness(1.06);
  box-shadow: inset 0 -14px 34px rgba(255, 255, 255, 0.10);
}

.operation-type-button:active {
  transform: scale(0.985);
}

.operation-amount-field {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 24px 0 18px;
}

.operation-amount-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: clamp(48px, 15vw, 68px);
  line-height: 1;
  font-weight: 450;
  letter-spacing: 0;
  text-align: center;
  outline: 0;
}

.operation-amount-field input::placeholder {
  color: color-mix(in srgb, var(--text), transparent 72%);
}

.operation-amount-field span {
  width: 78px;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, #7d2eff, #9f7dff);
  box-shadow: 0 0 16px rgba(125, 46, 255, 0.52);
}

.operation-form-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--sheet-row);
  box-shadow: var(--soft-shadow);
}

.operation-form-row {
  display: grid;
  grid-template-columns: 44px minmax(74px, 0.82fr) minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.operation-form-row + .operation-form-row {
  border-top: 1px solid var(--line);
}

button.operation-form-row {
  cursor: pointer;
}

.operation-row-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
}

.operation-row-icon.category {
  background: linear-gradient(135deg, #ff4f45, #ff246d);
}

.operation-row-icon.date {
  background: linear-gradient(135deg, #932eff, #4e5cff);
}

.operation-row-icon.note {
  background: linear-gradient(135deg, #4e7bff, #2456ff);
}

.operation-row-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.operation-form-row strong {
  min-width: 0;
  color: color-mix(in srgb, var(--text), transparent 12%);
  font-size: 15px;
  font-weight: 760;
}

.operation-row-value,
.operation-note-input {
  min-width: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: 15px;
  font-weight: 760;
  text-align: right;
  outline: 0;
}

.operation-row-value,
.operation-note-input {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-note-input::placeholder {
  color: color-mix(in srgb, var(--muted), transparent 8%);
}

.operation-row-chevron {
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
}

.operation-sheet-error {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--expense), transparent 64%);
  border-radius: 14px;
  color: color-mix(in srgb, var(--expense), var(--text) 12%);
  background: color-mix(in srgb, var(--expense), transparent 90%);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.operation-save-button {
  width: 100%;
  min-height: 62px;
  margin-top: 14px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #8c22ff, #2e7bff);
  box-shadow: 0 18px 34px rgba(61, 96, 255, 0.32), 0 14px 30px rgba(142, 34, 255, 0.24);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1.4px;
  cursor: pointer;
}

.operation-save-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.limit-form-card {
  margin-top: 4px;
}

.limit-amount-field {
  margin: 16px 0 18px;
}

#limitSheet .operation-sheet-heading {
  grid-template-columns: 1fr 42px;
  margin-bottom: 22px;
}

#limitSheet .operation-sheet-heading h2 {
  grid-column: 1;
  font-size: 25px;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
}

#limitSheet .operation-sheet-close {
  width: 42px;
  height: 42px;
  color: #ffffff;
  background: color-mix(in srgb, var(--accent), transparent 78%);
  font-size: 28px;
}

#limitSheet .operation-form-card {
  border-radius: 16px;
}

#limitSheet .operation-amount-field input {
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--sheet-row);
  font-size: 20px;
  font-weight: 820;
  text-align: left;
}

#limitSheet .operation-amount-field span {
  display: none;
}

#limitSheet .operation-save-button {
  border-radius: 16px;
  letter-spacing: 0;
  text-transform: none;
}

.limit-period-block {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.limit-period-block > strong {
  color: color-mix(in srgb, var(--text), transparent 14%);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.limit-period-toggle {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted), transparent 90%);
}

.limit-period-button {
  border: 0;
  color: color-mix(in srgb, var(--text), transparent 28%);
  background: transparent;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.limit-period-button.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, #8c22ff, #2e7bff);
  box-shadow: 0 12px 28px rgba(61, 96, 255, 0.24);
}

.limit-period-button:active {
  transform: scale(0.985);
}

.operation-sheet-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  color: color-mix(in srgb, var(--muted), transparent 8%);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.operation-sheet-hint span:last-child {
  font-size: 22px;
  line-height: 1;
}

.operation-category-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  max-height: min(52vh, 390px);
  padding: 2px 0 8px;
}

.operation-category-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--text);
  background: color-mix(in srgb, var(--card-solid), transparent 4%);
  font-size: 15px;
  font-weight: 820;
  text-align: left;
  cursor: pointer;
}

.operation-category-option.is-selected {
  border-color: color-mix(in srgb, var(--accent), transparent 42%);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent), transparent 90%);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: calc(96px + env(safe-area-inset-bottom));
  left: 18px;
  z-index: 64;
  display: grid;
  width: min(calc(100% - 36px), 360px);
  min-height: 48px;
  margin: 0 auto;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 72%);
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(109, 92, 255, 0.96), rgba(47, 123, 255, 0.96));
  box-shadow: 0 16px 36px rgba(34, 42, 78, 0.26);
  font-size: 14px;
  font-weight: 850;
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition:
    opacity var(--motion-duration-fast) var(--motion-ease),
    transform var(--motion-duration) var(--motion-ease);
  pointer-events: none;
}

.toast.motion-active {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
}

.toast.is-closing {
  opacity: 0;
  transform: translate3d(0, 6px, 0);
}

.is-loading .skeleton-target {
  position: relative;
  overflow: hidden;
}

.is-loading .skeleton-target::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

@keyframes pull-refresh-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1118;
    --card: rgba(24, 29, 38, 0.82);
    --card-solid: #151a22;
    --text: #f4f7fb;
    --muted: #8e98aa;
    --line: rgba(221, 230, 255, 0.10);
    --sheet-surface: color-mix(in srgb, var(--card-solid), transparent 2%);
    --sheet-row: color-mix(in srgb, var(--card-solid), transparent 7%);
    --sheet-backdrop: rgba(4, 7, 16, 0.42);
    --shadow: 0 18px 52px rgba(0, 0, 0, 0.34);
    --soft-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  }

  body {
    background:
      radial-gradient(circle at 85% -10%, rgba(109, 92, 255, 0.25), transparent 32%),
      linear-gradient(180deg, #0b0f16, var(--bg));
  }
}

body.tg-dark {
  --bg: #0d1118;
  --card: rgba(24, 29, 38, 0.82);
  --card-solid: #151a22;
  --text: #f4f7fb;
  --muted: #8e98aa;
  --line: rgba(221, 230, 255, 0.10);
  --sheet-surface: color-mix(in srgb, var(--card-solid), transparent 2%);
  --sheet-row: color-mix(in srgb, var(--card-solid), transparent 7%);
  --sheet-backdrop: rgba(4, 7, 16, 0.42);
  --shadow: 0 18px 52px rgba(0, 0, 0, 0.34);
  --soft-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

body.tg-light {
  --bg: #f7f8fc;
  --card: rgba(255, 255, 255, 0.88);
  --card-solid: #ffffff;
  --text: #141824;
  --muted: #7c8497;
  --line: rgba(121, 132, 160, 0.18);
  --sheet-surface: color-mix(in srgb, var(--card-solid), transparent 3%);
  --sheet-row: color-mix(in srgb, var(--card-solid), transparent 8%);
  --sheet-backdrop: rgba(6, 10, 20, 0.24);
  --shadow: 0 18px 48px rgba(34, 42, 78, 0.14);
  --soft-shadow: 0 10px 28px rgba(34, 42, 78, 0.09);
}

@media (max-width: 360px) {
  .app-shell {
    padding-inline: 14px;
  }

  .balance {
    font-size: 34px;
  }

  .budgets-title h1 {
    font-size: 34px;
  }

  .budgets-hero-card {
    padding: 18px;
  }

  .budgets-hero-main {
    grid-template-columns: minmax(0, 1fr) 92px;
  }

  .budgets-wallet {
    width: 92px;
    height: 78px;
  }

  .budgets-hero-main h2 {
    margin-bottom: 22px;
    font-size: 24px;
  }

  .budgets-hero-main b {
    font-size: 30px;
  }

  .limits-title h1 {
    font-size: 34px;
  }

  .limits-overview-content {
    grid-template-columns: 1fr;
  }

  .limits-ring {
    justify-self: center;
  }

  .limits-overview-stats {
    padding-left: 0;
    border-left: 0;
  }

  .limits-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .limits-add-button {
    justify-content: center;
  }

  .limit-card {
    grid-template-columns: 44px minmax(0, 1fr) 16px;
    gap: 10px;
    padding: 12px;
  }

  .limit-card-icon {
    width: 44px;
    height: 44px;
  }

  .budget-list-card {
    grid-template-columns: 50px minmax(0, 1fr) auto 10px;
    gap: 9px;
  }

  .budget-list-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }

  .budget-active-check {
    display: none;
  }

  .budgets-actions,
  .budgets-empty-card {
    grid-template-columns: 1fr;
  }

  .budgets-empty-card button {
    width: 100%;
  }

  .sparkline-chart {
    right: 14px;
    bottom: 22px;
    width: 104px;
    height: 54px;
  }

  .metric-card strong {
    font-size: 18px;
  }

  .detail-bar h1 {
    font-size: 20px;
  }

  .analytics-hero {
    padding: 18px;
  }

  .analytics-hero-copy {
    padding-right: 108px;
  }

  .analytics-hero-copy strong {
    font-size: 28px;
  }

  .analytics-sparkline {
    right: 12px;
    width: 116px;
  }

  .analytics-hero-stats {
    grid-template-columns: 1fr;
  }

  .analytics-category-layout.has-donut {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .report-ai-hero {
    grid-template-columns: 1fr 82px;
    padding: 18px 14px;
  }

  .report-ai-copy p {
    font-size: 14px;
  }

  .report-ai-bot {
    width: 82px;
    height: 82px;
  }

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

  .report-metric-card {
    min-height: 104px;
    padding-inline: 8px;
  }

  .report-metric-card strong {
    font-size: 16px;
  }

  .report-insights-grid,
  .report-grid-row,
  .report-category-layout {
    grid-template-columns: 1fr;
  }

  .report-category-layout {
    justify-items: center;
  }

  .report-categories {
    width: 100%;
  }

  .report-period-sheet {
    padding-inline: 16px;
  }

  .report-period-heading h2 {
    font-size: 20px;
  }

  .report-period-option {
    min-height: 78px;
    grid-template-columns: 50px minmax(0, 1fr) 26px;
  }

  .date-picker-sheet {
    padding-inline: 16px;
  }

  .date-picker-weekdays,
  .date-picker-grid {
    gap: 5px;
  }

  .date-picker-day {
    border-radius: 12px;
    font-size: 13px;
  }

  .analytics-category-layout.has-donut .category-list {
    width: 100%;
  }

  .actions-grid button {
    font-size: 12px;
  }

  .operation-sheet {
    padding-inline: 18px;
  }

  .operation-sheet-heading h2 {
    font-size: 14px;
  }

  .operation-form-row {
    grid-template-columns: 40px minmax(66px, 0.8fr) minmax(0, 1fr) 14px;
    gap: 9px;
    padding-inline: 10px;
  }

  .operation-row-icon {
    width: 40px;
    height: 40px;
  }

  .operation-form-row strong,
  .operation-row-value,
  .operation-note-input {
    font-size: 13px;
  }

  .categories-title h1 {
    font-size: 32px;
  }

  .categories-mode-card {
    grid-template-columns: 50px minmax(0, 1fr) 52px;
    gap: 10px;
    padding: 14px;
  }

  .categories-mode-icon,
  .category-card-icon {
    width: 50px;
    height: 50px;
  }

  .category-card {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .category-card-meta {
    grid-column: 2;
    justify-content: space-between;
  }

  .bottom-nav {
    width: calc(100% - 16px);
    padding: 7px;
  }

  .bottom-nav-indicator {
    top: 7px;
    bottom: 7px;
  }

  .nav-item {
    min-height: 58px;
  }

  .nav-item strong {
    font-size: 10px;
  }
}

/* -------------------------------------------------------------------------- */
/* Onboarding (premium fintech, glass, mobile-first)                            */
/* -------------------------------------------------------------------------- */

body.onboarding-active {
  overflow: hidden;
  touch-action: none;
}

body.onboarding-active .app-shell,
body.onboarding-active .bottom-nav {
  display: none !important;
}

body.onboarding-active .pull-refresh-indicator {
  visibility: hidden;
  pointer-events: none;
}

.onboarding-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.onboarding-screen[hidden] {
  display: none !important;
}

.onboarding-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 80% at 50% -10%, rgba(109, 92, 255, 0.28), transparent 45%),
    radial-gradient(ellipse 90% 60% at 90% 70%, rgba(47, 123, 255, 0.22), transparent 42%),
    radial-gradient(ellipse 70% 50% at 12% 85%, rgba(167, 139, 255, 0.14), transparent 40%),
    linear-gradient(180deg, var(--bg), rgba(109, 92, 255, 0.06));
  pointer-events: none;
}

body.tg-dark .onboarding-backdrop {
  background:
    radial-gradient(ellipse 110% 75% at 48% -8%, rgba(121, 111, 255, 0.38), transparent 42%),
    radial-gradient(ellipse 85% 55% at 92% 72%, rgba(71, 142, 255, 0.26), transparent 46%),
    radial-gradient(ellipse 65% 48% at 10% 88%, rgba(167, 139, 255, 0.12), transparent 42%),
    linear-gradient(180deg, var(--bg), rgba(20, 22, 34, 0.92));
}

.onboarding-inner {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(100%, 420px);
  align-content: start;
  gap: 10px;
}

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

.onboarding-skip {
  justify-self: center;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.22s ease, opacity 0.22s ease;
}

.onboarding-skip:active {
  opacity: 0.72;
}

.onboarding-card {
  display: grid;
  gap: 20px;
  padding: 28px 22px 26px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow:
    0 24px 72px rgba(62, 52, 168, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

body.tg-dark .onboarding-card {
  background: rgba(24, 29, 38, 0.56);
  box-shadow:
    0 26px 72px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.onboarding-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-x;
  border-radius: 18px;
}

.onboarding-track::-webkit-scrollbar {
  display: none;
}

.onboarding-slide {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  gap: 22px;
  padding: 4px 2px 2px;
  min-height: min(58vh, 420px);
  align-content: start;
}

.onboarding-copy {
  display: grid;
  gap: 14px;
  text-align: center;
}

.onboarding-title {
  margin: 0;
  font-size: clamp(24px, 6.2vw, 28px);
  font-weight: 880;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text);
}

.onboarding-subtitle {
  margin: 0;
  max-width: 34ch;
  margin-inline: auto;
  color: var(--muted);
  font-size: 15px;
  font-weight: 640;
  line-height: 1.45;
  white-space: pre-line;
}

.onboarding-visual {
  display: grid;
  place-items: center;
  min-height: 168px;
}

.onboarding-visual-hero {
  min-height: 200px;
}

.onboarding-glow-card {
  display: grid;
  place-items: center;
  width: min(100%, 280px);
  min-height: 152px;
  padding: 28px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 72% 18%, rgba(255, 255, 255, 0.72), transparent 42%),
    linear-gradient(145deg, rgba(109, 92, 255, 0.55), rgba(47, 123, 255, 0.38));
  box-shadow:
    0 28px 64px rgba(79, 64, 200, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

body.tg-dark .onboarding-glow-card {
  background:
    radial-gradient(circle at 70% 16%, rgba(255, 255, 255, 0.12), transparent 45%),
    linear-gradient(145deg, rgba(88, 72, 220, 0.65), rgba(36, 88, 200, 0.45));
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.onboarding-glow-card-final {
  min-height: 140px;
  background:
    radial-gradient(circle at 48% 20%, rgba(255, 255, 255, 0.5), transparent 40%),
    linear-gradient(145deg, rgba(109, 92, 255, 0.62), rgba(47, 123, 255, 0.48));
}

.onboarding-final-mark {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 50%;
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 12px 32px rgba(0, 0, 0, 0.2);
}

.onboarding-hero-logo {
  max-width: 160px;
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
}

.onboarding-chat {
  display: grid;
  gap: 10px;
  width: min(100%, 300px);
  justify-items: stretch;
}

.onboarding-bubble {
  display: inline-block;
  justify-self: end;
  max-width: 100%;
  padding: 14px 18px;
  border-radius: 20px 20px 8px 20px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  background: linear-gradient(135deg, rgba(109, 92, 255, 0.95), rgba(47, 123, 255, 0.88));
  box-shadow: 0 14px 36px rgba(79, 64, 200, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.onboarding-income-cards {
  display: grid;
  gap: 12px;
  width: min(100%, 300px);
}

.onboarding-income-card {
  padding: 16px 20px;
  border-radius: 18px;
  border: 1px solid rgba(36, 200, 120, 0.35);
  color: var(--text);
  font-size: 16px;
  font-weight: 780;
  background: rgba(54, 220, 150, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 12px 32px rgba(36, 180, 112, 0.12);
}

body.tg-dark .onboarding-income-card {
  background: rgba(36, 200, 120, 0.12);
  border-color: rgba(54, 220, 150, 0.28);
}

.onboarding-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(100%, 300px);
}

.onboarding-mini-tile {
  display: grid;
  min-height: 60px;
  place-items: center;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 820;
  background: rgba(255, 255, 255, 0.22);
}

body.tg-dark .onboarding-mini-tile {
  background: rgba(255, 255, 255, 0.06);
}

.onboarding-mini-tile-wide {
  grid-column: span 2;
}

.onboarding-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.onboarding-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(124, 132, 160, 0.45);
  cursor: pointer;
  transition:
    transform var(--motion-duration) var(--motion-ease),
    width var(--motion-duration-slow) var(--motion-spring),
    opacity var(--motion-duration-fast) var(--motion-ease),
    background var(--motion-duration-fast) var(--motion-ease);
}

.onboarding-dot.is-active {
  width: 24px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 1;
}

.onboarding-dot:active {
  transform: scale(0.94);
}

.onboarding-cta {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 18px;
  color: #ffffff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 860;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow:
    0 18px 44px rgba(79, 64, 200, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition:
    transform var(--motion-duration-fast) var(--motion-ease),
    filter var(--motion-duration-fast) var(--motion-ease),
    box-shadow var(--motion-duration-fast) var(--motion-ease);
}

.onboarding-cta:active {
  transform: scale(0.98);
  opacity: 0.92;
}

/* -------------------------------------------------------------------------- */
/* Hidden admin panel                                                           */
/* -------------------------------------------------------------------------- */

.admin-screen {
  gap: 16px;
  padding-bottom: 96px;
}

.admin-screen.is-detail-open {
  overflow: hidden;
}

.admin-topbar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.admin-back-button,
.admin-danger-button,
.admin-delete-button,
.admin-confirm-cancel,
.admin-confirm-delete,
.admin-detail-close,
.admin-collapse-header {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.admin-back-button {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  color: var(--text);
  background: var(--card);
  box-shadow: var(--soft-shadow);
}

.admin-detail-close {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  color: var(--text);
  background: color-mix(in srgb, var(--card), transparent 12%);
}

.admin-kicker {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-topbar h1 {
  margin: 0;
  color: var(--text);
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.admin-panel,
.admin-detail-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--card), transparent 8%);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.admin-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-section-head > div {
  min-width: 0;
}

.admin-section-head h2,
.admin-detail-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  letter-spacing: -0.02em;
}

.admin-section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-section-head span {
  display: inline-grid;
  min-width: 32px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent), transparent 88%);
  font-size: 12px;
  font-weight: 900;
}

.admin-search-input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  color: var(--text);
  background: color-mix(in srgb, var(--bg), var(--card) 55%);
  font-size: 14px;
  font-weight: 700;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-user-card,
.admin-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--text);
  background: color-mix(in srgb, var(--card), transparent 18%);
}

.admin-user-card {
  display: grid;
  gap: 5px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.admin-user-card strong,
.admin-row strong {
  font-size: 14px;
  font-weight: 850;
}

.admin-user-card span,
.admin-row span,
.admin-user-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-detail-grid {
  display: grid;
  gap: 12px;
}

.admin-detail-panel {
  position: fixed;
  inset: max(10px, env(safe-area-inset-top)) 10px max(82px, env(safe-area-inset-bottom)) 10px;
  z-index: 32;
  align-content: start;
  overflow: auto;
  opacity: 0;
  transform: translate3d(16px, 0, 0) scale(0.985);
  transition:
    opacity var(--motion-duration-fast) var(--motion-ease),
    transform var(--motion-duration-slow) var(--motion-spring);
}

.admin-detail-panel.motion-active {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.admin-detail-panel[hidden] {
  display: none !important;
}

.admin-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-detail-danger-zone {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

.admin-detail-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.admin-collapse-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.admin-collapse-header span {
  font-size: 15px;
  font-weight: 900;
}

.admin-collapse-header b {
  display: inline-grid;
  min-width: 30px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent), transparent 88%);
  font-size: 12px;
  font-weight: 900;
}

.admin-collapse-header i {
  color: var(--muted);
  font-style: normal;
  transition: transform 0.18s ease;
}

.admin-collapsible.is-collapsed .admin-collapse-header i {
  transform: rotate(-90deg);
}

.admin-collapsible.is-collapsed [data-admin-section-body],
.admin-collapsible.is-collapsed .admin-empty {
  display: none;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.admin-operation-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.admin-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-row b.income {
  color: var(--income);
}

.admin-row b.expense {
  color: var(--expense);
}

.admin-danger-button,
.admin-delete-button,
.admin-confirm-delete {
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, #ff5864, #ff8f62);
  font-size: 12px;
  font-weight: 850;
}

.admin-danger-button {
  min-height: 38px;
  padding: 0 12px;
}

.admin-delete-user-button {
  min-height: 32px;
  padding: 0 10px;
  opacity: 0.82;
  background: linear-gradient(135deg, #df2635, #ff5864);
  font-size: 11px;
}

.admin-delete-button {
  min-height: 34px;
  padding: 0 10px;
}

.admin-empty {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.admin-confirm-backdrop,
.admin-pin-backdrop {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(6, 10, 20, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.admin-confirm-backdrop[hidden],
.admin-pin-backdrop[hidden] {
  display: none !important;
}

.admin-confirm-sheet,
.admin-pin-sheet {
  display: grid;
  gap: 14px;
  width: min(100%, 420px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--sheet-surface);
  box-shadow: var(--shadow);
}

.admin-confirm-sheet h2,
.admin-pin-sheet h2 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  letter-spacing: -0.03em;
}

.admin-confirm-sheet p,
.admin-pin-sheet p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.admin-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-confirm-field {
  display: grid;
  gap: 8px;
}

.admin-confirm-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-confirm-field input,
.admin-pin-sheet input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  color: var(--text);
  background: color-mix(in srgb, var(--bg), var(--card) 55%);
  font-size: 16px;
  font-weight: 850;
}

.admin-confirm-cancel,
.admin-confirm-delete {
  min-height: 46px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 900;
}

.admin-confirm-cancel {
  color: var(--text);
  background: color-mix(in srgb, var(--card), transparent 10%);
}

.admin-confirm-delete:disabled {
  cursor: not-allowed;
  filter: grayscale(0.45);
  opacity: 0.46;
}

/* -------------------------------------------------------------------------- */
/* Browser login screen                                                         */
/* -------------------------------------------------------------------------- */

body.login-active {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

body.login-active .app-shell,
body.login-active .bottom-nav,
body.login-active .pull-refresh-indicator {
  display: none !important;
}

body.auth-boot-active .app-shell,
body.auth-boot-active .bottom-nav,
body.auth-boot-active .pull-refresh-indicator {
  display: none !important;
}

body.auth-boot-active {
  overflow: hidden;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  overflow: hidden auto;
  overscroll-behavior: contain;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.login-screen[hidden] {
  display: none !important;
}

.login-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 120% 80% at 50% -8%, rgba(109, 92, 255, 0.32), transparent 48%),
    radial-gradient(ellipse 90% 60% at 92% 68%, rgba(47, 123, 255, 0.24), transparent 44%),
    radial-gradient(ellipse 70% 50% at 8% 88%, rgba(167, 139, 255, 0.14), transparent 42%),
    linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--bg), var(--accent) 8%));
  pointer-events: none;
}

body.tg-dark .login-backdrop {
  background:
    radial-gradient(ellipse 110% 75% at 48% -6%, rgba(121, 111, 255, 0.4), transparent 44%),
    radial-gradient(ellipse 85% 55% at 94% 70%, rgba(71, 142, 255, 0.28), transparent 46%),
    radial-gradient(ellipse 65% 48% at 8% 90%, rgba(167, 139, 255, 0.12), transparent 42%),
    linear-gradient(180deg, var(--bg), rgba(12, 16, 26, 0.96));
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .login-backdrop {
    background:
      radial-gradient(ellipse 110% 75% at 48% -6%, rgba(121, 111, 255, 0.4), transparent 44%),
      radial-gradient(ellipse 85% 55% at 94% 70%, rgba(71, 142, 255, 0.28), transparent 46%),
      radial-gradient(ellipse 65% 48% at 8% 90%, rgba(167, 139, 255, 0.12), transparent 42%),
      linear-gradient(180deg, var(--bg), rgba(12, 16, 26, 0.96));
  }
}

.login-inner {
  display: grid;
  width: min(100%, 420px);
  gap: 20px;
  margin: auto;
  padding: 24px;
}

.login-hero {
  display: grid;
  gap: 14px;
  text-align: center;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto;
}

.login-brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px color-mix(in srgb, var(--accent), transparent 55%));
}

.login-brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent), transparent 62%);
}

.login-brand-name {
  font-size: 28px;
  line-height: 1;
  font-weight: 880;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--accent), transparent 70%));
}

.login-hero-title {
  font-size: clamp(24px, 6.4vw, 30px);
  line-height: 1.1;
  font-weight: 880;
  letter-spacing: -0.02em;
}

.login-hero-subtitle {
  max-width: 36ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: 15px;
  font-weight: 640;
  line-height: 1.45;
}

.login-pwa-hint {
  max-width: 34ch;
  margin: 0 auto;
  color: color-mix(in srgb, var(--accent-2), var(--accent) 50%);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.login-pwa-hint[hidden] {
  display: none !important;
}

.login-card {
  position: relative;
  display: grid;
  gap: 20px;
  margin-top: 10px;
  padding: 30px 20px 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--card), transparent 12%);
  box-shadow:
    0 24px 72px rgba(62, 52, 168, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

body.tg-dark .login-card {
  background: rgba(24, 29, 38, 0.58);
  box-shadow:
    0 26px 72px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .login-card {
    background: rgba(24, 29, 38, 0.58);
    box-shadow:
      0 26px 72px rgba(0, 0, 0, 0.42),
      inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
}

.login-card-lock {
  position: absolute;
  top: 0;
  left: 50%;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  color: color-mix(in srgb, var(--accent-2), var(--accent) 50%);
  background: color-mix(in srgb, var(--card-solid), transparent 6%);
  box-shadow: var(--soft-shadow);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(12px);
}

.login-card-lock svg {
  width: 20px;
  height: 20px;
}

.login-card-copy {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  text-align: center;
}

.login-card-copy h2 {
  font-size: 22px;
  line-height: 1.15;
  font-weight: 860;
  letter-spacing: -0.01em;
}

.login-card-copy p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 640;
  line-height: 1.45;
}

.login-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border: 0;
  border-radius: 18px;
  color: #ffffff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 860;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow:
    0 18px 44px color-mix(in srgb, var(--accent), transparent 58%),
    0 0 32px color-mix(in srgb, var(--accent-2), transparent 72%),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.login-cta:active {
  transform: scale(0.986);
}

.login-cta-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.login-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 4px;
}

.login-feature {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
}

.login-feature-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-2), transparent 8%), var(--accent));
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent), transparent 72%);
}

.login-feature-icon svg {
  width: 18px;
  height: 18px;
}

.login-feature strong {
  font-size: 12px;
  font-weight: 820;
  line-height: 1.2;
}

.login-feature p {
  color: var(--muted);
  font-size: 10px;
  font-weight: 620;
  line-height: 1.35;
}

.login-info {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--card), transparent 18%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.login-info-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  color: color-mix(in srgb, var(--accent-2), var(--accent) 40%);
  background: color-mix(in srgb, var(--accent), transparent 88%);
}

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

.login-info p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 640;
  line-height: 1.45;
}

.login-info-copy {
  display: grid;
  gap: 10px;
}

.login-privacy-wrap {
  margin: 0;
}

.login-privacy-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent), transparent 55%);
}

.login-privacy-link:hover {
  color: color-mix(in srgb, var(--accent), var(--text) 12%);
}

a.settings-row.settings-row-button,
a.profile-privacy-link {
  text-decoration: none;
  color: inherit;
}

a.profile-privacy-link .profile-settings-chevron {
  color: var(--muted);
}

@media (max-width: 360px) {
  .login-inner {
    padding: 20px 16px;
  }

  .login-card {
    padding-inline: 16px;
  }

  .login-feature strong {
    font-size: 11px;
  }

  .login-feature p {
    font-size: 9px;
  }
}

.login-widget-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--sheet-backdrop);
  backdrop-filter: blur(8px);
}

.login-widget-backdrop[hidden] {
  display: none !important;
}

.login-widget-panel {
  display: grid;
  gap: 16px;
  width: min(100%, 360px);
  padding: 22px 20px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}

.login-widget-close {
  justify-self: end;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: color-mix(in srgb, var(--card-solid), transparent 10%);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.login-widget-mount {
  display: flex;
  justify-content: center;
  min-height: 48px;
}

/* -------------------------------------------------------------------------- */
/* Motion system (opacity + transform only)                                     */
/* -------------------------------------------------------------------------- */

.screen.is-entering,
.screen.is-leaving {
  display: block;
}

.screen.is-entering {
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition:
    opacity var(--motion-duration) var(--motion-ease),
    transform var(--motion-duration) var(--motion-ease);
  pointer-events: none;
}

.screen.is-leaving {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition:
    opacity var(--motion-duration-fast) var(--motion-ease),
    transform var(--motion-duration-fast) var(--motion-ease);
  pointer-events: none;
}

.screen.is-entering.motion-active {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.screen.is-leaving.motion-active {
  opacity: 0;
  transform: translate3d(0, -6px, 0);
}

.operation-sheet-backdrop,
.operation-category-backdrop,
.date-picker-backdrop,
.report-period-backdrop,
.sheet-backdrop,
.admin-pin-backdrop,
.admin-confirm-backdrop {
  opacity: 0;
  transition: opacity var(--motion-duration-fast) var(--motion-ease);
}

.operation-sheet-backdrop.motion-active:not(.is-closing),
.operation-category-backdrop.motion-active:not(.is-closing),
.date-picker-backdrop.motion-active:not(.is-closing),
.report-period-backdrop.motion-active:not(.is-closing),
.sheet-backdrop.motion-active:not(.is-closing),
.admin-pin-backdrop.motion-active:not(.is-closing),
.admin-confirm-backdrop.motion-active:not(.is-closing) {
  opacity: 1;
}

.operation-sheet-backdrop.is-closing,
.operation-category-backdrop.is-closing,
.date-picker-backdrop.is-closing,
.report-period-backdrop.is-closing,
.sheet-backdrop.is-closing,
.admin-pin-backdrop.is-closing,
.admin-confirm-backdrop.is-closing {
  opacity: 0;
}

.operation-sheet,
.operation-category-sheet,
.date-picker-sheet,
.report-period-sheet,
.selector-sheet,
.admin-pin-sheet,
.admin-confirm-sheet {
  transform: translate3d(0, 100%, 0);
  transition: transform var(--motion-duration-slow) var(--motion-spring);
  will-change: transform;
}

.operation-sheet-backdrop.motion-active .operation-sheet,
.operation-sheet-backdrop.motion-active .budget-create-sheet,
.operation-category-backdrop.motion-active .operation-category-sheet,
.date-picker-backdrop.motion-active .date-picker-sheet,
.report-period-backdrop.motion-active .report-period-sheet,
.sheet-backdrop.motion-active .selector-sheet,
.admin-pin-backdrop.motion-active .admin-pin-sheet,
.admin-confirm-backdrop.motion-active .admin-confirm-sheet {
  transform: translate3d(0, var(--sheet-drag, 0px), 0);
}

.operation-sheet-backdrop.is-closing .operation-sheet,
.operation-sheet-backdrop.is-closing .budget-create-sheet,
.operation-category-backdrop.is-closing .operation-category-sheet,
.date-picker-backdrop.is-closing .date-picker-sheet,
.report-period-backdrop.is-closing .report-period-sheet,
.sheet-backdrop.is-closing .selector-sheet,
.admin-pin-backdrop.is-closing .admin-pin-sheet,
.admin-confirm-backdrop.is-closing .admin-confirm-sheet {
  transform: translate3d(0, 100%, 0);
  transition: transform var(--motion-duration-fast) var(--motion-ease);
}

.tap-feedback,
.metric-button,
.budgets-hero-card,
.limit-card,
.operation,
.nav-item,
.menu-button,
.settings-button,
.settings-row-button,
.quick-action,
.report-period-option,
.selector-option,
.sheet-primary-button,
.sheet-close,
.operation-sheet-close,
.operation-type-button,
.limit-period-button,
.category-card,
.budget-card,
.onboarding-cta {
  transition:
    transform var(--motion-duration-fast) var(--motion-ease),
    opacity var(--motion-duration-fast) var(--motion-ease);
}

.tap-feedback:active,
.metric-button:active,
.budgets-hero-card:active,
.limit-card:active,
.operation:active,
.nav-item:active,
.menu-button:active,
.settings-button:active,
.settings-row-button:active,
.quick-action:active,
.report-period-option:active,
.selector-option:active,
.sheet-primary-button:active,
.sheet-close:active,
.operation-sheet-close:active,
.operation-type-button:active,
.limit-period-button:active,
.category-card:active,
.budget-card:active {
  transform: scale(0.98);
  opacity: 0.92;
}

.menu-button:active {
  transform: translateY(-4px) scale(0.98);
}

.onboarding-track {
  scroll-behavior: smooth;
}

/* -------------------------------------------------------------------------- */
/* Support chat                                                               */
/* -------------------------------------------------------------------------- */

.support-screen {
  display: none;
  padding-top: 4px;
}

.support-screen.is-active {
  display: block;
}

.support-chat-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: calc(100dvh - 24px);
  gap: 10px;
}

.support-my-tickets {
  display: grid;
  gap: 10px;
}

.support-my-tickets[hidden] {
  display: none !important;
}

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

.support-my-tickets-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
}

.support-new-ticket-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: color-mix(in srgb, var(--card), transparent 10%);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.support-new-ticket-button.is-secondary {
  width: 100%;
  min-height: 44px;
  border-radius: 16px;
}

.support-tickets-list {
  display: grid;
  gap: 8px;
  max-height: min(42vh, 360px);
  overflow: auto;
  padding-bottom: 2px;
}

.support-ticket-card {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: left;
  color: var(--text);
  background: color-mix(in srgb, var(--card), transparent 12%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

.support-ticket-card-head strong {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.support-ticket-card-type {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.support-ticket-card-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.support-ticket-card-preview {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.support-ticket-expand {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 180ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms cubic-bezier(0.22, 1, 0.36, 1),
    margin-top 180ms cubic-bezier(0.22, 1, 0.36, 1),
    padding-top 180ms cubic-bezier(0.22, 1, 0.36, 1),
    border-top-color 180ms cubic-bezier(0.22, 1, 0.36, 1);
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid transparent;
}

.support-ticket-card.is-expanded .support-ticket-expand {
  max-height: 28rem;
  opacity: 1;
  margin-top: 8px;
  padding-top: 10px;
  border-top-color: color-mix(in srgb, var(--line), transparent 40%);
}

.support-ticket-expand-inner {
  display: grid;
  gap: 12px;
}

.support-ticket-fields {
  margin: 0;
  display: grid;
  gap: 0;
}

.support-ticket-fields dt {
  margin: 10px 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.support-ticket-fields dt:first-child {
  margin-top: 0;
}

.support-ticket-fields dd {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
}

.support-ticket-meta {
  display: grid;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid color-mix(in srgb, var(--line), transparent 55%);
}

.support-ticket-meta p {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.4;
}

.support-ticket-meta span {
  display: inline-block;
  min-width: 5.5rem;
  margin-right: 6px;
  color: var(--muted);
  font-weight: 800;
}

.support-ticket-status {
  display: inline-flex;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  flex-shrink: 0;
}

.support-ticket-status.is-new {
  color: #0f766e;
  background: color-mix(in srgb, #14b8a6, transparent 84%);
}

.support-ticket-status.is-in_progress {
  color: #b45309;
  background: color-mix(in srgb, #f59e0b, transparent 84%);
}

.support-ticket-status.is-resolved {
  color: #475569;
  background: color-mix(in srgb, #94a3b8, transparent 84%);
}

.support-tickets-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.support-chat-section {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 0;
}

.support-chat-section.is-hidden {
  display: none;
}

.support-detail-bar {
  margin-bottom: 4px;
}

.support-chat-body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 10px;
  min-height: 0;
}

.support-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  max-height: min(62dvh, 560px);
  overflow: auto;
  padding: 4px 2px 8px;
  scroll-behavior: smooth;
}

.support-message {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 92%;
}

.support-message.is-user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.support-avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent), #fff 12%), var(--accent));
  box-shadow: var(--soft-shadow);
}

.support-bubble {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 11px 14px;
  color: var(--text);
  background: color-mix(in srgb, var(--card), transparent 10%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--soft-shadow);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
  white-space: pre-wrap;
}

.support-message.is-user .support-bubble {
  border-color: color-mix(in srgb, var(--accent), transparent 55%);
  background: color-mix(in srgb, var(--accent), transparent 82%);
}

.support-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.support-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--text);
  background: color-mix(in srgb, var(--card), transparent 14%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.support-chip:active {
  transform: scale(0.98);
  opacity: 0.92;
}

.support-summary {
  display: grid;
  gap: 10px;
}

.support-summary-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  color: var(--text);
  background: color-mix(in srgb, var(--card), transparent 8%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--soft-shadow);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.support-summary-card dt {
  margin: 8px 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.support-summary-card dt:first-child {
  margin-top: 0;
}

.support-summary-card dd {
  margin: 0;
}

.support-submit-ticket {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent), #fff 8%), var(--accent));
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.support-submit-ticket:disabled {
  opacity: 0.6;
  cursor: default;
}

.support-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: end;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}

.support-input-wrap {
  display: block;
}

.support-input-wrap textarea {
  width: 100%;
  min-height: 46px;
  max-height: 120px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  outline: none;
  color: var(--text);
  background: color-mix(in srgb, var(--card), transparent 12%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
}

.support-send-button {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: var(--accent);
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: var(--soft-shadow);
}

.support-composer.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.admin-support-panel {
  margin-bottom: 12px;
}

.admin-support-ticket-card {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--card), transparent 18%);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

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

.admin-support-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.admin-support-status.is-new {
  color: #0f766e;
  background: color-mix(in srgb, #14b8a6, transparent 84%);
}

.admin-support-status.is-in_progress {
  color: #b45309;
  background: color-mix(in srgb, #f59e0b, transparent 84%);
}

.admin-support-status.is-resolved {
  color: #475569;
  background: color-mix(in srgb, #94a3b8, transparent 84%);
}

.admin-support-detail-panel {
  position: fixed;
  inset: max(10px, env(safe-area-inset-top)) 10px max(82px, env(safe-area-inset-bottom)) 10px;
  z-index: 40;
  align-content: start;
  overflow: auto;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(16px, 0, 0) scale(0.985);
  transition:
    opacity var(--motion-duration-fast) var(--motion-ease),
    transform var(--motion-duration-slow) var(--motion-spring);
}

.admin-support-detail-panel[hidden] {
  display: none !important;
}

.admin-support-detail-panel.motion-active {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
}

.admin-screen.is-support-detail-open {
  overflow: hidden;
}

.admin-support-detail-body {
  display: grid;
  gap: 12px;
}

.admin-support-meta-card,
.admin-support-messages-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: color-mix(in srgb, var(--card), transparent 14%);
}

.admin-support-message-row {
  display: grid;
  gap: 4px;
  padding: 8px 0;
  border-top: 1px solid color-mix(in srgb, var(--line), transparent 35%);
}

.admin-support-message-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.admin-support-status-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.admin-support-status-button {
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card), transparent 10%);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.admin-support-status-button.is-resolve {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent), #fff 8%), var(--accent));
}

.admin-support-status-button.tap-feedback,
.admin-support-ticket-card.tap-feedback,
.support-ticket-card.tap-feedback,
.support-new-ticket-button.tap-feedback {
  transition: transform 100ms ease, opacity 100ms ease;
}

.admin-support-status-button.tap-feedback:active,
.admin-support-ticket-card.tap-feedback:active,
.support-ticket-card.tap-feedback:active,
.support-new-ticket-button.tap-feedback:active {
  transform: scale(0.97);
  opacity: 0.85;
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* -------------------------------------------------------------------------- */
/* Personal data consent (gate before main app)                               */
/* -------------------------------------------------------------------------- */

body.consent-active {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

body.consent-active .app-shell,
body.consent-active .bottom-nav,
body.consent-active .pull-refresh-indicator {
  display: none !important;
}

.consent-screen[hidden] {
  display: none !important;
}

.consent-screen {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease;
}

.consent-screen.consent-screen--visible {
  opacity: 1;
  pointer-events: auto;
}

.consent-screen__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(160%) blur(22px);
  -webkit-backdrop-filter: saturate(160%) blur(22px);
}

body.tg-dark .consent-screen__backdrop {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
}

.consent-screen__inner {
  position: relative;
  z-index: 1;
  width: min(100%, 400px);
}

.consent-screen.consent-screen--visible .consent-screen__inner {
  animation: consent-card-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes consent-card-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.consent-screen__card {
  display: grid;
  gap: 16px;
  padding: 26px 22px 22px;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 22%);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  box-shadow:
    0 22px 60px color-mix(in srgb, #000, transparent 78%),
    0 1px 0 color-mix(in srgb, #fff, transparent 92%) inset;
  text-align: center;
}

body.tg-dark .consent-screen__card {
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.45),
    0 1px 0 color-mix(in srgb, #fff, transparent 96%) inset;
}

.consent-screen__title {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}

.consent-screen__text {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted);
}

.consent-screen__link {
  justify-self: center;
  font-size: 15px;
  font-weight: 650;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent), transparent 55%);
  padding-bottom: 1px;
}

.consent-screen__link:active {
  opacity: 0.82;
}

.consent-screen__accept {
  margin-top: 4px;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0.01em;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent), #fff 10%), var(--accent));
  box-shadow: 0 10px 28px color-mix(in srgb, var(--accent), transparent 55%);
  transition: transform 0.18s ease, opacity 0.18s ease, filter 0.18s ease;
}

.consent-screen__accept:disabled {
  cursor: wait;
  opacity: 0.72;
  filter: grayscale(0.08);
}

.consent-screen__accept:not(:disabled):active {
  transform: scale(0.98);
  opacity: 0.92;
}

@media (prefers-reduced-motion: reduce) {
  .consent-screen {
    transition: none;
  }

  .consent-screen__inner {
    animation: none;
  }
}
