:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef3f2;
  color: #243236;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(145, 183, 170, 0.22), transparent 26rem),
    linear-gradient(145deg, #eef3f2 0%, #f7f8f5 58%, #e7eeee 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition: transform 150ms ease, background-color 180ms ease, color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

button:active {
  transform: scale(0.97);
}

.app-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 18px;
  border-right: 1px solid rgba(63, 127, 136, 0.14);
}

.brand-mark {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 26px;
}

.brand-mark strong,
.brand-mark span {
  display: block;
}

.brand-mark span {
  color: #789094;
  font-size: 0.82rem;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #3f7f88;
  color: white;
}

.side-nav nav {
  display: grid;
  gap: 7px;
}

.side-nav button {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 12px 13px;
  border-radius: 8px;
  background: transparent;
  color: #5d7378;
  text-align: left;
}

.side-nav button.active {
  background: #dce9e7;
  color: #2d6870;
  font-weight: 700;
}

.phone-stage {
  width: min(100%, 1160px);
  margin: 0 auto;
  padding: 22px clamp(18px, 4vw, 42px) 42px;
}

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

.eyebrow {
  color: #6f8b90;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 2px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: 0;
}

h2 {
  font-size: 1rem;
  letter-spacing: 0;
}

.icon-button,
.round-action {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: white;
  color: #3f7f88;
  box-shadow: 0 10px 28px rgba(33, 61, 66, 0.08);
}

.screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.65fr);
  gap: 16px;
  align-items: start;
}

.screen.stack {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1040px;
}

.lock-screen {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 22px;
}

.lock-card {
  display: grid;
  gap: 14px;
  width: min(100%, 390px);
  padding: 20px;
  border: 1px solid rgba(68, 102, 107, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 45px rgba(33, 61, 66, 0.1);
}

.lock-card .brand-icon {
  width: 48px;
  height: 48px;
}

.lock-card .primary,
.button-row .primary {
  background: #3f7f88;
  color: white;
}

.form-error {
  color: #b04837;
  font-size: 0.84rem;
  font-weight: 800;
}

.auth-help {
  color: #6b7f83;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.35;
}

.link-button {
  color: #3f7f88;
  background: transparent;
  font-weight: 900;
}

.security-note {
  display: grid;
  gap: 3px;
  padding: 12px;
  border-radius: 8px;
  background: #f3f8f7;
  color: #3f5559;
}

.security-note span {
  color: #6b7f83;
  font-size: 0.78rem;
  font-weight: 800;
}

.notification-strip,
.hero-card,
.panel,
.metric-card,
.mini-card,
.list-card,
.goal-card {
  border: 1px solid rgba(68, 102, 107, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 45px rgba(33, 61, 66, 0.08);
  animation: riseIn 480ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.notification-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 420px);
  padding: 12px 14px;
  background: #3f7f88;
  color: white;
}

.notification-strip span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: white;
  color: #3f7f88;
  font-weight: 800;
}

.notification-strip svg {
  margin-left: auto;
}

.overview-owner-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 560px);
  padding: 8px;
  border: 1px solid rgba(68, 102, 107, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 28px rgba(33, 61, 66, 0.06);
}

.overview-owner-switch > span {
  padding-left: 5px;
  color: #6b7f83;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.overview-owner-switch div {
  display: flex;
  min-width: 0;
  gap: 6px;
  overflow-x: auto;
}

.overview-owner-switch button {
  flex: 0 0 auto;
  padding: 8px 11px;
  border-radius: 8px;
  background: #eef5f4;
  color: #3f5559;
  font-size: 0.78rem;
  font-weight: 900;
}

.overview-owner-switch button.active {
  background: #3f7f88;
  color: white;
}

.hero-card {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 390px;
  padding: 48px 18px 18px;
  overflow: hidden;
  animation-duration: 620ms;
}

.chart-stage {
  --wheel-size: 250px;
  --wheel-top: 102px;
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 372px;
  padding: 16px 0 76px;
}

.wheel-layer {
  position: absolute;
  top: var(--wheel-top);
  left: 50%;
  display: grid;
  place-items: center;
  width: var(--wheel-size);
  transform: translateX(-50%);
}

.income-legend {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  gap: 8px;
  max-width: calc(100% - 24px);
}

.income-legend button {
  display: grid;
  grid-template-columns: 8px 1fr;
  column-gap: 6px;
  row-gap: 1px;
  align-items: center;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(247, 251, 250, 0.9);
  text-align: left;
}

.income-legend button.active {
  background: white;
  box-shadow: 0 8px 18px rgba(33, 61, 66, 0.08);
}

.income-legend small {
  color: #6b7f83;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.income-legend strong {
  grid-column: 2;
  color: #26393d;
  font-size: 0.72rem;
  line-height: 1.1;
  white-space: nowrap;
}

.legend-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.legend-dot.income {
  background: #3f7f88;
}

.legend-dot.expense {
  background: #d7e2e0;
}

.income-legend button:not(.active) .legend-dot {
  background: #d7e2e0;
}

.income-legend button.active .legend-dot {
  background: #3f7f88;
}

.hero-copy {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  display: grid;
  place-items: center;
  align-content: center;
  width: min(72%, 280px);
  margin: 0 auto;
  text-align: center;
  pointer-events: none;
  animation: focusPop 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-copy.quick-refresh {
  animation: quickValueSwap 280ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-copy span,
.hero-copy small,
.mini-card span,
.mini-card small,
.metric-card span,
.metric-card small,
.list-card small,
.goal-card small,
.empty-state span,
.notice-card span,
.toast span {
  color: #6b7f83;
}

.hero-copy strong {
  display: block;
  max-width: none;
  font-size: clamp(1.45rem, 6.4vw, 1.95rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
  white-space: nowrap;
}

.hero-copy strong.debt-value {
  color: #b04837;
}

.income-left-copy span {
  font-size: 0.95rem;
}

.chart-context {
  display: block;
  margin-top: 5px;
  color: #6b7f83;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.ring-wrap {
  width: 100%;
  max-width: 100%;
  animation: ringFloat 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.ring-wrap.wheel-refresh {
  animation: wheelRefresh 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.ring-wrap svg {
  display: block;
  width: 100%;
  transform: rotate(-90deg);
}

.ring-wrap circle {
  fill: none;
  stroke-width: 15;
  stroke-linecap: butt;
}

.ring-segment {
  cursor: pointer;
  transform-origin: 60px 60px;
  animation: ringDraw 760ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: opacity 160ms ease, stroke-width 160ms ease, filter 180ms ease;
}

.ring-segment:hover {
  opacity: 0.86;
  stroke-width: 16;
  filter: drop-shadow(0 5px 8px rgba(63, 127, 136, 0.16));
}

.ring-segment.selected {
  opacity: 0.92;
  stroke-width: 17;
  filter: drop-shadow(0 5px 10px rgba(33, 61, 66, 0.18));
}

.ring-base {
  stroke: #e5edeb;
}

.chart-popout {
  position: absolute;
  left: calc(50% + var(--popout-x));
  top: calc(var(--wheel-top) + (var(--wheel-size) / 2) + var(--popout-y));
  z-index: 3;
  display: grid;
  gap: 2px;
  min-width: 76px;
  max-width: 112px;
  padding: 8px 10px;
  border: 1px solid #dce8e6;
  border-left: 4px solid var(--slice-color);
  border-radius: 8px;
  background: white;
  box-shadow: 0 12px 28px rgba(33, 61, 66, 0.13);
  animation: popoutIn 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.chart-popout::before {
  content: "";
  position: absolute;
  top: 18px;
  width: 12px;
  height: 12px;
  border-bottom: 1px solid #dce8e6;
  border-left: 1px solid #dce8e6;
  background: white;
}

.chart-popout.right-side {
  transform: translate(0, -50%);
}

.chart-popout.left-side {
  transform: translate(-100%, -50%);
}

.chart-popout.top-side {
  transform: translate(-50%, -100%);
}

.chart-popout.bottom-side {
  transform: translate(-50%, 0);
}

.chart-popout.right-side::before {
  left: -8px;
  transform: rotate(45deg);
}

.chart-popout.left-side::before {
  right: -8px;
  left: auto;
  transform: rotate(225deg);
}

.chart-popout.top-side::before {
  bottom: -8px;
  top: auto;
  left: calc(50% - 6px);
  transform: rotate(315deg);
}

.chart-popout.bottom-side::before {
  top: -8px;
  left: calc(50% - 6px);
  transform: rotate(135deg);
}

.chart-popout span {
  color: #60787d;
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1.1;
}

.chart-popout strong {
  color: #203337;
  font-size: 0.95rem;
  line-height: 1.1;
  white-space: nowrap;
}

.expense-chart-legend {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: min(66%, 260px);
  padding: 8px;
  border-radius: 8px;
  background: rgba(247, 251, 250, 0.94);
}

.expense-chart-legend button {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border-radius: 7px;
  color: #31494e;
  font-size: 0.68rem;
  font-weight: 900;
  text-align: left;
}

.expense-chart-legend button.active {
  background: white;
  box-shadow: 0 7px 14px rgba(33, 61, 66, 0.08);
}

.expense-chart-legend span {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.expense-chart-legend b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-card,
.mini-card {
  padding: 14px;
}

.metric-card strong,
.mini-card strong {
  display: block;
  margin: 6px 0 2px;
  font-size: 1.35rem;
}

.account-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(160px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
}

.account-scroll > * {
  scroll-snap-align: start;
}

.panel,
.form-card {
  padding: 16px;
}

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

.panel-head button {
  border-radius: 999px;
  background: #e3efed;
  color: #3f7f88;
  padding: 7px 12px;
  font-size: 0.84rem;
  font-weight: 800;
}

.dropdown-form {
  display: block;
}

.dropdown-form summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  list-style: none;
  cursor: pointer;
  font-weight: 900;
}

.dropdown-form summary::-webkit-details-marker {
  display: none;
}

.dropdown-form summary span {
  border-radius: 999px;
  background: #e3efed;
  color: #3f7f88;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.dropdown-form form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  animation: riseIn 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.notice-list,
.progress-list,
.card-list,
.form-card,
.settings-grid {
  display: grid;
  gap: 12px;
}

.dropdown-form.form-card {
  display: block;
}

.inline-status {
  color: #6b7f83;
  font-size: 0.78rem;
  line-height: 1.35;
}

.language-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: #e8f0ef;
}

.language-switch button {
  min-height: 42px;
  border-radius: 7px;
  background: transparent;
  color: #5d7378;
  font-weight: 900;
}

.language-switch button.active {
  background: white;
  color: #2d6870;
  box-shadow: 0 8px 18px rgba(33, 61, 66, 0.08);
}

.notice-card,
.list-card,
.goal-card .list-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notice-card {
  padding: 13px;
  border-radius: 8px;
  background: #f8fbfa;
}

.notice-card.danger {
  background: #fff1ed;
  color: #b04837;
}

.notice-card.warning {
  background: #fff8e9;
  color: #a86d12;
}

.notice-card.success {
  background: #ecf8f1;
  color: #327050;
}

.notice-card.info {
  background: #edf6f8;
  color: #2d6870;
}

.notice-card div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.notice-card button,
.card-actions button,
.toast button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
}

.list-card {
  padding: 13px;
}

.goal-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.list-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.grow {
  flex: 1 1 auto;
  min-width: 0;
}

.grow strong,
.list-title strong {
  overflow-wrap: anywhere;
}

.list-title span {
  white-space: nowrap;
  color: #31484d;
  font-weight: 800;
}

.positive {
  color: #327050 !important;
}

.muted {
  opacity: 0.64;
}

.icon-bubble,
.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  font-weight: 900;
  color: white;
}

.card-actions {
  display: flex;
  gap: 5px;
}

.card-actions button {
  color: #668084;
  background: #edf3f2;
}

.progress-row {
  display: grid;
  gap: 7px;
}

.progress-row > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.progress-row span {
  font-weight: 800;
}

.progress-row small {
  color: #789094;
}

.track {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9f0ee;
}

.track span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.progress-row.compact .track {
  height: 7px;
}

.bar-trend {
  display: grid;
  grid-template-columns: repeat(7, minmax(30px, 1fr));
  align-items: end;
  gap: 8px;
  min-height: 170px;
}

.bar-column {
  display: grid;
  align-items: end;
  justify-items: center;
  gap: 6px;
  min-width: 0;
}

.bar-column span {
  color: #4e666b;
  font-size: 0.7rem;
  font-weight: 800;
}

.bar-column div {
  width: min(100%, 28px);
  border-radius: 5px 5px 0 0;
  background: #3f7f88;
  animation: barGrow 620ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transform-origin: bottom;
}

.bar-column small {
  color: #8a9b9f;
  font-size: 0.72rem;
}

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

.field span {
  color: #667b80;
  font-size: 0.78rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d9e5e3;
  border-radius: 8px;
  background: #fbfdfc;
  color: #26393d;
  padding: 10px 11px;
}

input[type="color"] {
  padding: 4px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #3f7f88;
  outline: 3px solid rgba(63, 127, 136, 0.16);
}

.form-row,
.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.filter-grid {
  grid-template-columns: 1.2fr 1fr 1fr;
}

.allocation-entry {
  display: grid;
  gap: 6px;
}

.allocation-entry small {
  color: #667b80;
  font-size: 0.78rem;
  font-weight: 800;
}

.allocation-page {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  align-items: start;
  padding: max(16px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
  overflow-y: auto;
  background: #eef3f2;
}

.allocation-panel {
  display: grid;
  gap: 12px;
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 16px;
  border: 1px solid #d9e5e3;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 45px rgba(33, 61, 66, 0.12);
}

.allocation-page-head,
.allocation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.allocation-page-head {
  align-items: flex-start;
  padding: 12px;
  border-radius: 8px;
  background: #3f7f88;
  color: white;
}

.allocation-page-head div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.allocation-page-head small {
  color: #dceeee;
  font-size: 0.76rem;
  font-weight: 800;
}

.allocation-page-head button {
  min-height: 40px;
  border-radius: 8px;
  background: white;
  color: #3f7f88;
  padding: 8px 13px;
  font-weight: 900;
}

.allocation-head small,
.allocation-group span,
.allocation-group small {
  color: #667b80;
  font-size: 0.76rem;
  font-weight: 800;
}

.allocation-group {
  display: grid;
  gap: 7px;
}

.allocation-group > span {
  display: block;
  margin-top: 2px;
  padding: 10px 12px;
  border: 1px solid #dfe9e7;
  border-radius: 8px;
  background: #f3f8f7;
  color: #2b4247;
  font-size: 0.83rem;
  letter-spacing: 0;
}

.allocation-group label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px minmax(84px, 0.38fr);
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 3px 0;
  border-bottom: 1px solid #edf3f2;
}

.allocation-group label:last-child {
  border-bottom: 0;
}

.allocation-group label small {
  color: #2e4449;
  font-size: 0.82rem;
}

.allocation-group input,
.allocation-group select {
  min-height: 38px;
  padding: 8px 10px;
}

.expense-fields {
  display: grid;
  gap: 10px;
}

.hidden {
  display: none !important;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4e666b;
  font-weight: 800;
}

.toggle input {
  width: 20px;
  min-height: 20px;
  accent-color: #3f7f88;
}

.button-row {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.button-row button,
.wide {
  min-height: 44px;
  border-radius: 8px;
  background: #e6eeee;
  color: #3f5559;
  padding: 10px 14px;
  font-weight: 900;
}

.button-row .primary {
  background: #3f7f88;
  color: white;
}

.danger {
  background: #fff1ed;
  color: #b04837;
}

.wide {
  width: 100%;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 116px;
  border-radius: 8px;
  background: #f7fbfa;
  color: #668084;
  text-align: center;
  padding: 16px;
}

.empty-state svg {
  color: #3f7f88;
}

.bottom-nav {
  display: none;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 11px;
  width: min(390px, calc(100vw - 28px));
  padding: 13px;
  border-radius: 8px;
  background: #243236;
  color: white;
  box-shadow: 0 20px 50px rgba(18, 38, 42, 0.22);
  animation: toastIn 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.toast div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.toast span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.84rem;
}

.toast button {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

@media (min-width: 880px) {
  .screen.stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .screen.stack > .notification-strip,
  .screen.stack > .hero-card,
  .screen.stack > .form-card,
  .screen.stack > .card-list {
    grid-column: span 1;
  }

  .screen.stack > .hero-card:first-of-type,
  .screen.stack > .form-card:first-child {
    grid-column: span 2;
  }

  .screen.stack > .notification-strip {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  body {
    background: #eef3f2;
  }

  .app-shell {
    display: block;
    min-height: 100svh;
  }

  .side-nav {
    display: none;
  }

  .phone-stage {
    width: 100%;
    padding: max(14px, env(safe-area-inset-top)) 12px calc(92px + env(safe-area-inset-bottom));
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    margin: -14px -12px 12px;
    padding: max(14px, env(safe-area-inset-top)) 12px 10px;
    background: rgba(238, 243, 242, 0.88);
    backdrop-filter: blur(16px);
  }

  h1 {
    font-size: 1.45rem;
  }

  .notification-strip,
  .hero-card,
  .panel,
  .metric-card,
  .mini-card,
  .list-card,
  .goal-card {
    box-shadow: 0 12px 32px rgba(33, 61, 66, 0.075);
  }

  .hero-card {
    min-height: 468px;
    padding-top: 54px;
  }

  .chart-stage {
    --wheel-size: min(54vw, 196px);
    --wheel-top: 142px;
    min-height: 438px;
    padding-bottom: 112px;
  }

  .wheel-layer {
    top: var(--wheel-top);
    width: var(--wheel-size);
  }

  .chart-popout {
    min-width: 70px;
    max-width: 80px;
    padding: 7px 9px;
  }

  .chart-popout.right-side {
    transform: translate(-20%, -50%);
  }

  .chart-popout.left-side {
    transform: translate(-80%, -50%);
  }

  .chart-popout span {
    font-size: 0.6rem;
  }

  .chart-popout strong {
    font-size: 0.86rem;
  }

  .expense-chart-legend {
    right: 10px;
    bottom: 10px;
    width: min(62%, 222px);
    gap: 5px;
    padding: 7px;
  }

  .expense-chart-legend button {
    padding: 5px 6px;
    font-size: 0.62rem;
  }

  .hero-copy strong {
    max-width: none;
    font-size: clamp(1.18rem, 6.2vw, 1.48rem);
  }

  .hero-copy {
    top: 72px;
    width: min(76%, 250px);
  }

  .income-left-copy span {
    font-size: 0.88rem;
  }

  .income-legend {
    right: 10px;
    left: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .income-legend button {
    padding: 6px 7px;
  }

  .income-legend strong {
    font-size: 0.68rem;
  }

  .chart-context {
    font-size: 0.68rem;
  }

  .metric-grid,
  .form-row,
  .filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .allocation-group label {
    grid-template-columns: minmax(0, 1fr) 82px 76px;
    gap: 6px;
  }

  .account-scroll {
    grid-auto-columns: 74%;
    margin-right: -12px;
    padding-right: 12px;
  }

  .list-card {
    align-items: flex-start;
  }

  .card-actions {
    flex-direction: column;
  }

  .bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(63, 127, 136, 0.13);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
  }

  .bottom-nav button {
    display: grid;
    place-items: center;
    justify-items: center;
    min-width: 0;
    min-height: 52px;
    border-radius: 8px;
    background: transparent;
    color: #799094;
    font-size: 1.18rem;
    font-weight: 800;
  }

  .bottom-nav span:first-child {
    display: block;
    line-height: 1;
  }

  .bottom-nav span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .bottom-nav span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bottom-nav button.active {
    background: #dce9e7;
    color: #2d6870;
  }

  .toast {
    right: 12px;
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .hero-card {
    min-height: 452px;
  }

  .chart-stage {
    --wheel-size: min(52vw, 178px);
    --wheel-top: 96px;
    min-height: 382px;
  }

  .chart-popout {
    max-width: 74px;
    padding: 6px 8px;
  }

  .expense-chart-legend {
    width: min(64%, 204px);
  }

  .bottom-nav button {
    font-size: 1.08rem;
  }

  .panel,
  .form-card,
  .list-card,
  .goal-card {
    padding: 12px;
  }

  .icon-bubble,
  .avatar {
    width: 38px;
    height: 38px;
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes focusPop {
  from {
    opacity: 0;
    transform: translateY(5px) scale(0.96);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes ringFloat {
  from {
    opacity: 0;
    transform: scale(0.9) rotate(-4deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes ringDraw {
  from {
    stroke-dashoffset: 264;
  }
}

@keyframes wheelRefresh {
  0% {
    transform: scale(1) rotate(0);
    filter: saturate(1);
  }
  45% {
    transform: scale(0.96) rotate(9deg);
    filter: saturate(1.18);
  }
  100% {
    transform: scale(1) rotate(0);
    filter: saturate(1);
  }
}

@keyframes quickValueSwap {
  0% {
    opacity: 0.45;
    transform: translateY(4px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes popoutIn {
  from {
    opacity: 0;
    scale: 0.96;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}

@keyframes barGrow {
  from {
    transform: scaleY(0.18);
    opacity: 0.45;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
