@import url("data:text/css,");

:root {
  color-scheme: light;
  --ink: #16342d;
  --ink-2: #3f554f;
  --muted: #75847f;
  --paper: #f3f1ea;
  --surface: #fffdf8;
  --surface-2: #e9ece5;
  --line: #dfe3dc;
  --green: #174a3f;
  --green-2: #25695a;
  --mint: #bfe6d6;
  --mint-2: #dbf2e9;
  --coral: #ef846d;
  --coral-soft: #fae1da;
  --gold: #e7bd62;
  --lavender: #b9abd8;
  --sky: #8dbbd3;
  --danger: #b9463d;
  --shadow-sm: 0 1px 2px rgb(22 52 45 / 4%), 0 8px 24px rgb(22 52 45 / 5%);
  --shadow-lg: 0 24px 80px rgb(15 43 36 / 18%);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --sidebar-width: 248px;
  --bottom-nav-height: 76px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --number-font: "SFMono-Regular", "Roboto Mono", ui-monospace, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body.drawer-open {
  overflow: hidden;
  touch-action: none;
}

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

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

button:active,
.touch-button:active,
a:active {
  transform: scale(.975);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgb(37 105 90 / 22%);
  outline-offset: 2px;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3,
strong {
  letter-spacing: -.025em;
}

h1 {
  max-width: 680px;
  font-size: clamp(2rem, 5vw, 3.35rem);
  font-weight: 680;
  line-height: 1.06;
}

h2 {
  font-size: 1.18rem;
  font-weight: 670;
  line-height: 1.2;
}

[hidden] {
  display: none !important;
}

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

.svg-sprite {
  display: none;
}

.noscript {
  padding: 16px;
  background: #fff0ce;
  color: #6e4c0e;
  text-align: center;
}

.app-frame {
  min-height: 100dvh;
}

.content-shell {
  min-width: 0;
}

.desktop-sidebar {
  display: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.28rem;
  font-weight: 750;
  letter-spacing: -.055em;
  text-decoration: none;
  transition: transform 160ms ease;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: var(--green);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 1.18rem;
  font-style: italic;
  font-weight: 700;
  letter-spacing: -.08em;
}

.mobile-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  min-height: 64px;
  padding: max(10px, env(safe-area-inset-top)) 18px 8px;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  background: rgb(243 241 234 / 88%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand-mobile {
  justify-self: center;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  transition: background 150ms ease, transform 120ms ease;
}

.icon-button:hover {
  background: rgb(22 52 45 / 7%);
}

.avatar {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--coral-soft);
  color: #7c3c31;
  font-weight: 720;
}

.avatar-button {
  justify-self: end;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}

main {
  width: min(100%, 1400px);
  min-height: calc(100dvh - var(--bottom-nav-height));
  margin: 0 auto;
  padding: 18px 16px calc(var(--bottom-nav-height) + var(--safe-bottom) + 40px);
}

main:focus {
  outline: none;
}

.view {
  animation: view-in 260ms ease both;
}

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

.page-head {
  display: flex;
  margin-bottom: 24px;
  gap: 18px;
  align-items: flex-end;
  justify-content: space-between;
}

.dashboard-head {
  align-items: flex-end;
}

.eyebrow,
.card-label {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .13em;
  line-height: 1.3;
}

.eyebrow {
  margin-bottom: 7px;
}

.page-subtitle {
  margin-top: 8px;
  color: var(--muted);
}

.head-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select-wrap select {
  min-height: 44px;
  padding: 0 38px 0 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  appearance: none;
  background: var(--surface);
  cursor: pointer;
  font-size: .88rem;
  font-weight: 650;
}

.period-select-control {
  display: none;
}

.period-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.month-year-picker {
  display: none;
  align-items: center;
  gap: 8px;
}

.month-year-picker .select-wrap {
  position: relative;
  display: flex;
  min-height: 54px;
  min-width: 0;
  padding: 7px 36px 6px 43px;
  flex: 1 1 0;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 160ms ease, background 160ms ease;
}

.month-year-picker .select-wrap::before {
  content: "MONTH";
  margin-bottom: 1px;
  color: var(--muted);
  font-size: .54rem;
  font-weight: 780;
  letter-spacing: .1em;
  line-height: 1.1;
}

.month-year-picker .select-wrap:nth-child(2)::before {
  content: "YEAR";
}

.month-year-picker .select-wrap:focus-within {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgb(37 105 90 / 12%);
}

.month-year-picker .select-wrap:hover {
  border-color: var(--green-2);
  background: #fff;
}

.month-year-picker .select-wrap select {
  width: 100%;
  min-width: 0;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.015em;
}

.month-year-picker .select-wrap > svg {
  right: 12px;
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.month-year-picker .select-wrap .period-calendar-icon {
  top: 50%;
  right: auto;
  left: 13px;
  width: 21px;
  height: 21px;
  padding: 5px;
  border-radius: 8px;
  background: var(--mint-2);
  color: var(--green-2);
  transform: translateY(-35%);
}

.month-year-picker .select-wrap .period-calendar-icon + select + svg {
  width: 15px;
  height: 15px;
  color: var(--green-2);
}

.drawer-month-year {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.drawer-month-year .eyebrow {
  margin-bottom: 10px;
}

.drawer-month-year .month-year-picker {
  display: flex;
}

.drawer-month-year .select-wrap {
  flex: 1;
}

.drawer-month-year .select-wrap select {
  width: 100%;
}

.period-segments {
  display: none;
}

.period-drawer-trigger {
  display: inline-flex;
  min-height: 44px;
  padding: 0 13px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: .82rem;
  font-weight: 680;
  box-shadow: var(--shadow-sm);
}

.period-drawer-trigger > svg {
  width: 17px;
  height: 17px;
  color: var(--green-2);
}

.period-drawer-trigger .period-trigger-chevron {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.select-wrap svg {
  position: absolute;
  right: 12px;
  width: 16px;
  pointer-events: none;
}

.mobile-choice-trigger {
  display: inline-flex;
  width: 100%;
  min-height: 47px;
  padding: 0 13px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: .84rem;
  font-weight: 580;
  text-align: left;
}

.mobile-choice-trigger svg {
  position: static;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--muted);
  pointer-events: none;
}

.desktop-choice-menu {
  position: absolute;
  z-index: 140;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  display: grid;
  max-height: 280px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgb(22 52 45 / 10%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transform-origin: top;
  transition: opacity 140ms ease, transform 140ms ease;
}

.desktop-choice-menu::before {
  display: block;
  padding: 4px 10px 8px;
  margin-bottom: 4px;
  color: var(--muted);
  content: attr(data-menu-label);
  font-size: .58rem;
  font-weight: 720;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.desktop-choice-menu.period-month-menu {
  left: 50%;
  width: 300px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 6px;
  transform-origin: top left;
  transform: translate(-50%, -4px);
}

.desktop-choice-menu.period-month-menu.is-open {
  transform: translate(-50%, 0);
}

.desktop-choice-menu.period-month-menu::before {
  grid-column: 1 / -1;
}

.desktop-choice-menu.period-year-menu {
  width: 150px;
  left: auto;
}

.desktop-choice-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.desktop-choice-menu button {
  display: flex;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  align-items: center;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: .78rem;
  font-weight: 650;
  text-align: left;
  transition: background 120ms ease, color 120ms ease;
}

.desktop-choice-menu button:hover,
.desktop-choice-menu button:focus-visible {
  outline: none;
  background: var(--mint-2);
  color: var(--green-2);
}

.desktop-choice-menu button.is-selected {
  position: relative;
  background: var(--green-2);
  color: #fff;
  font-weight: 720;
}

.desktop-choice-menu button.is-selected::after {
  margin-left: auto;
  color: #fff;
  content: "✓";
  font-size: .82rem;
  font-weight: 850;
}

.desktop-choice-menu.period-month-menu button {
  min-height: 46px;
  justify-content: center;
  padding: 0 6px;
  border-radius: 8px;
  font-size: .78rem;
  font-weight: 600;
  text-align: center;
}

.desktop-choice-menu.period-month-menu button:hover {
  background: var(--mint-2);
  color: var(--green-2);
}

.desktop-choice-menu.period-month-menu button.is-selected {
  background: var(--green-2);
  color: #fff;
  font-weight: 720;
}

.desktop-choice-menu.period-month-menu button.is-selected::after {
  display: none;
}

.desktop-choice-menu button:disabled {
  color: #b7beb8;
  cursor: not-allowed;
  opacity: .58;
}

.desktop-choice-menu button:disabled:hover {
  background: transparent;
  color: #b7beb8;
  transform: none;
}

.choice-enhanced > select,
.choice-enhanced.select-wrap > svg {
  display: none;
}

.choice-enhanced {
  position: relative;
}

.choice-enhanced.select-wrap {
  display: block;
}

.primary-button,
.secondary-button,
.sidebar-add,
.load-more-button {
  display: inline-flex;
  min-height: 46px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  font-size: .9rem;
  font-weight: 680;
  transition: transform 120ms ease, background 150ms ease, box-shadow 150ms ease;
}

.primary-button:hover,
.sidebar-add:hover {
  background: #0e3d32;
  box-shadow: 0 8px 18px rgb(23 74 63 / 16%);
}

.primary-button svg,
.secondary-button svg,
.sidebar-add svg {
  width: 18px;
  height: 18px;
}

.secondary-button,
.load-more-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.secondary-button:hover,
.load-more-button:hover {
  background: var(--surface-2);
}

.button-spinner {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: button-spin 700ms linear infinite;
}

button:disabled {
  cursor: wait;
  opacity: .72;
}

@keyframes button-spin {
  to { transform: rotate(1turn); }
}

@media (prefers-reduced-motion: reduce) {
  .button-spinner { animation-duration: 1.4s; }
}

.desktop-only {
  display: none;
}

.dashboard-grid {
  display: grid;
  gap: 14px;
}

.panel,
.hero-card,
.coach-nudge-card {
  overflow: hidden;
  border: 1px solid rgb(22 52 45 / 8%);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel {
  padding: 20px;
}

.hero-card {
  padding: 22px;
  background: var(--green);
  color: #fff;
  box-shadow: 0 20px 45px rgb(23 74 63 / 17%);
}

.hero-card .card-label {
  color: rgb(255 255 255 / 63%);
}

.hero-card-top,
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.hero-amount {
  margin-top: 5px;
  font-family: var(--number-font);
  font-size: clamp(2.15rem, 10vw, 3.15rem);
  font-weight: 560;
  letter-spacing: -.075em;
  line-height: 1.15;
}

.trend-pill {
  display: inline-flex;
  min-height: 28px;
  padding: 0 9px;
  align-items: center;
  gap: 4px;
  border-radius: 99px;
  background: rgb(255 255 255 / 11%);
  color: #d5f1e5;
  font-family: var(--number-font);
  font-size: .7rem;
  font-weight: 650;
  white-space: nowrap;
}

.trend-pill svg {
  width: 14px;
  height: 14px;
}

.trend-pill.is-up {
  background: rgb(239 132 109 / 18%);
  color: #ffd4cb;
}

.trend-pill.is-up svg {
  transform: rotate(180deg);
}

.card-spend-block {
  display: flex;
  margin-top: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.card-spend-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: rgb(255 255 255 / 67%);
  font-size: .72rem;
}

.card-spend-copy strong {
  color: #fff;
  font-family: var(--number-font);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.05;
}

.card-spend-block small {
  color: rgb(255 255 255 / 55%);
  font-size: .64rem;
  white-space: nowrap;
}

.metric-row {
  display: grid;
  margin-top: 24px;
  padding-top: 18px;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgb(255 255 255 / 12%);
}

.metric-row div {
  min-width: 0;
  padding-right: 9px;
}

.metric-row div + div {
  padding-left: 14px;
  border-left: 1px solid rgb(255 255 255 / 12%);
}

.metric-row span,
.metric-row strong {
  display: block;
}

.metric-row span {
  color: rgb(255 255 255 / 57%);
  font-size: .65rem;
}

.metric-row strong {
  margin-top: 3px;
  overflow: hidden;
  font-family: var(--number-font);
  font-size: .78rem;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coach-nudge-card {
  display: flex;
  padding: 22px;
  gap: 15px;
  background: var(--mint-2);
  border-color: rgb(37 105 90 / 8%);
}

.coach-orb {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  box-shadow: 0 8px 18px rgb(23 74 63 / 16%);
}

.coach-orb svg {
  width: 19px;
  height: 19px;
}

.coach-nudge-card h2 {
  margin: 6px 0 7px;
  font-size: 1.25rem;
}

.coach-nudge-card p:not(.card-label) {
  color: var(--ink-2);
  font-size: .86rem;
}

.text-button {
  display: inline-flex;
  min-height: 36px;
  margin-top: 9px;
  padding: 0;
  align-items: center;
  gap: 5px;
  background: transparent;
  color: var(--green-2);
  font-size: .8rem;
  font-weight: 730;
}

.text-button svg {
  width: 15px;
  height: 15px;
  transition: transform 140ms ease;
}

.text-button:hover svg {
  transform: translateX(3px);
}

.panel-head {
  align-items: center;
  margin-bottom: 18px;
}

.panel-head h2 {
  margin-top: 4px;
}

.panel-head .text-button {
  margin: 0;
}

.panel-note {
  color: var(--muted);
  font-size: .72rem;
}

.spending-content {
  display: grid;
  gap: 20px;
}

.donut-wrap {
  display: grid;
  place-items: center;
}

.donut {
  display: grid;
  width: 180px;
  height: 180px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--surface-2) 0 100%);
  box-shadow: inset 0 0 0 1px rgb(22 52 45 / 5%);
  transition: background 500ms ease;
}

.donut::before {
  content: "";
  position: absolute;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 1px rgb(22 52 45 / 4%);
}

.donut > div {
  position: relative;
  z-index: 1;
  display: grid;
  text-align: center;
}

.donut span {
  color: var(--muted);
  font-size: .66rem;
}

.donut strong {
  max-width: 100px;
  overflow: hidden;
  font-family: var(--number-font);
  font-size: .96rem;
  font-weight: 610;
  text-overflow: ellipsis;
}

.category-list,
.merchant-list {
  display: grid;
  align-content: center;
  gap: 13px;
}

.category-row,
.merchant-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.category-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.category-copy,
.merchant-copy {
  min-width: 0;
}

.category-copy span,
.merchant-copy span {
  display: block;
  overflow: hidden;
  color: var(--ink-2);
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-copy small,
.merchant-copy small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .64rem;
}

.category-row strong,
.merchant-row strong {
  font-family: var(--number-font);
  font-size: .76rem;
  font-weight: 610;
}

.bar-chart {
  display: flex;
  height: 180px;
  padding-top: 15px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 44px, rgb(22 52 45 / 5%) 45px);
}

.chart-bar-wrap {
  display: flex;
  height: 100%;
  min-width: 0;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.chart-bar {
  position: relative;
  width: min(100%, 28px);
  min-height: 3px;
  border-radius: 7px 7px 2px 2px;
  background: var(--mint);
  transition: height 550ms cubic-bezier(.2, .8, .2, 1), background 150ms ease;
}

.chart-bar:hover,
.chart-bar.is-today {
  background: var(--green-2);
}

.chart-bar[data-value]::after {
  content: attr(data-value);
  position: absolute;
  z-index: 2;
  bottom: calc(100% + 7px);
  left: 50%;
  display: none;
  padding: 4px 6px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-family: var(--number-font);
  font-size: .58rem;
  white-space: nowrap;
  transform: translateX(-50%);
}

.chart-bar:hover::after {
  display: block;
}

.chart-bar-wrap > span {
  margin: 8px 0 -23px;
  color: var(--muted);
  font-size: .59rem;
  white-space: nowrap;
}

.chart-empty,
.empty-state {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
}

.transaction-list,
.transaction-groups {
  display: grid;
}

.transaction-item {
  display: grid;
  width: 100%;
  min-height: 66px;
  padding: 10px 0;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  transition: transform 120ms ease, background 150ms ease;
}

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

.transaction-item:hover {
  background: rgb(22 52 45 / 2.5%);
}

.category-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--green);
  font-size: 1rem;
}

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

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

.transaction-copy strong {
  font-size: .85rem;
  font-weight: 650;
}

.transaction-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .68rem;
}

.transaction-amount {
  font-family: var(--number-font);
  font-size: .79rem;
  font-weight: 620;
  letter-spacing: -.04em;
}

.merchant-rank {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 9px;
  background: var(--mint-2);
  color: var(--green);
  font-family: var(--number-font);
  font-size: .67rem;
}

.list-skeleton,
.transaction-skeleton {
  position: relative;
  height: 36px;
  overflow: hidden;
  border-radius: 10px;
  background: #eceee9;
}

.transaction-skeleton {
  height: 58px;
  margin: 5px 0;
}

.transaction-skeleton.tall {
  height: 110px;
  margin-bottom: 12px;
}

.list-skeleton.short {
  width: 72%;
}

.list-skeleton::after,
.transaction-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 60%), transparent);
  animation: shimmer 1.3s infinite;
  transform: translateX(-100%);
}

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

.transaction-toolbar {
  display: flex;
  margin-bottom: 14px;
  gap: 9px;
}

.search-field {
  display: flex;
  min-width: 0;
  min-height: 48px;
  flex: 1 1 auto;
  padding: 0 14px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.search-field svg {
  width: 18px;
  flex: 0 0 auto;
  color: var(--muted);
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: .86rem;
}

.filter-button {
  padding: 0 13px;
}

.filter-count {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: .6rem;
}

.active-filters {
  display: flex;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 7px;
}

.active-filter {
  display: inline-flex;
  min-height: 30px;
  padding: 0 10px;
  align-items: center;
  gap: 5px;
  border-radius: 99px;
  background: var(--mint-2);
  color: var(--green);
  font-size: .7rem;
  font-weight: 650;
}

.transaction-date-group {
  margin-bottom: 14px;
}

.transaction-date-head {
  display: flex;
  padding: 8px 3px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: .69rem;
  font-weight: 680;
}

.transaction-date-head strong {
  color: var(--ink-2);
  font-family: var(--number-font);
  font-size: .68rem;
}

.transaction-date-list {
  padding: 4px 16px;
  border: 1px solid rgb(22 52 45 / 8%);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.load-more-button {
  width: 100%;
  margin-top: 8px;
}

.tasks-view {
  min-width: 0;
}

.tasks-head {
  margin-bottom: 16px;
  align-items: center;
}

.tasks-head h1 {
  font-size: clamp(1.9rem, 4vw, 2.55rem);
}

.task-summary {
  display: grid;
  margin-bottom: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.task-metric {
  position: relative;
  display: grid;
  min-height: 94px;
  padding: 13px 14px 12px;
  overflow: hidden;
  border: 1px solid rgb(22 52 45 / 8%);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.task-metric::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--sky);
}

.task-metric-overdue::before {
  background: var(--coral);
}

.task-metric-done::before {
  background: var(--green-2);
}

.task-metric > span,
.task-metric > small {
  color: var(--muted);
}

.task-metric > span {
  font-size: .67rem;
  font-weight: 720;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.task-metric > strong {
  align-self: end;
  font-family: var(--number-font);
  font-size: 1.35rem;
  font-weight: 650;
  line-height: 1.05;
}

.task-metric > small {
  font-size: .61rem;
}

.tasks-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.task-search-field {
  min-height: 46px;
  flex: 1 1 240px;
}

.task-priority-control,
.task-priority-control select {
  width: 100%;
}

.task-priority-control {
  min-width: 145px;
  flex: 0 0 145px;
}

.task-archive-button {
  min-height: 46px;
}

.task-archive-button svg {
  width: 17px;
  height: 17px;
}

.task-priority-control select {
  min-height: 46px;
  padding-left: 13px;
  box-shadow: var(--shadow-sm);
  font-size: .8rem;
}

.task-status-message {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #efcfc8;
  border-radius: 12px;
  background: #fbe9e5;
  color: var(--danger);
  font-size: .72rem;
}

.task-tabs {
  display: flex;
  margin-top: 18px;
  gap: 6px;
  flex-wrap: wrap;
}

.task-tab {
  display: inline-flex;
  min-height: 40px;
  padding: 0 14px;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: .74rem;
  font-weight: 680;
  white-space: nowrap;
}

.task-tab:hover {
  border-color: #c8d0cb;
  background: #fff;
}

.task-tab.is-active {
  border-color: var(--green-2);
  background: var(--green);
  color: #fff;
}

.task-tab-count {
  min-width: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgb(22 52 45 / 8%);
  font-family: var(--number-font);
  font-size: .62rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.task-tab.is-active .task-tab-count {
  background: rgb(255 255 255 / 18%);
}

.task-stage-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: .68rem;
}

.task-list {
  display: grid;
  margin-top: 12px;
  gap: 10px;
}

.task-list .task-card {
  border-radius: 12px;
}

.task-card-head-end {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.task-stage-chip {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .58rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.task-stage-chip-todo {
  background: rgb(141 187 211 / 22%);
  color: #4a7fa3;
}

.task-stage-chip-in_progress {
  background: rgb(37 105 90 / 14%);
  color: var(--green-2);
}

.task-stage-chip-review {
  background: rgb(231 189 98 / 24%);
  color: #8a6a1f;
}

.task-stage-chip-done {
  background: var(--mint-2);
  color: var(--green-2);
}

.archive-list {
  margin-top: 16px;
}

.archive-task {
  display: flex;
  padding: 13px 14px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 5px 16px rgb(22 52 45 / 5%);
}

.archive-task-main {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  gap: 3px;
}

.archive-task-meta {
  color: var(--muted);
  font-size: .62rem;
}

.archive-restore {
  display: inline-flex;
  min-height: 38px;
  padding: 0 13px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--green-2);
  font-size: .7rem;
  font-weight: 700;
}

.archive-restore:hover {
  border-color: var(--green-2);
  background: var(--mint-2);
}

.archive-restore svg {
  width: 15px;
  height: 15px;
}

.task-card {
  position: relative;
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 12px 12px 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 3px solid #bdc6c1;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 5px 16px rgb(22 52 45 / 5%);
  text-align: left;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 120ms ease;
}

.task-card:hover {
  border-color: #c8d0cb;
  box-shadow: 0 9px 22px rgb(22 52 45 / 9%);
}

.task-card[data-priority="low"] {
  border-left-color: #aab5b0;
}

.task-card[data-priority="medium"] {
  border-left-color: var(--gold);
}

.task-card[data-priority="high"] {
  border-left-color: var(--coral);
}

.task-card[data-priority="urgent"] {
  border-left-color: var(--danger);
}

.task-card-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.task-key {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--number-font);
  font-size: .61rem;
  font-weight: 650;
  letter-spacing: .02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-priority {
  display: inline-flex;
  min-height: 22px;
  padding: 0 7px;
  flex: 0 0 auto;
  align-items: center;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: .57rem;
  font-weight: 720;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.task-priority-high {
  background: var(--coral-soft);
  color: #854337;
}

.task-priority-urgent {
  background: #f8dcd7;
  color: var(--danger);
}

.task-priority-medium {
  background: #faedce;
  color: #72571f;
}

.task-title {
  display: -webkit-box;
  margin-top: 8px;
  overflow: hidden;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 680;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.task-card.is-done .task-title {
  color: var(--ink-2);
}

.task-card-meta {
  display: flex;
  min-width: 0;
  margin-top: 11px;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 9px;
}

.task-due,
.task-assignee {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: .62rem;
}

.task-due svg {
  width: 13px;
  height: 13px;
}

.task-due.is-overdue {
  color: var(--danger);
  font-weight: 680;
}

.task-assignee {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-assignee-avatar {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--mint-2);
  color: var(--green);
  font-size: .54rem;
  font-weight: 760;
}

.task-labels {
  display: flex;
  margin-top: 9px;
  flex-wrap: wrap;
  gap: 5px;
}

.task-label {
  display: inline-flex;
  min-height: 22px;
  max-width: 100%;
  padding: 0 7px;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgb(37 105 90 / 9%);
  border-radius: 7px;
  background: var(--mint-2);
  color: var(--green-2);
  font-size: .57rem;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-empty {
  display: grid;
  min-height: 148px;
  padding: 20px 16px;
  place-items: center;
  border: 1px dashed #ccd3ce;
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.task-empty svg {
  width: 22px;
  height: 22px;
  margin-bottom: 8px;
  color: #9aa8a1;
}

.task-empty strong,
.task-empty span {
  display: block;
}

.task-empty strong {
  color: var(--ink-2);
  font-size: .76rem;
}

.task-empty span {
  max-width: 205px;
  margin-top: 3px;
  font-size: .64rem;
  line-height: 1.45;
}

.task-card-skeleton {
  position: relative;
  height: 128px;
  overflow: hidden;
  border: 1px solid rgb(22 52 45 / 5%);
  border-radius: 14px;
  background: #e9ece7;
}

.task-card-skeleton.short {
  height: 96px;
}

.task-card-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 62%), transparent);
  animation: shimmer 1.3s infinite;
  transform: translateX(-100%);
}

.task-form {
  display: grid;
  gap: 13px;
}

.task-form-grid {
  display: grid;
  gap: 13px;
}

.task-form textarea {
  min-height: 96px;
  padding: 12px 13px;
  resize: vertical;
  line-height: 1.45;
}

.task-drawer-actions {
  display: flex;
  margin-top: 3px;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.task-drawer-actions .danger-button {
  min-height: 46px;
}

.task-drawer-actions .primary-button {
  margin-left: auto;
}

.coach-layout {
  display: grid;
  min-height: 0;
  gap: 14px;
}

.coach-context {
  display: none;
}

.coach-view.is-active {
  display: flex;
  height: calc(100dvh - 64px - var(--bottom-nav-height) - var(--safe-bottom) - 36px);
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.coach-page-head {
  flex: 0 0 auto;
}

.coach-view .coach-layout {
  flex: 1 1 auto;
}

.chat-sessions {
  display: none;
}

.chat-card {
  display: flex;
  min-height: 0;
  padding: 0;
  flex-direction: column;
  overflow: hidden;
}

.chat-toolbar {
  display: flex;
  min-height: 56px;
  padding: 7px 10px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.session-drawer-trigger {
  display: inline-flex;
  min-width: 0;
  min-height: 44px;
  padding: 0 8px;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 680;
}

.session-drawer-trigger:hover {
  background: rgb(22 52 45 / 5%);
}

.session-drawer-trigger > span {
  max-width: min(52vw, 240px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-drawer-trigger svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--green-2);
}

.session-drawer-trigger .period-trigger-chevron {
  width: 14px;
  color: var(--muted);
}

.chat-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .61rem;
  font-weight: 650;
}

.chat-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #50a878;
}

.chat-messages {
  display: flex;
  min-height: 0;
  padding: 20px 16px;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.message {
  display: flex;
  max-width: 88%;
  gap: 9px;
  animation: message-in 220ms ease both;
}

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

.message-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
}

.message-avatar svg {
  width: 14px;
  height: 14px;
}

.message > div {
  padding: 11px 13px;
  border-radius: 5px 16px 16px 16px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: .84rem;
}

.message p {
  white-space: pre-wrap;
}

.message-content {
  min-width: 0;
  line-height: 1.55;
}

.user-message .message-content {
  white-space: pre-wrap;
}

.message-content > * + * {
  margin-top: 9px;
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
  font-size: .92rem;
  line-height: 1.35;
}

.message-content ul,
.message-content ol {
  padding-left: 20px;
}

.message-content li + li {
  margin-top: 4px;
}

.message-content blockquote {
  padding-left: 10px;
  border-left: 3px solid var(--mint);
  color: var(--muted);
}

.message-content a {
  color: var(--green-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.message-content code {
  padding: 1px 4px;
  border-radius: 5px;
  background: rgb(22 52 45 / 8%);
  font-family: var(--number-font);
  font-size: .77rem;
}

.message-content pre {
  max-width: 100%;
  padding: 10px;
  overflow-x: auto;
  border-radius: 10px;
  background: #102f28;
  color: #eef8f3;
}

.message-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  white-space: pre;
}

.message-content hr {
  border: 0;
  border-top: 1px solid var(--line);
}

.assistant-message.is-streaming .message-content::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 1em;
  margin-left: 3px;
  border-radius: 2px;
  background: var(--green-2);
  vertical-align: -.15em;
  animation: stream-cursor 850ms steps(1) infinite;
}

@keyframes stream-cursor {
  50% { opacity: .2; }
}

.message time {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: .58rem;
}

.user-message {
  margin-left: auto;
  justify-content: flex-end;
}

.user-message > div {
  border-radius: 16px 5px 16px 16px;
  background: var(--green);
  color: #fff;
}

.user-message time {
  color: rgb(255 255 255 / 58%);
}

.typing-dots {
  display: flex;
  min-width: 51px;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.typing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing 1s infinite ease-in-out;
}

.typing-dots i:nth-child(2) { animation-delay: 140ms; }
.typing-dots i:nth-child(3) { animation-delay: 280ms; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.quick-prompts {
  display: flex;
  margin-left: 39px;
  flex-wrap: wrap;
  gap: 7px;
}

.quick-prompts button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #bfd4cc;
  border-radius: 99px;
  background: #f6fbf8;
  color: var(--green-2);
  font-size: .69rem;
  font-weight: 630;
}

.chat-composer {
  position: relative;
  padding: 12px 12px max(12px, var(--safe-bottom));
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.new-session-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--green-2);
  font-size: .82rem;
  white-space: nowrap;
}

.new-session-button svg {
  width: 16px;
  height: 16px;
}

.new-session-button:hover {
  border-color: var(--green-2);
  background: var(--mint-2);
}

.sessions-drawer {
  max-height: min(82dvh, 720px);
  overflow-y: auto;
}

.sessions-drawer > .full-button {
  margin-bottom: 14px;
}

.session-list {
  display: grid;
  min-height: 0;
  gap: 7px;
  overflow-y: auto;
}

.session-item {
  display: grid;
  width: 100%;
  min-height: 62px;
  padding: 8px 9px;
  grid-template-columns: 36px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  text-align: left;
}

.session-item:hover {
  background: rgb(22 52 45 / 5%);
}

.session-item.is-active {
  border-color: var(--green-2);
  background: var(--mint-2);
  color: var(--green);
}

.session-item-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
}

.session-item.is-active .session-item-icon {
  background: var(--surface);
}

.session-item-icon svg,
.session-item-chevron {
  width: 15px;
  height: 15px;
}

.session-item-copy,
.session-item-copy strong,
.session-item-copy small {
  display: block;
  min-width: 0;
}

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

.session-item-copy strong {
  font-size: .72rem;
}

.session-item-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .59rem;
}

.session-item-chevron {
  color: var(--muted);
}

.session-empty {
  padding: 18px 10px;
  color: var(--muted);
  font-size: .7rem;
  text-align: center;
}

.chat-input-wrap {
  display: grid;
  min-height: 51px;
  padding: 6px 6px 6px 14px;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: end;
  gap: 5px;
  border: 1px solid #ccd4ce;
  border-radius: 17px;
  background: #fff;
}

.chat-input-wrap:focus-within {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgb(37 105 90 / 10%);
}

.chat-input-wrap textarea {
  max-height: 130px;
  padding: 8px 0;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: .85rem;
  line-height: 1.35;
}

.send-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--green);
  color: #fff;
}

.send-button svg {
  width: 18px;
  height: 18px;
}

.chat-composer > small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: .59rem;
  text-align: center;
}

.settings-grid {
  display: grid;
  gap: 14px;
}

.settings-card {
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr);
  gap: 15px 12px;
}

.settings-icon {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 13px;
  background: var(--mint-2);
  color: var(--green);
}

.settings-icon.coral {
  background: var(--coral-soft);
  color: #8a4336;
}

.settings-icon.gold {
  background: #faedce;
  color: #795c1e;
}

.settings-copy p {
  margin-top: 3px;
  color: var(--muted);
  font-size: .76rem;
}

.field {
  display: grid;
  grid-column: 1 / -1;
  gap: 6px;
}

.field > span,
.field > label,
.filter-group legend {
  color: var(--ink-2);
  font-size: .71rem;
  font-weight: 680;
}

.field em {
  color: var(--muted);
  font-size: .64rem;
  font-style: normal;
  font-weight: 450;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 47px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #fff;
  font-size: .84rem;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgb(37 105 90 / 9%);
}

.date-field-wrap {
  position: relative;
  display: grid;
  min-height: 54px;
  padding: 6px 44px 6px 8px;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 160ms ease, background 160ms ease;
}

.date-field-wrap:focus-within {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgb(37 105 90 / 12%);
}

.date-field-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: var(--mint-2);
  color: var(--green-2);
}

.date-field-icon svg {
  width: 18px;
  height: 18px;
}

.date-field-value {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-field-value.is-placeholder {
  color: var(--muted);
  font-weight: 540;
}

.date-field-wrap::after {
  content: "";
  position: absolute;
  right: 15px;
  width: 8px;
  height: 8px;
  border-right: 1.7px solid var(--muted);
  border-bottom: 1.7px solid var(--muted);
  pointer-events: none;
  transform: rotate(45deg) translateY(-2px);
}

.date-field-wrap input[type="date"] {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  min-height: 100%;
  padding: 0;
  border: 0;
  opacity: .01;
  pointer-events: none;
  cursor: pointer;
  color: transparent;
  caret-color: transparent;
}

.date-field-wrap input[type="date"]::-webkit-calendar-picker-indicator {
  display: none;
}

.date-field-wrap {
  cursor: pointer;
}

.date-field-wrap.is-open {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgb(37 105 90 / 12%);
}

.date-field-wrap.is-open::after {
  transform: rotate(225deg) translateY(-2px);
}

.date-calendar {
  position: absolute;
  z-index: 150;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  min-width: 284px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgb(22 52 45 / 10%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.date-calendar.opens-up {
  top: auto;
  bottom: calc(100% + 8px);
  transform: translateY(4px);
}

.date-calendar.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.date-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.date-calendar-title {
  font-size: .82rem;
  font-weight: 720;
  letter-spacing: -.01em;
}

.date-calendar-nav {
  display: flex;
  gap: 2px;
}

.date-calendar-nav button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
}

.date-calendar-nav button:hover {
  background: var(--mint-2);
  color: var(--green-2);
}

.date-calendar-nav svg {
  width: 16px;
  height: 16px;
}

.date-calendar-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 2px;
  color: var(--muted);
  font-size: .58rem;
  font-weight: 720;
  letter-spacing: .06em;
}

.date-calendar-week span {
  padding: 4px 0;
  text-align: center;
}

.date-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.date-calendar-day {
  display: grid;
  min-height: 34px;
  place-items: center;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: .78rem;
  font-weight: 600;
}

.date-calendar-day:hover,
.date-calendar-day:focus-visible {
  outline: none;
  background: var(--mint-2);
  color: var(--green-2);
}

.date-calendar-day.is-outside {
  color: #b7beb8;
}

.date-calendar-day.is-today {
  box-shadow: inset 0 0 0 1.5px var(--green-2);
  color: var(--green-2);
}

.date-calendar-day.is-selected {
  background: var(--green-2);
  color: #fff;
  font-weight: 720;
  box-shadow: none;
}

.date-calendar-foot {
  display: flex;
  margin-top: 8px;
  padding-top: 6px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

.date-calendar-foot button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--green-2);
  font-size: .74rem;
  font-weight: 680;
}

.date-calendar-foot button:hover {
  background: var(--mint-2);
}

.date-calendar-foot button[hidden] {
  display: none;
}

.amount-field > div {
  display: flex;
  min-height: 47px;
  padding-left: 13px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.amount-field > div:focus-within {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgb(37 105 90 / 9%);
}

.amount-field > div span {
  color: var(--muted);
}

.amount-field > div input {
  border: 0;
  box-shadow: none;
}

.amount-field > div input:focus {
  box-shadow: none;
}

.field-help {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: .68rem;
}

.install-settings {
  align-items: center;
}

.install-settings .secondary-button {
  grid-column: 1 / -1;
}

.settings-actions {
  display: flex;
  padding: 8px 0;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.save-status {
  color: var(--green-2);
  font-size: .74rem;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  padding: 8px 8px var(--safe-bottom);
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  border-top: 1px solid rgb(22 52 45 / 9%);
  background: rgb(255 253 248 / 94%);
  box-shadow: 0 -10px 32px rgb(22 52 45 / 6%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.bottom-nav button {
  display: flex;
  height: 58px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-size: .61rem;
  font-weight: 610;
}

.bottom-nav button svg {
  width: 21px;
  height: 21px;
}

.bottom-nav button.is-active {
  color: var(--green);
}

.bottom-nav button.is-active svg {
  stroke-width: 2.2;
}

.floating-add {
  position: fixed;
  z-index: 31;
  bottom: calc(36px + var(--safe-bottom));
  left: 50%;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 5px solid var(--surface);
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  box-shadow: 0 8px 25px rgb(161 76 59 / 25%);
  transform: translate(-50%, 0);
}

.floating-add:active {
  transform: translate(-50%, 0) scale(.94);
}

.floating-add svg {
  width: 23px;
  height: 23px;
  stroke-width: 2.2;
}

.drawer-backdrop,
.mobile-menu-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  visibility: hidden;
  background: rgb(9 31 26 / 44%);
  opacity: 0;
  backdrop-filter: blur(3px);
  transition: visibility 220ms, opacity 220ms ease;
}

.drawer-backdrop.is-open,
.mobile-menu-backdrop.is-open {
  visibility: visible;
  opacity: 1;
}

.bottom-drawer {
  position: fixed;
  z-index: 90;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: min(90dvh, 790px);
  padding: 8px 18px calc(20px + var(--safe-bottom));
  overflow-y: auto;
  border-radius: 25px 25px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overscroll-behavior: contain;
  transform: translateY(105%);
  transition: transform 300ms cubic-bezier(.22, .8, .25, 1);
}

.bottom-drawer.is-open {
  transform: translateY(0);
}

.drawer-handle {
  width: 40px;
  height: 4px;
  margin: 2px auto 14px;
  border-radius: 99px;
  background: #cfd5cf;
}

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

.drawer-header h2 {
  font-size: 1.55rem;
}

.period-drawer {
  max-height: min(84dvh, 720px);
  overflow-y: auto;
}

.period-options {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 10px;
  border: 0;
}

.period-option {
  position: relative;
  cursor: pointer;
}

.period-option > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.period-option-card {
  display: grid;
  min-height: 76px;
  padding: 12px 14px;
  grid-template-columns: 44px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  transition: border-color 150ms ease, background 150ms ease;
}

.period-option:active .period-option-card {
  transform: scale(.985);
}

.period-option-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--green-2);
}

.period-option-icon svg {
  width: 19px;
  height: 19px;
}

.period-option-copy strong,
.period-option-copy small {
  display: block;
}

.period-option-copy strong {
  font-size: .86rem;
}

.period-option-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .68rem;
}

.period-option-check {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: transparent;
}

.period-option-check svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}

.period-option > input:checked + .period-option-card {
  border-color: var(--green-2);
  background: var(--mint-2);
}

.period-option > input:checked + .period-option-card .period-option-icon {
  background: var(--green);
  color: #fff;
}

.period-option > input:checked + .period-option-card .period-option-check {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.period-option > input:focus-visible + .period-option-card {
  outline: 3px solid rgb(37 105 90 / 22%);
  outline-offset: 2px;
}

.choice-drawer {
  z-index: 110;
  max-height: min(78dvh, 640px);
}

.choice-options {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 9px;
  border: 0;
}

.choice-option {
  position: relative;
  cursor: pointer;
}

.choice-option > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice-option-card {
  display: grid;
  min-height: 58px;
  padding: 10px 13px;
  grid-template-columns: minmax(0, 1fr) 27px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-2);
  font-size: .84rem;
  font-weight: 650;
  transition: border-color 150ms ease, background 150ms ease;
}

.choice-option:active .choice-option-card {
  transform: scale(.985);
}

.choice-option-check {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: transparent;
}

.choice-option-check svg {
  width: 14px;
  height: 14px;
}

.choice-option > input:checked + .choice-option-card {
  border-color: var(--green-2);
  background: var(--mint-2);
  color: var(--green);
}

.choice-option > input:checked + .choice-option-card .choice-option-check {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.choice-option > input:focus-visible + .choice-option-card {
  outline: 3px solid rgb(37 105 90 / 22%);
  outline-offset: 2px;
}

.choice-add-row {
  display: inline-flex;
  min-height: 46px;
  padding: 0 13px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--green-2);
  font-size: .8rem;
  font-weight: 680;
}

.choice-add-row:hover {
  border-color: var(--green-2);
  background: var(--mint-2);
}

.choice-add-row svg {
  width: 16px;
  height: 16px;
}

.choice-add {
  display: grid;
  gap: 12px;
}

.choice-add-actions {
  display: flex;
  gap: 8px;
}

.choice-add-actions .primary-button,
.choice-add-actions .secondary-button {
  flex: 1;
}

.choice-add-error {
  color: var(--danger);
  font-size: .72rem;
}

.desktop-choice-menu-add {
  display: flex;
  width: 100%;
  min-height: 42px;
  margin-top: 4px;
  padding: 0 12px;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  color: var(--green-2);
  font-size: .72rem;
  font-weight: 700;
  text-align: left;
}

.desktop-choice-menu-add:hover {
  background: var(--mint-2);
}

.desktop-choice-menu-add svg {
  width: 14px;
  height: 14px;
}

.categories-manage {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.categories-add-row {
  display: flex;
  gap: 8px;
}

.categories-add-row input {
  min-height: 46px;
  padding: 0 13px;
  flex: 1 1 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #fff;
  font-size: .84rem;
}

.categories-add-row input:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgb(37 105 90 / 9%);
}

.categories-add-row .primary-button {
  flex: 0 0 auto;
}

.categories-list {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 6px;
  list-style: none;
}

.category-row {
  display: flex;
  min-height: 44px;
  padding: 6px 6px 6px 13px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.category-row-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .82rem;
  font-weight: 650;
}

.category-row-actions {
  display: inline-flex;
  gap: 2px;
}

.category-row-actions .icon-button {
  width: 34px;
  height: 34px;
}

.category-rename {
  display: flex;
  width: 100%;
  gap: 8px;
  align-items: center;
}

.category-rename-input {
  min-height: 40px;
  padding: 0 11px;
  flex: 1 1 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #fff;
  font-size: .82rem;
}

.category-rename-input:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgb(37 105 90 / 9%);
}

.category-rename .primary-button,
.category-rename .secondary-button {
  min-height: 40px;
  padding: 0 12px;
  font-size: .74rem;
}

.category-empty {
  padding: 8px 2px;
  color: var(--muted);
  font-size: .7rem;
}

.capture-tabs {
  display: grid;
  margin-bottom: 20px;
  padding: 4px;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  border-radius: 14px;
  background: var(--surface-2);
}

.capture-tabs button {
  display: flex;
  min-height: 42px;
  padding: 0 8px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 650;
}

.capture-tabs button svg {
  width: 16px;
}

.capture-tabs button.is-active {
  background: var(--surface);
  color: var(--green);
  box-shadow: 0 2px 8px rgb(22 52 45 / 7%);
}

.capture-panel {
  animation: view-in 200ms ease;
}

.natural-input {
  position: relative;
  display: block;
}

.natural-input textarea {
  width: 100%;
  min-height: 112px;
  padding: 17px 46px 17px 16px;
  resize: none;
  border: 1px solid #cbd5cf;
  border-radius: 17px;
  outline: none;
  background: #fff;
  font-size: .96rem;
  line-height: 1.5;
}

.natural-input textarea:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgb(37 105 90 / 10%);
}

.input-spark {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  background: var(--mint-2);
  color: var(--green);
}

.input-spark svg {
  width: 15px;
  height: 15px;
}

.example-chips {
  display: flex;
  margin: 11px 0 4px;
  padding: 2px 0;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.example-chips::-webkit-scrollbar {
  display: none;
}

.example-chips button {
  min-height: 32px;
  padding: 0 10px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: var(--ink-2);
  font-size: .66rem;
}

.full-button {
  width: 100%;
  margin-top: 12px;
}

.full-button svg {
  margin-left: auto;
}

.drawer-footnote {
  display: flex;
  margin: 10px 0 0;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--muted);
  font-size: .62rem;
}

.drawer-footnote svg {
  width: 12px;
  height: 12px;
}

.capture-feedback {
  display: none;
  margin-top: 10px;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--mint-2);
  color: var(--green);
  font-size: .74rem;
}

.capture-feedback.is-visible {
  display: block;
}

.capture-feedback.is-error {
  background: #fbe9e5;
  color: var(--danger);
}

.manual-form {
  display: grid;
  gap: 13px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.filter-group {
  padding: 0;
  margin: 0 0 22px;
  border: 0;
}

.filter-group legend {
  margin-bottom: 10px;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-options label {
  cursor: pointer;
}

.filter-options input,
.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.filter-options span {
  display: inline-flex;
  min-height: 36px;
  padding: 0 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--ink-2);
  font-size: .72rem;
}

.filter-options input:checked + span {
  border-color: var(--green);
  background: var(--mint-2);
  color: var(--green);
  font-weight: 680;
}

.segmented-control {
  display: grid;
  padding: 4px;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  border-radius: 13px;
  background: var(--surface-2);
}

.segmented-control span {
  display: grid;
  min-height: 38px;
  place-items: center;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  font-size: .71rem;
}

.segmented-control input:checked + span {
  background: var(--surface);
  color: var(--green);
  box-shadow: 0 2px 7px rgb(22 52 45 / 7%);
  font-weight: 680;
}

.drawer-actions {
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: 9px;
}

.detail-card {
  text-align: center;
}

.detail-card .category-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 10px;
  border-radius: 17px;
  font-size: 1.25rem;
}

.detail-card h3 {
  font-size: 1.15rem;
}

.detail-amount {
  margin: 5px 0 20px;
  font-family: var(--number-font);
  font-size: 2rem;
  font-weight: 620;
}

.detail-list {
  display: grid;
  margin-bottom: 18px;
  border-top: 1px solid var(--line);
}

.detail-row {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  font-size: .76rem;
}

.detail-row span {
  color: var(--muted);
}

.danger-button {
  display: inline-flex;
  min-height: 42px;
  padding: 0 14px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 12px;
  background: #fbe9e5;
  color: var(--danger);
  font-size: .76rem;
  font-weight: 670;
}

.danger-button svg {
  width: 16px;
}

.mobile-menu {
  position: fixed;
  z-index: 100;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: min(86vw, 340px);
  padding: max(18px, env(safe-area-inset-top)) 18px calc(18px + var(--safe-bottom));
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateX(-105%);
  transition: transform 290ms cubic-bezier(.22, .8, .25, 1);
}

.mobile-menu.is-open {
  transform: translateX(0);
}

.mobile-menu > .drawer-handle {
  display: none;
}

.menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-menu-nav {
  display: grid;
  margin-top: 34px;
  gap: 6px;
}

.mobile-menu-nav button {
  display: flex;
  min-height: 52px;
  padding: 0 14px;
  align-items: center;
  gap: 13px;
  border-radius: 14px;
  background: transparent;
  color: var(--ink-2);
  font-size: .91rem;
  font-weight: 620;
  text-align: left;
}

.mobile-menu-nav button:hover {
  background: var(--surface-2);
}

.mobile-menu-nav svg {
  width: 20px;
  height: 20px;
}

.menu-footer {
  display: flex;
  margin-top: auto;
  padding: 14px;
  align-items: center;
  gap: 11px;
  border-radius: 15px;
  background: var(--surface-2);
}

.menu-footer strong,
.menu-footer small {
  display: block;
}

.menu-footer strong {
  font-size: .82rem;
}

.menu-footer small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .64rem;
}

.install-banner {
  position: fixed;
  z-index: 110;
  right: 12px;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 10px);
  left: 12px;
  display: grid;
  padding: 12px;
  grid-template-columns: 35px minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 9px;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 17px;
  background: var(--green);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.install-banner .brand-mark {
  width: 35px;
  height: 35px;
  background: var(--surface);
  color: var(--green);
}

.install-banner strong,
.install-banner small {
  display: block;
}

.install-banner strong {
  font-size: .77rem;
}

.install-banner small {
  color: rgb(255 255 255 / 65%);
  font-size: .6rem;
}

.install-banner > button:not(.icon-button) {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 10px;
  background: var(--mint);
  color: var(--green);
  font-size: .69rem;
  font-weight: 700;
}

.install-banner .icon-button {
  width: 34px;
  height: 34px;
  color: rgb(255 255 255 / 70%);
}

.offline-pill {
  position: fixed;
  z-index: 115;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  min-height: 34px;
  padding: 0 12px;
  align-items: center;
  gap: 6px;
  border-radius: 99px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: .67rem;
  transform: translateX(-50%);
}

.offline-pill svg {
  width: 14px;
}

.toast-region {
  position: fixed;
  z-index: 120;
  right: 14px;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 14px);
  left: 14px;
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  width: fit-content;
  max-width: 100%;
  min-height: 42px;
  padding: 9px 14px;
  align-items: center;
  gap: 8px;
  border-radius: 13px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: .74rem;
  animation: toast-in 250ms ease both;
}

.toast.success::before {
  content: "✓";
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--mint);
  color: var(--green);
  font-size: .7rem;
  font-weight: 800;
}

.toast.error {
  background: #83362f;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 600px) {
  main {
    padding-right: 26px;
    padding-left: 26px;
  }

  .task-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .task-tabs {
    margin-right: -26px;
    margin-left: -26px;
    padding-right: 26px;
    padding-left: 26px;
  }

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

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

  .hero-card,
  .recent-panel {
    grid-column: 1 / -1;
  }

  .spending-content {
    grid-template-columns: 190px minmax(0, 1fr);
    align-items: center;
  }

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

  .full-width,
  .settings-actions {
    grid-column: 1 / -1;
  }

  .install-settings {
    grid-template-columns: 45px minmax(0, 1fr) auto;
  }

  .install-settings .secondary-button {
    grid-column: auto;
  }

  .bottom-drawer {
    right: 50%;
    left: auto;
    width: min(560px, calc(100vw - 32px));
    border-radius: 25px 25px 0 0;
    transform: translate(50%, 105%);
  }

  .bottom-drawer.is-open {
    transform: translate(50%, 0);
  }

  .install-banner {
    right: 20px;
    left: auto;
    width: 430px;
  }

  .toast-region {
    right: 24px;
    left: auto;
    justify-items: end;
  }
}

@media (min-width: 960px) {
  .app-frame {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .desktop-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100dvh;
    padding: 26px 18px 20px;
    flex-direction: column;
    border-right: 1px solid rgb(22 52 45 / 8%);
    background: #ebeae3;
  }

  .desktop-sidebar > .brand {
    padding-left: 10px;
  }

  .desktop-nav {
    display: grid;
    margin-top: 42px;
    gap: 5px;
  }

  .nav-item {
    display: flex;
    min-height: 46px;
    padding: 0 13px;
    align-items: center;
    gap: 12px;
    border-radius: 13px;
    background: transparent;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 620;
    text-align: left;
  }

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

  .nav-item:hover {
    background: rgb(255 255 255 / 45%);
    color: var(--ink);
  }

  .nav-item.is-active {
    background: var(--surface);
    color: var(--green);
    box-shadow: 0 4px 15px rgb(22 52 45 / 5%);
  }

  .sidebar-add {
    width: 100%;
    margin-top: 18px;
  }

  .sidebar-coach-card {
    margin-top: auto;
    padding: 16px;
    border: 1px solid rgb(37 105 90 / 8%);
    border-radius: 16px;
    background: var(--mint-2);
  }

  .sidebar-coach-card p {
    margin: 7px 0 10px;
    color: var(--ink-2);
    font-size: .73rem;
    line-height: 1.45;
  }

  .sidebar-coach-card button {
    padding: 0;
    background: transparent;
    color: var(--green);
    font-size: .69rem;
    font-weight: 720;
  }

  .sidebar-profile {
    display: grid;
    margin-top: 15px;
    padding: 13px 8px 0;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border-top: 1px solid rgb(22 52 45 / 9%);
  }

  .sidebar-profile strong,
  .sidebar-profile small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-profile strong {
    font-size: .76rem;
  }

  .sidebar-profile small {
    color: var(--muted);
    font-size: .6rem;
  }

  .status-dot {
    width: 8px;
    height: 8px;
    border: 2px solid #dff4e8;
    border-radius: 50%;
    background: #50a878;
  }

  .mobile-header,
  .bottom-nav,
  .floating-add,
  .mobile-menu,
  .mobile-menu-backdrop {
    display: none;
  }

  main {
    min-height: 100dvh;
    padding: 48px clamp(30px, 5vw, 72px) 60px;
  }

  .desktop-only {
    display: inline-flex;
  }

  .period-select-control {
    display: none;
  }

  .dashboard-head {
    flex-wrap: wrap;
  }

  .period-segments {
    display: inline-flex;
    min-height: 44px;
    padding: 4px;
    align-items: center;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgb(255 253 248 / 70%);
    box-shadow: var(--shadow-sm);
  }

  .month-year-picker {
    display: inline-flex;
    gap: 8px;
  }

  .dashboard-head .month-year-picker .select-wrap {
    min-height: 44px;
    padding: 0 32px 0 40px;
    flex: 0 1 auto;
    flex-direction: row;
    justify-content: flex-start;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: border-color 160ms ease, background 160ms ease;
  }

  .dashboard-head .month-year-picker .select-wrap::before {
    display: none;
  }

  .dashboard-head .month-year-picker .select-wrap:first-child {
    min-width: 140px;
  }

  .dashboard-head .month-year-picker .select-wrap:nth-child(2) {
    min-width: 100px;
  }

  .dashboard-head .month-year-picker .select-wrap:hover {
    border-color: var(--green-2);
    background: #fff;
  }

  .dashboard-head .month-year-picker .select-wrap:focus-within {
    border-color: var(--green-2);
    box-shadow: var(--shadow-sm), 0 0 0 3px rgb(37 105 90 / 12%);
  }

  .dashboard-head .month-year-picker .select-wrap:active {
    transform: none;
  }

  .dashboard-head .month-year-picker .select-wrap:has(.desktop-choice-menu.is-open) {
    border-color: var(--green-2);
    background: var(--surface);
    box-shadow: var(--shadow-sm), 0 0 0 3px rgb(37 105 90 / 12%);
  }

  .dashboard-head .month-year-picker .select-wrap .period-calendar-icon {
    top: 50%;
    left: 10px;
    width: 16px;
    height: 16px;
    padding: 5px;
    border-radius: 8px;
    background: var(--mint-2);
    color: var(--green-2);
    transform: translateY(-50%);
  }

  .dashboard-head .month-year-picker .select-wrap > svg:not(.period-calendar-icon) {
    top: 50%;
    right: 12px;
    width: 14px;
    height: 14px;
    color: var(--muted);
    transform: translateY(-50%);
    transition: transform 180ms ease;
  }

  .dashboard-head .month-year-picker .desktop-choice-menu.is-open + svg {
    transform: translateY(-50%) rotate(180deg);
  }

  .dashboard-head .month-year-picker .period-desktop-trigger > svg {
    display: none;
  }

  .period-segments button {
    min-height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: .66rem;
    font-weight: 680;
    white-space: nowrap;
  }

  .period-segments button:hover {
    background: rgb(22 52 45 / 5%);
    color: var(--ink);
  }

  .period-segments button.is-active {
    background: var(--green);
    color: #fff;
    box-shadow: 0 3px 9px rgb(23 74 63 / 16%);
  }

  .period-drawer-trigger {
    display: none;
  }

  .mobile-choice-trigger {
    display: none;
  }

  .choice-enhanced .desktop-choice-trigger {
    display: inline-flex;
    width: 100%;
    min-height: 47px;
  }

  .month-year-picker .period-desktop-trigger {
    min-height: 42px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    box-shadow: none;
    font-size: .83rem;
    font-weight: 720;
    letter-spacing: -.01em;
  }

  .month-year-picker .period-desktop-trigger:hover {
    background: transparent;
  }

  .month-year-picker .choice-enhanced > select {
    display: none;
  }

  .month-year-picker .desktop-choice-menu {
    min-width: 100%;
  }

  .choice-enhanced:not(.select-wrap) .desktop-choice-menu {
    right: 0;
    left: 0;
    min-width: 100%;
  }

  .choice-enhanced > select {
    display: none;
  }

  .choice-enhanced.select-wrap {
    display: inline-flex;
  }

  .choice-enhanced.select-wrap > svg {
    display: block;
  }

  .tasks-head {
    margin-bottom: 18px;
  }

  .task-summary {
    gap: 12px;
  }

  .task-metric {
    min-height: 100px;
    padding: 15px 17px 13px;
  }

  .task-tabs {
    margin-right: 0;
    margin-left: 0;
    padding-right: 0;
    padding-left: 0;
  }

  .task-tab {
    flex: 1 1 0;
  }

  .task-list {
    margin-top: 16px;
  }

  .dashboard-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px;
  }

  .hero-card {
    grid-column: span 4;
    padding: 28px;
  }

  .coach-nudge-card {
    grid-column: span 2;
    flex-direction: column;
    padding: 25px;
  }

  .spending-panel,
  .trend-panel {
    grid-column: span 3;
  }

  .recent-panel {
    grid-column: span 4;
  }

  .merchant-panel {
    grid-column: span 2;
  }

  .metric-row strong {
    font-size: .91rem;
  }

  .chat-composer {
    bottom: 0;
  }

  .coach-view.is-active {
    height: calc(100dvh - 108px);
    min-height: 660px;
  }

  .coach-layout {
    grid-template-columns: 270px minmax(0, 1fr);
    align-items: stretch;
  }

  .chat-sessions {
    display: flex;
    min-height: 0;
    padding: 14px;
    flex-direction: column;
    overflow: hidden;
  }

  .session-panel-head {
    display: flex;
    padding: 2px 2px 12px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--line);
  }

  .session-panel-head strong {
    display: block;
    margin-top: 3px;
    font-size: .88rem;
  }

  .chat-sessions .session-list {
    margin: 10px -3px;
    padding: 0 3px;
    flex: 1 1 auto;
  }

  .session-context {
    padding: 14px 4px 3px;
    flex: 0 0 auto;
    border-top: 1px solid var(--line);
  }

  .session-context > strong {
    display: block;
    margin: 5px 0;
    font-family: var(--number-font);
    font-size: .95rem;
  }

  .session-context > p:last-child {
    color: var(--muted);
    font-size: .62rem;
    line-height: 1.45;
  }

  .session-drawer-trigger {
    display: none;
  }

  .chat-toolbar {
    min-height: 48px;
    justify-content: flex-end;
  }

  .coach-context {
    position: sticky;
    top: 30px;
    display: block;
    padding: 25px;
  }

  .coach-orb.large {
    width: 56px;
    height: 56px;
    margin-bottom: 24px;
  }

  .coach-context > strong {
    display: block;
    margin: 7px 0 8px;
    font-family: var(--number-font);
    font-size: 1.35rem;
  }

  .coach-context > p:not(.card-label) {
    color: var(--muted);
    font-size: .76rem;
  }

  .privacy-note {
    display: flex;
    margin-top: 24px;
    padding-top: 18px;
    gap: 8px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .63rem;
  }

  .privacy-note svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    color: var(--green-2);
  }

  .chat-card {
    height: 100%;
    min-height: 0;
    max-height: none;
  }

  .chat-messages {
    padding: 28px;
  }

  .chat-composer {
    padding: 16px 20px;
  }

  .settings-card {
    padding: 26px;
  }

  .bottom-drawer {
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(500px, 45vw);
    max-height: none;
    padding: 26px 28px;
    border-radius: 0;
    transform: translateX(105%);
  }

  .bottom-drawer.task-drawer {
    width: min(560px, 50vw);
  }

  .bottom-drawer.is-open {
    transform: translateX(0);
  }

  .bottom-drawer .drawer-handle {
    display: none;
  }

  .drawer-header {
    margin: 8px 0 28px;
  }

  .drawer-backdrop {
    z-index: 80;
  }

  .install-banner,
  .toast-region {
    bottom: 24px;
  }
}

@media (min-width: 1240px) {
  .spending-content {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .panel,
  .coach-nudge-card {
    border-radius: var(--radius-lg);
  }

  .hero-card {
    border-radius: var(--radius-lg);
  }
}

@media (max-width: 430px) {
  .page-head h1 {
    font-size: 1.95rem;
  }

  .dashboard-head {
    display: grid;
  }

  .dashboard-head .head-actions {
    position: absolute;
    top: calc(max(10px, env(safe-area-inset-top)) + 72px);
    right: 16px;
  }

  .dashboard-head .page-subtitle {
    padding-right: 120px;
  }

  .tasks-toolbar {
    grid-template-columns: 1fr;
  }

  .task-priority-control select {
    min-height: 44px;
  }

  .hero-card,
  .panel,
  .coach-nudge-card {
    border-radius: 20px;
  }

  .merchant-panel {
    display: none;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .page-head .button-label {
    display: none;
  }

  .page-head > .primary-button {
    width: 46px;
    padding: 0;
  }
}

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

.auth-screen {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: var(--paper);
}

.auth-card {
  display: grid;
  width: min(400px, 100%);
  padding: 32px 28px;
  justify-items: start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.auth-card .brand-mark {
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border-radius: 14px;
  font-size: 1.4rem;
}

.auth-card h1 {
  font-size: 1.55rem;
}

.auth-sub {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: .8rem;
}

.auth-form {
  display: grid;
  width: 100%;
  gap: 12px;
}

.auth-error {
  color: var(--danger);
  font-size: .74rem;
}

.auth-form .primary-button {
  width: 100%;
}
