:root {
  --bg: #070b1b;
  --bg-soft: #0a1024;
  --panel: rgba(15, 22, 48, .86);
  --panel-2: rgba(24, 34, 71, .92);
  --text: #f8fbff;
  --muted: #aab7d7;
  --line: rgba(255, 255, 255, .13);
  --cyan: #23e8ff;
  --blue: #6ea8ff;
  --pink: #ff5cc8;
  --purple: #8c5cff;
  --green: #35f2a1;
  --orange: #ffb45c;
  --danger: #ff647c;
  --gold: #ffd166;
  --shadow: 0 24px 70px rgba(0, 0, 0, .38);
  --radius: 24px;
}

.light {
  --bg: #f6f8ff;
  --bg-soft: #edf3ff;
  --panel: rgba(255, 255, 255, .94);
  --panel-2: #eef3ff;
  --text: #10162f;
  --muted: #56617c;
  --line: rgba(16, 22, 47, .14);
  --shadow: 0 20px 55px rgba(31, 53, 94, .13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0, rgba(35, 232, 255, .18), transparent 30rem),
    radial-gradient(circle at 84% 4%, rgba(255, 92, 200, .16), transparent 28rem),
    linear-gradient(135deg, var(--bg), var(--bg-soft));
  font-family: "Aptos", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  perspective: 1400px;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .8), transparent 80%);
}

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

.orb {
  position: absolute;
  display: block;
  width: 18rem;
  height: 18rem;
  border-radius: 999px;
  filter: blur(24px);
  opacity: .42;
  animation: drift 16s ease-in-out infinite alternate;
}

.orb-one {
  top: 8%;
  left: 18%;
  background: radial-gradient(circle, rgba(35, 232, 255, .55), transparent 62%);
}

.orb-two {
  right: 6%;
  top: 22%;
  background: radial-gradient(circle, rgba(255, 92, 200, .42), transparent 64%);
  animation-delay: -5s;
}

.orb-three {
  left: 44%;
  bottom: -8%;
  background: radial-gradient(circle, rgba(255, 209, 102, .28), transparent 68%);
  animation-delay: -9s;
}

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

button {
  cursor: pointer;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(35, 232, 255, .65);
  outline-offset: 3px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  transform-style: preserve-3d;
  --sidebar-width: 330px;
  --sidebar-rail: 128px;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(150deg, rgba(35, 232, 255, .12), transparent 24%),
    linear-gradient(210deg, rgba(255, 92, 200, .14), transparent 28%),
    rgba(7, 11, 27, .82);
  backdrop-filter: blur(24px);
  box-shadow: inset -1px 0 rgba(255, 255, 255, .08), 28px 0 70px rgba(0, 0, 0, .24);
  transform: translateZ(18px);
  overflow-y: auto;
  transition: width .28s ease, transform .28s ease, padding .28s ease, box-shadow .28s ease;
}

.light .sidebar {
  background: rgba(255, 255, 255, .78);
}

.sidebar-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, .055);
  min-width: 0;
}

.brand-logo {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 0 34px rgba(35, 232, 255, .34), 0 14px 30px rgba(0, 0, 0, .28);
  animation: badgeFloat 5s ease-in-out infinite;
}

.brand h1 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -.04em;
}

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

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.sidebar-collapse {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 9px 11px;
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  transition: transform .18s ease, background .18s ease;
}

.sidebar-collapse:hover {
  background: rgba(35, 232, 255, .13);
  transform: translateY(-1px);
}

.blog-page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.blog-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.blog-brand {
  color: var(--text);
  text-decoration: none;
}

.blog-brand span {
  display: grid;
  gap: 4px;
}

.blog-brand small {
  color: var(--muted);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.blog-article {
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px);
}

.blog-article h1 {
  max-width: 800px;
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 6vw, 5rem);
  line-height: .95;
  letter-spacing: -.08em;
}

.blog-article h2 {
  margin: 42px 0 12px;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  letter-spacing: -.05em;
}

.blog-article p,
.blog-article li {
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.75;
}

.blog-article ul {
  padding-left: 1.3rem;
}

.blog-lede {
  color: var(--text) !important;
  font-size: 1.2rem !important;
}

.blog-article blockquote {
  margin: 28px 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--cyan);
  border-radius: 20px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(35, 232, 255, .14), rgba(255, 92, 200, .1));
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -.045em;
}

.blog-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 42px;
}

.nav {
  display: grid;
  gap: 10px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 11px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, .035);
  text-align: left;
  overflow: hidden;
  box-shadow: inset 0 1px rgba(255, 255, 255, .05);
  transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .18), transparent);
  transform: translateX(-110%);
  transition: opacity .18s ease, transform .48s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(35, 232, 255, .18), rgba(140, 92, 255, .16), rgba(255, 92, 200, .13));
  border-color: var(--line);
  box-shadow: 0 16px 36px rgba(35, 232, 255, .1), inset 0 1px rgba(255, 255, 255, .16);
  transform: translateX(5px) translateZ(14px);
}

.nav-link:hover::after,
.nav-link.active::after {
  opacity: 1;
  transform: translateX(110%);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 15px;
  color: #061122;
  background: linear-gradient(135deg, var(--cyan), var(--gold));
  font-size: .72rem;
  font-weight: 1000;
  letter-spacing: .08em;
  box-shadow: 0 10px 24px rgba(35, 232, 255, .18);
}

.nav-link strong,
.nav-link small {
  display: block;
}

.nav-link strong {
  font-size: .95rem;
}

.nav-link small {
  color: var(--muted);
  font-size: .73rem;
  margin-top: 2px;
}

.privacy-card {
  position: static;
  margin-top: auto;
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .06);
}

.quest-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 13px;
  align-items: center;
  margin-top: 18px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 209, 102, .15), rgba(35, 232, 255, .08)),
    rgba(255, 255, 255, .055);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .18), inset 0 1px rgba(255, 255, 255, .12);
}

.quest-ring {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--panel) 45%, transparent 47%),
    conic-gradient(var(--gold), var(--cyan), var(--pink), var(--gold));
  box-shadow: 0 0 28px rgba(255, 209, 102, .2);
}

.quest-ring span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--text);
  background: rgba(7, 11, 27, .72);
  font-size: 1.4rem;
  font-weight: 1000;
}

.quest-label {
  margin: 0 0 3px;
  color: var(--gold);
  font-size: .72rem;
  font-weight: 1000;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.quest-card strong,
.quest-card small {
  display: block;
}

.quest-card small {
  color: var(--muted);
  font-size: .78rem;
}

.xp-progress {
  height: 8px;
  margin: 8px 0;
}

.xp-progress > span {
  background: linear-gradient(90deg, var(--gold), var(--cyan), var(--pink));
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  border: 0;
  background: rgba(2, 6, 18, .56);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease;
}

.privacy-card span,
.muted,
.chart-summary {
  color: var(--muted);
  font-size: .93rem;
}

.main-content {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  padding: 24px;
  transform: translateZ(0);
  transition: max-width .28s ease, padding .28s ease;
}

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

.topbar h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  letter-spacing: -.055em;
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
}

.top-actions,
.inline-actions,
.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 118px;
  justify-content: center;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.icon-btn,
.menu-toggle {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 15px;
  color: var(--text);
  background: var(--panel-2);
  transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease;
}

.primary-btn {
  border: 0;
  color: white;
  font-weight: 800;
  background: linear-gradient(135deg, var(--cyan), var(--purple), var(--pink));
  box-shadow: 0 14px 34px rgba(140, 92, 255, .26);
}

.secondary-btn:hover,
.primary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover,
.menu-toggle:hover {
  transform: translateY(-1px);
  opacity: .96;
}

.danger-btn {
  color: var(--danger);
  background: rgba(255, 100, 124, .15);
}

.menu-toggle-icon {
  position: relative;
  width: 18px;
  height: 12px;
  display: inline-block;
}

.menu-toggle-icon::before,
.menu-toggle-icon::after,
.menu-toggle-icon {
  border-top: 2px solid currentColor;
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
}

.menu-toggle-icon::before {
  top: 4px;
}

.menu-toggle-icon::after {
  top: 10px;
}

.sidebar-collapsed .sidebar {
  width: var(--sidebar-rail);
  padding-inline: 16px;
  overflow-x: hidden;
}

.sidebar-collapsed .brand {
  justify-content: center;
  padding: 8px;
}

.sidebar-collapsed .brand-logo {
  width: 56px;
  height: 56px;
}

.sidebar-collapsed .brand-copy,
.sidebar-collapsed .nav-link span:not(.nav-icon),
.sidebar-collapsed .quest-card > div:not(.quest-ring),
.sidebar-collapsed .privacy-card,
.sidebar-collapsed .sidebar-collapse {
  display: none;
}

.sidebar-collapsed .sidebar-top {
  display: block;
}

.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 10px;
  border-radius: 20px;
}

.sidebar-collapsed .nav-link:hover,
.sidebar-collapsed .nav-link.active {
  transform: translateX(0) scale(1.04);
}

.sidebar-collapsed .quest-card {
  display: grid;
  place-items: center;
  grid-template-columns: 1fr;
  padding: 10px;
}

.sidebar-collapsed .quest-ring {
  width: 62px;
  height: 62px;
}

.card {
  position: relative;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .035));
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.card:hover {
  border-color: rgba(35, 232, 255, .24);
  box-shadow: 0 30px 85px rgba(0, 0, 0, .42), 0 0 34px rgba(35, 232, 255, .08);
  transform: translateY(-2px);
}

.light .card {
  background: var(--panel);
}

.filters {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

.field {
  display: grid;
  gap: 6px;
}

.field.grow {
  flex: 1;
  min-width: 230px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, .07);
  outline: none;
}

.light input,
.light select,
.light textarea {
  background: #f8faff;
}

select option {
  color: #10162f;
  background: #ffffff;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

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

.view {
  display: none;
}

.active-view {
  display: block;
}

.hero-card {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: clamp(18px, 4vw, 42px);
  align-items: center;
  overflow: hidden;
  min-height: 310px;
  background:
    radial-gradient(circle at 78% 42%, rgba(255, 209, 102, .2), transparent 18rem),
    radial-gradient(circle at 55% 20%, rgba(35, 232, 255, .16), transparent 20rem),
    linear-gradient(135deg, rgba(35, 232, 255, .16), rgba(140, 92, 255, .1), rgba(255, 92, 200, .12)),
    rgba(255, 255, 255, .04);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 22px;
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  flex: 1 1 44%;
}

.hero-card h3 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(1.8rem, 4vw, 3.7rem);
  line-height: .98;
  letter-spacing: -.07em;
}

.hero-card p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1rem;
}

.hero-kicker {
  margin: 0 0 10px;
  color: var(--cyan) !important;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hero-actions {
  display: grid;
  gap: 10px;
  min-width: 190px;
  position: relative;
  z-index: 2;
}

.hero-visual {
  position: relative;
  z-index: 1;
  flex: 0 0 min(30vw, 320px);
  height: 260px;
  transform-style: preserve-3d;
  transform: rotateX(58deg) rotateZ(-18deg);
}

.vault-core {
  position: absolute;
  inset: 50%;
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 36px;
  color: white;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(35, 232, 255, .24), rgba(140, 92, 255, .42)),
    rgba(7, 11, 27, .72);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .36), 0 0 42px rgba(35, 232, 255, .18);
  transform: translate(-50%, -50%) rotateZ(18deg) rotateX(-58deg) translateZ(38px);
}

.vault-core small,
.vault-core span {
  color: rgba(255, 255, 255, .72);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.vault-core strong {
  font-size: 3.2rem;
  line-height: 1;
  letter-spacing: -.08em;
}

.coin-orbit {
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  animation: spinOrbit 12s linear infinite;
}

.coin-orbit span {
  position: absolute;
  top: 16px;
  left: 50%;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff6c7, var(--gold) 42%, #c77b1b);
  box-shadow: 0 0 26px rgba(255, 209, 102, .5);
}

.orbit-two {
  inset: 54px;
  animation-duration: 8s;
  animation-direction: reverse;
}

.orbit-two span {
  width: 24px;
  height: 24px;
  background: radial-gradient(circle at 32% 28%, #e9ffff, var(--cyan) 45%, #167a91);
}

@keyframes drift {
  from {
    transform: translate3d(-2rem, 1rem, 0) scale(.95);
  }

  to {
    transform: translate3d(2rem, -1rem, 0) scale(1.08);
  }
}

@keyframes badgeFloat {
  0%,
  100% {
    transform: translateY(0) rotateZ(-1deg);
  }

  50% {
    transform: translateY(-4px) rotateZ(1deg);
  }
}

@keyframes spinOrbit {
  to {
    transform: rotate(360deg);
  }
}

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

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(35, 232, 255, .12), rgba(140, 92, 255, .08));
  min-height: 150px;
  box-shadow: inset 0 1px rgba(255, 255, 255, .1);
  transform-style: preserve-3d;
  transition: transform .2s ease, box-shadow .2s ease;
}

.metric-card:hover {
  transform: translateY(-4px) rotateX(2deg) rotateY(-2deg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .26), 0 0 30px rgba(35, 232, 255, .08);
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -36px;
  top: -36px;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
}

.metric-card.positive {
  background: linear-gradient(135deg, rgba(53, 242, 161, .14), rgba(35, 232, 255, .08));
}

.metric-card.danger {
  background: linear-gradient(135deg, rgba(255, 92, 200, .13), rgba(255, 100, 124, .08));
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  position: relative;
  z-index: 1;
  margin: 10px 0;
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1;
  letter-spacing: -.055em;
}

.grid {
  display: grid;
  gap: 18px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.card-head h3,
.card h3 {
  margin-top: 0;
  letter-spacing: -.035em;
}

.card-head span {
  color: var(--muted);
  font-size: .9rem;
}

.chart-card {
  min-height: 390px;
}

.chart-card canvas,
.print-chart-grid canvas {
  width: 100% !important;
  max-height: 285px;
}

.chart-summary {
  min-height: 1.3rem;
  margin: 10px 0 0;
}

.chart-unavailable canvas {
  display: none !important;
}

.chart-unavailable::after {
  content: "Charts need Chart.js from the CDN. Data summaries remain available when offline.";
  display: block;
  color: var(--muted);
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 16px;
}

.insights-list,
.budget-list,
.rule-list {
  display: grid;
  gap: 10px;
}

.insight,
.budget-item,
.rule-item,
.category-item,
.goal-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .06);
}

.insight {
  display: block;
}

.insight strong,
.positive {
  color: var(--green);
}

.warning {
  color: var(--orange);
}

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

.table-wrap {
  width: 100%;
  overflow: auto;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.amount-expense {
  color: #ff8fa3;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  margin: 2px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(35, 232, 255, .1);
  font-size: .8rem;
}

.pill.income {
  color: var(--green);
  background: rgba(53, 242, 161, .1);
}

.pill.expense {
  color: #ff9caf;
  background: rgba(255, 100, 124, .11);
}

.text-btn {
  border: 0;
  color: var(--cyan);
  background: transparent;
  padding: 4px;
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.mobile-transactions {
  display: none;
}

.transaction-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .06);
}

.transaction-card > div:first-child {
  display: grid;
  gap: 3px;
}

.transaction-card strong {
  display: block;
}

.transaction-card span,
.transaction-card p {
  margin: 0;
  color: var(--muted);
}

.mini-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 16px 0;
}

.mini-form.vertical {
  display: grid;
}

.progress {
  height: 10px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
}

.budget-item.warning .progress > span {
  background: linear-gradient(90deg, var(--orange), var(--pink));
}

.budget-item.danger .progress > span {
  background: linear-gradient(90deg, var(--danger), var(--pink));
}

.mapping-area {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.import-summary,
.backup-note {
  margin-top: 14px;
  color: var(--muted);
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 14px 0;
}

.report-summary div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .05);
}

.print-chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}

.button-stack {
  display: grid;
  gap: 10px;
}

.file-label {
  text-align: center;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 40px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

dialog {
  width: min(900px, 94vw);
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(7px);
}

.dialog-head,
.dialog-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.dialog-head h3 {
  margin: 0;
}

.icon-btn {
  min-width: 42px;
  padding: 5px 11px;
  font-size: 1.2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 950px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 45;
    width: min(330px, 88vw);
    padding: 18px;
    transform: translateX(calc(-100% - 20px));
    transition: transform .25s ease;
  }

  .sidebar.open {
    transform: translateX(0) translateZ(18px);
  }

  .menu-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-collapse {
    display: inline-grid;
  }

  .sidebar-collapsed .sidebar {
    width: min(330px, 88vw);
    padding: 18px;
  }

  .sidebar-collapsed .brand {
    justify-content: flex-start;
    padding: 12px;
  }

  .sidebar-collapsed .brand-logo {
    width: 68px;
    height: 68px;
  }

  .sidebar-collapsed .brand-copy,
  .sidebar-collapsed .nav-link span:not(.nav-icon),
  .sidebar-collapsed .quest-card > div:not(.quest-ring),
  .sidebar-collapsed .privacy-card,
  .sidebar-collapsed .sidebar-collapse {
    display: block;
  }

  .sidebar-collapsed .privacy-card {
    display: grid;
  }

  .sidebar-collapsed .quest-card {
    display: grid;
    grid-template-columns: auto 1fr;
    place-items: initial;
    padding: 15px;
  }

  .sidebar-collapsed .nav-link {
    justify-content: flex-start;
    padding: 11px 12px;
  }

  .two-col,
  .report-summary,
  .print-chart-grid,
  .mapping-area {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

  .top-actions {
    justify-content: flex-end;
  }

  .hero-card {
    display: grid;
  }

  .hero-visual {
    width: min(100%, 340px);
    margin: 0 auto;
    flex-basis: auto;
  }

  .hero-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .stack-mobile {
    display: grid;
  }

  .main-content {
    padding: 16px;
  }

  .chart-card {
    min-height: 340px;
  }
}

@media (max-width: 680px) {
  .topbar,
  .filters,
  .hero-actions {
    display: grid;
  }

  .blog-nav,
  .blog-cta {
    display: grid;
  }

  .hero-visual {
    height: 220px;
    transform: rotateX(56deg) rotateZ(-18deg) scale(.86);
  }

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

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-card strong {
    font-size: 1.65rem;
  }

  .brand-logo {
    width: 54px;
    height: 54px;
  }

  .transaction-table {
    display: none;
  }

  .mobile-transactions {
    display: grid;
    gap: 12px;
  }

  .inline-actions,
  .row-actions {
    gap: 8px;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  .danger-btn {
    width: 100%;
  }

  .menu-toggle {
    width: 100%;
  }

  .row-actions .text-btn {
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media print {
  @page {
    margin: .55in;
  }

  body {
    color: #111;
    background: white;
  }

  body::before,
  .sidebar,
  .topbar,
  .filters,
  .no-print,
  .toast,
  .hero-card {
    display: none !important;
  }

  .main-content {
    max-width: none;
    padding: 0;
  }

  .card {
    padding: 0;
    border: 0;
    box-shadow: none;
    color: #111;
    background: white;
  }

  .view {
    display: none !important;
  }

  #reports {
    display: block !important;
  }

  .report-card {
    border: 0;
  }

  .print-chart-grid {
    grid-template-columns: 1fr 1fr;
    break-inside: avoid;
  }

  canvas {
    max-height: 245px !important;
  }

  table {
    min-width: 0;
    font-size: 11px;
  }

  th,
  td {
    padding: 7px;
  }

  .insight,
  .budget-item,
  .goal-item {
    color: #111;
    background: white;
    border: 1px solid #ddd;
    break-inside: avoid;
  }

  .muted,
  .card-head span,
  .chart-summary {
    color: #555;
  }
}
