:root {
  color-scheme: dark;
  --bg: #000402;
  --bg-soft: #07100b;
  --panel: #111716;
  --panel-2: #151d1c;
  --panel-3: #1a2321;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(88, 235, 83, 0.42);
  --text: #f7fbf7;
  --muted: #a3aea8;
  --faint: #6f7b75;
  --green: #55e34f;
  --green-2: #1ca33a;
  --blue: #2997ff;
  --cyan: #28d0d4;
  --amber: #ff941f;
  --red: #ff504d;
  --radius: 8px;
  --shadow: 0 18px 70px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

*,
*::before,
*::after {
  min-width: 0;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

body {
  min-height: 100svh;
  overflow-x: hidden;
  scroll-padding-bottom: calc(env(safe-area-inset-bottom) + 132px);
}

.app-shell {
  position: relative;
  min-height: 100svh;
  padding: calc(env(safe-area-inset-top) + 18px) 18px calc(env(safe-area-inset-bottom) + 112px);
  background:
    radial-gradient(900px 460px at 70% -10%, rgba(86, 227, 79, 0.13), transparent 56%),
    linear-gradient(180deg, #010504 0%, var(--bg) 100%);
}

.app-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: -6px -2px 18px;
  padding: 8px 0;
  background: linear-gradient(180deg, rgba(0, 4, 2, 0.98), rgba(0, 4, 2, 0.82) 72%, transparent);
  backdrop-filter: blur(16px);
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: linear-gradient(145deg, #181f1f, #0d1110);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.icon-button img,
.asset-icon img,
.brand-mark img,
.file-icon img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: brightness(0) invert(90%);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 8px;
  min-width: 0;
}

.brand-lockup strong {
  font-size: 1.42rem;
  line-height: 1;
  white-space: nowrap;
}

.brand-lockup strong span {
  color: var(--green);
}

.brand-mark {
  position: relative;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 2px solid var(--green);
  border-radius: 8px;
  box-shadow: 0 0 22px rgba(86, 227, 79, 0.26);
}

.brand-mark img {
  width: 18px;
  height: 18px;
  filter: brightness(0) saturate(100%) invert(79%) sepia(95%) saturate(612%) hue-rotate(56deg) brightness(98%) contrast(91%);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-width: 2px;
  border: 2px solid var(--green);
  border-radius: 12px;
  opacity: 0.18;
}

.local-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  white-space: nowrap;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 750;
}

.local-badge i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  padding-bottom: 12px;
}

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

.intro-panel,
.file-card,
.preview-stack article,
.balance-card,
.metric-grid article,
.panel,
.notice,
.detail-card,
.table-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(25, 33, 31, 0.96), rgba(12, 17, 15, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.intro-panel {
  margin-bottom: 14px;
  padding: 18px;
}

.intro-panel p,
.preview-stack span,
.file-card small,
.card-label-row span,
.card-label-row small,
.metric-grid p,
.metric-grid small,
.detail-header span,
.detail-card small,
.empty-copy,
.row-list small,
.data-row span,
.chart-legend,
.forecast-row span {
  color: var(--muted);
}

.intro-panel p {
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 850;
}

.intro-panel h1 {
  margin-bottom: 12px;
  font-size: 2.62rem;
  line-height: 0.98;
  letter-spacing: 0;
}

.intro-panel span {
  color: var(--green);
  font-weight: 760;
}

.file-card {
  display: grid;
  min-height: 188px;
  place-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 22px;
  text-align: center;
  cursor: pointer;
}

.file-card.is-dragging,
.file-card:focus-within,
.file-card:hover {
  border-color: var(--line-strong);
  background: linear-gradient(145deg, rgba(28, 163, 58, 0.16), rgba(12, 17, 15, 0.96));
}

.file-icon {
  position: relative;
  display: grid;
  width: 48px;
  height: 58px;
  place-items: center;
  border: 2px solid var(--green);
  border-radius: 8px;
}

.file-icon img {
  width: 28px;
  height: 28px;
  filter: brightness(0) saturate(100%) invert(79%) sepia(95%) saturate(612%) hue-rotate(56deg) brightness(98%) contrast(91%);
}

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

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

.preview-stack article {
  padding: 16px;
}

.preview-stack span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 850;
}

.preview-stack strong {
  display: block;
  font-size: 1rem;
  line-height: 1.32;
}

.notice {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-color: rgba(255, 148, 31, 0.42);
  color: #ffd8ad;
  font-size: 0.88rem;
  line-height: 1.35;
}

.balance-card {
  position: relative;
  min-height: 244px;
  margin-bottom: 14px;
  padding: 20px;
  overflow: hidden;
  border-color: var(--line-strong);
  background:
    linear-gradient(140deg, rgba(47, 176, 50, 0.23), rgba(7, 16, 11, 0.7) 50%),
    var(--panel);
}

.balance-card > *:not(.sparkline) {
  position: relative;
  z-index: 2;
}

.card-label-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-label-row span {
  font-weight: 760;
}

.balance-card > strong {
  display: block;
  margin-bottom: 10px;
  color: var(--green);
  font-size: 2.9rem;
  line-height: 0.95;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.delta-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 34px;
  border-radius: 8px;
  padding: 7px 10px;
  background: rgba(86, 227, 79, 0.13);
  color: var(--green);
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.delta-pill.is-negative {
  background: rgba(255, 80, 77, 0.13);
  color: #ff8582;
}

.sparkline {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  height: 96px;
  z-index: 0;
  opacity: 0.82;
}

.sparkline svg,
.line-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

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

.metric-grid article {
  min-height: 118px;
  padding: 14px 12px;
}

.metric-grid article:nth-child(3) {
  grid-column: 1 / -1;
  min-height: 104px;
}

.metric-icon {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 50%;
}

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

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

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

.metric-icon img {
  width: 22px;
  height: 22px;
  filter: brightness(0) saturate(100%) invert(2%) sepia(13%) saturate(1214%) hue-rotate(88deg) brightness(98%) contrast(104%);
}

.metric-grid p {
  margin-bottom: 4px;
  font-size: 0.91rem;
  font-weight: 780;
}

.metric-grid strong {
  display: block;
  margin-bottom: 3px;
  font-size: 1.28rem;
  line-height: 1.06;
  overflow-wrap: anywhere;
}

.metric-grid small {
  font-size: 0.78rem;
}

.panel {
  margin-bottom: 14px;
  padding: 16px;
}

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

.panel-heading h2,
.detail-header h1,
.detail-card h2,
.table-card h2 {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: 0;
}

.link-button,
.back-button,
.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 820;
}

.link-button {
  padding: 0;
  background: transparent;
  color: var(--green);
}

.button-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  flex: 0 0 auto;
}

.button-icon img {
  display: block;
  width: 18px;
  height: 18px;
  filter: brightness(0) saturate(100%) invert(79%) sepia(95%) saturate(612%) hue-rotate(56deg) brightness(98%) contrast(91%);
}

.line-chart {
  height: 178px;
}

.chart-legend {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 720;
}

.chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 3px;
  vertical-align: -1px;
}

.legend-income {
  background: var(--green);
}

.legend-spend {
  background: var(--blue);
}

.legend-net {
  background: var(--cyan);
}

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

.calendar-label,
.calendar-day {
  display: grid;
  min-height: 34px;
  place-items: center;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 760;
}

.calendar-label {
  min-height: 20px;
  color: var(--muted);
}

.calendar-day {
  border: 0;
  background: #242b29;
  color: #d6ddd9;
  cursor: pointer;
}

.calendar-day.is-empty {
  opacity: 0;
}

.calendar-day[data-level="1"] {
  background: #153245;
}

.calendar-day[data-level="2"] {
  background: #1560a8;
}

.calendar-day[data-level="3"] {
  background: #2388e8;
}

.calendar-day[data-level="4"] {
  background: #43a6ff;
  color: #04121c;
}

.bills-treemap {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(74px, auto);
  gap: 6px;
}

.bill-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 74px;
  border: 0;
  border-radius: 7px;
  padding: 11px;
  color: #fff;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.bill-tile strong,
.bill-tile span {
  position: relative;
  z-index: 1;
}

.bill-tile strong {
  font-size: 0.92rem;
  line-height: 1.15;
}

.bill-tile span {
  font-size: 0.82rem;
  font-weight: 760;
}

.bill-tile.size-xl {
  grid-column: span 6;
  background: linear-gradient(135deg, #d52b27, #fe7615);
}

.bill-tile.size-lg {
  grid-column: span 5;
  background: linear-gradient(135deg, #f06712, #fba60b);
}

.bill-tile.size-md {
  grid-column: span 4;
  background: linear-gradient(135deg, #e6a70d, #2b9d28);
}

.bill-tile.size-sm {
  grid-column: span 3;
  background: linear-gradient(135deg, #257f21, #1ca33a);
}

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

.review-metrics article {
  min-height: 74px;
  border-right: 1px solid var(--line);
  padding-right: 8px;
}

.review-metrics article:last-child {
  border-right: 0;
}

.review-metrics strong {
  display: block;
  margin-bottom: 7px;
  font-size: 1.65rem;
}

.review-metrics span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.22;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  padding: 0 12px 0 10px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 780;
  white-space: nowrap;
}

.detail-header > div {
  min-width: 0;
}

.detail-header span {
  display: block;
  margin-bottom: 3px;
  font-size: 0.8rem;
  font-weight: 780;
}

.detail-content {
  display: grid;
  gap: 12px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 96px);
}

.detail-card,
.table-card {
  padding: 15px;
}

.detail-card h2,
.table-card h2 {
  margin-bottom: 12px;
}

.primary-action,
.secondary-action {
  min-height: 44px;
  padding: 10px 13px;
}

.primary-action {
  background: var(--green);
  color: #031004;
}

.secondary-action {
  border: 1px solid var(--line);
  background: transparent;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bar-list,
.row-list,
.forecast-list {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.bar-row header,
.forecast-row,
.data-row,
.transaction-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.data-row {
  align-items: center;
}

.bar-row header span,
.bar-row header strong {
  font-size: 0.86rem;
}

.bar-track {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.row-list article,
.row-list .insight-row,
.regular-payment-row,
.forecast-row,
.data-row,
.transaction-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.row-list article:last-child,
.row-list .insight-row:last-child,
.regular-payment-row:last-child,
.forecast-row:last-child,
.data-row:last-child,
.transaction-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.row-list strong,
.insight-row strong,
.regular-payment-row strong,
.transaction-row strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.row-list small,
.insight-row small,
.regular-payment-row small,
.transaction-row span,
.forecast-row span {
  display: block;
  margin-top: 3px;
  font-size: 0.78rem;
}

.insight-row,
.transaction-row {
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.amount-out {
  color: #ff9b99;
  white-space: nowrap;
}

.amount-in {
  color: var(--green);
  white-space: nowrap;
}

.filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.filter-row input,
.filter-row select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #090f0d;
  color: var(--text);
}

.section-menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + 34px) 10px 0;
  background: rgba(0, 0, 0, 0.58);
}

.section-menu.is-open {
  display: flex;
}

.menu-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(100%, 430px);
  max-height: calc(100svh - env(safe-area-inset-top) - 46px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #202322;
  color: var(--text);
  box-shadow: 0 -18px 70px rgba(0, 0, 0, 0.58);
}

.menu-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  min-height: 66px;
  border-bottom: 1px solid var(--line);
  padding: 8px 12px;
}

.menu-header strong {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 900;
}

.menu-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 18px calc(env(safe-area-inset-bottom) + 30px);
}

.menu-group {
  padding: 22px 0 24px;
}

.menu-group + .menu-group {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.menu-group h2 {
  margin-bottom: 18px;
  text-align: center;
  font-size: 1.02rem;
  line-height: 1.16;
}

.menu-app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 12px;
}

.menu-app {
  display: grid;
  justify-items: center;
  align-content: start;
  min-height: 94px;
  gap: 9px;
  border: 0;
  border-radius: 8px;
  padding: 0 2px;
  background: transparent;
  color: var(--text);
  text-align: center;
  font-size: 0.83rem;
  font-weight: 760;
  line-height: 1.2;
}

.menu-app.is-active {
  color: var(--green);
}

.menu-app-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.16);
}

.menu-app.is-active .menu-app-icon {
  border-color: rgba(85, 227, 79, 0.42);
  background: rgba(85, 227, 79, 0.12);
}

.menu-app-icon img {
  width: 24px;
  height: 24px;
  filter: brightness(0) saturate(100%) invert(78%) sepia(7%) saturate(269%) hue-rotate(91deg) brightness(88%) contrast(86%);
}

.menu-app.is-active .menu-app-icon img {
  filter: brightness(0) saturate(100%) invert(79%) sepia(95%) saturate(612%) hue-rotate(56deg) brightness(98%) contrast(91%);
}

.close-button {
  position: relative;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.close-button::before,
.close-button::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 11px;
  width: 20px;
  height: 2px;
  border-radius: 99px;
  background: var(--text);
}

.close-button::before {
  transform: rotate(45deg);
}

.close-button::after {
  transform: rotate(-45deg);
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  padding: 8px 10px calc(env(safe-area-inset-bottom) + 8px);
  background: #000402;
  backdrop-filter: blur(16px);
}

.bottom-nav button {
  position: relative;
  display: grid;
  min-height: 52px;
  place-items: center;
  gap: 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 760;
}

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

.bottom-nav i {
  position: absolute;
  top: 2px;
  right: 18px;
  min-width: 20px;
  border-radius: 99px;
  padding: 2px 5px;
  background: var(--red);
  color: #fff;
  font-size: 0.7rem;
  font-style: normal;
  line-height: 1.1;
}

.nav-icon {
  position: relative;
  width: 23px;
  height: 23px;
  color: currentColor;
}

.nav-icon.asset-icon {
  display: grid;
  place-items: center;
}

.nav-icon.asset-icon::before,
.nav-icon.asset-icon::after {
  display: none;
}

.nav-icon img {
  width: 23px;
  height: 23px;
  filter: brightness(0) saturate(100%) invert(77%) sepia(9%) saturate(257%) hue-rotate(91deg) brightness(86%) contrast(86%);
}

.bottom-nav button.is-active .nav-icon img {
  filter: brightness(0) saturate(100%) invert(79%) sepia(95%) saturate(612%) hue-rotate(56deg) brightness(98%) contrast(91%);
}

.empty-copy {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.42;
}

.period-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.date-controls {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  gap: 8px;
  margin-bottom: 12px;
}

.date-controls.is-inline {
  margin: 0 0 12px;
}

.date-step,
.date-controls select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 820;
}

.date-step {
  display: grid;
  place-items: center;
}

.date-controls select {
  width: 100%;
  padding: 0 10px;
}

.date-step:disabled {
  opacity: 0.36;
}

.segment-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.segment-row.is-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 10px;
}

.segment-row button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 820;
}

.segment-row button.is-active {
  border-color: var(--line-strong);
  background: rgba(86, 227, 79, 0.14);
  color: var(--green);
}

.regulars-total {
  margin-bottom: 8px;
  color: var(--green);
  font-size: 2.15rem;
  font-weight: 900;
  line-height: 1;
  overflow-wrap: anywhere;
}

.forecast-horizon-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.forecast-horizon-grid article {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.forecast-horizon-grid strong,
.forecast-horizon-grid span {
  display: block;
}

.forecast-horizon-grid strong {
  margin-bottom: 6px;
  font-size: 1.1rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.forecast-horizon-grid span,
.explorer-count {
  color: var(--muted);
  font-size: 0.78rem;
}

.watchlist-row {
  position: relative;
  padding-left: 0;
}

.watch-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 6px;
  border-radius: 8px;
  padding: 4px 7px;
  background: rgba(255, 148, 31, 0.14);
  color: #ffd6aa;
  font-size: 0.72rem;
  font-weight: 850;
}

.review-metrics.is-compact article {
  min-height: 64px;
}

.row-amount {
  text-align: right;
  white-space: nowrap;
}

.regular-payment-list {
  gap: 12px;
}

.regular-payment-row {
  display: grid;
  width: 100%;
  min-height: 76px;
  grid-template-columns: minmax(0, 1fr) 94px;
  align-items: center;
  gap: 12px;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.regular-row-main {
  display: block;
  min-width: 0;
}

.regular-row-trend {
  display: block;
  width: 86px;
  height: 42px;
}

.regular-row-trend svg {
  display: block;
  width: 100%;
  height: 100%;
}

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

.payment-map-card {
  display: grid;
  min-height: 108px;
  align-content: space-between;
  gap: 10px;
  border: 1px solid rgba(85, 227, 79, 0.24);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(145deg, rgba(85, 227, 79, 0.15), rgba(41, 151, 255, 0.07));
  color: var(--text);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.payment-map-card.is-major {
  grid-column: 1 / -1;
  min-height: 136px;
}

.payment-map-card.is-large {
  min-height: 122px;
}

.payment-map-name {
  display: -webkit-box;
  min-height: 2.45em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.payment-map-amount {
  color: var(--green);
  font-size: clamp(1rem, 4.4vw, 1.42rem);
  line-height: 1;
}

.payment-map-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.payment-map-meta small {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(9, 16, 14, 0.34);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 780;
  line-height: 1;
  white-space: nowrap;
}

.payment-map-card.is-small {
  min-height: 94px;
}

.payment-map-card.is-small .payment-map-name {
  min-height: 2.2em;
  font-size: 0.78rem;
}

.payment-map-card.is-small .payment-map-amount {
  font-size: 1.02rem;
}

.payment-map-card.is-small .payment-map-meta small:last-child {
  display: none;
}

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

.payment-rank-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px 12px;
  align-items: center;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 0 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.payment-rank-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.payment-rank-row strong,
.payment-rank-row small,
.payment-rank-row b {
  display: block;
}

.payment-rank-row strong {
  font-size: 0.88rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.payment-rank-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.16;
}

.payment-rank-row b {
  color: var(--green);
  font-size: 0.92rem;
  white-space: nowrap;
}

.payment-rank-row i {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.payment-rank-row i::before {
  content: "";
  display: block;
  width: var(--payment-width);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

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

.snapshot-charts article {
  min-height: 156px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.snapshot-charts span,
.snapshot-charts small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.snapshot-charts strong {
  display: block;
  margin-top: 7px;
  font-size: 0.98rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.mini-donut,
.mini-spark {
  height: 74px;
  margin: 6px 0;
}

.mini-donut svg,
.mini-spark svg,
.donut-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.donut-panel {
  display: grid;
  gap: 12px;
}

.donut-chart {
  width: min(172px, 70%);
  aspect-ratio: 1;
  justify-self: center;
}

.month-bars {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  min-height: 152px;
  align-items: end;
}

.month-bars button {
  display: grid;
  gap: 7px;
  align-items: end;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.month-bars button.is-selected span {
  color: var(--green);
}

.month-bars span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 780;
  text-align: center;
}

.bar-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(4px, 1fr));
  gap: 3px;
  height: 112px;
  align-items: end;
}

.bar-pair i {
  display: block;
  min-height: 4px;
  border-radius: 5px 5px 2px 2px;
}

.bar-pair .is-income {
  background: var(--green);
}

.bar-pair .is-spend {
  background: var(--blue);
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.snapshot-grid article {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.snapshot-grid strong,
.snapshot-grid span {
  display: block;
}

.snapshot-grid strong {
  margin-bottom: 7px;
  font-size: 1rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.snapshot-grid span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.2;
}

.period-pill {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 820;
}

.period-pill.is-active {
  border-color: rgba(85, 227, 79, 0.48);
  background: rgba(85, 227, 79, 0.13);
  color: var(--green);
}

.cash-health-card {
  min-height: 236px;
}

.cash-health-card > strong {
  font-size: 2.65rem;
}

.after-regulars {
  display: inline-flex;
  max-width: 100%;
  margin-top: 8px;
  min-height: 28px;
  align-items: center;
  border-radius: 8px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 820;
  line-height: 1.22;
  overflow-wrap: anywhere;
  backdrop-filter: blur(8px);
}

.after-regulars.is-negative {
  background: rgba(255, 80, 77, 0.14);
  color: #ffb0ad;
}

.compact-list,
.change-list {
  display: grid;
  gap: 9px;
}

.compact-row,
.change-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 58px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 9px;
}

.compact-row:last-child,
.change-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.compact-row strong,
.change-row strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.compact-row span,
.compact-row small,
.change-row span,
.change-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.2;
}

.row-amount {
  text-align: right;
  white-space: nowrap;
}

.change-row.is-good strong {
  color: var(--green);
}

.change-row.is-bad strong {
  color: #ff9b99;
}

.spend-calendar.is-compact {
  gap: 6px;
}

.spend-calendar.is-compact .calendar-day {
  min-height: 31px;
}

.regulars-summary-card {
  border-color: rgba(85, 227, 79, 0.32);
}

.regulars-total {
  margin: 6px 0 8px;
  color: var(--green);
  font-size: 2.35rem;
  font-weight: 900;
  line-height: 1;
  overflow-wrap: anywhere;
}

.segment-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.segment-row button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 820;
}

.segment-row button.is-active {
  border-color: rgba(85, 227, 79, 0.42);
  background: rgba(85, 227, 79, 0.16);
  color: var(--green);
}

.line-chart.is-mini {
  height: 112px;
}

.bottom-nav {
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.42);
}

@media (max-width: 430px) {
  .app-shell {
    padding-bottom: calc(env(safe-area-inset-bottom) + 122px);
  }

  .forecast-horizon-grid,
  .snapshot-grid {
    grid-template-columns: 1fr;
  }
}

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

  .brand-lockup strong {
    font-size: 1.22rem;
  }

  .local-badge {
    width: 28px;
    overflow: hidden;
    color: transparent;
  }

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

  .review-metrics {
    grid-template-columns: 1fr;
  }

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

  .snapshot-charts {
    grid-template-columns: 1fr;
  }

  .regular-payment-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .regular-row-trend {
    width: 100%;
  }

  .payment-map {
    grid-template-columns: 1fr;
  }

  .payment-map-card,
  .payment-map-card.is-major,
  .payment-map-card.is-large,
  .payment-map-card.is-medium {
    grid-column: auto;
    min-height: 104px;
  }
}

@media (min-width: 680px) {
  .app-shell {
    max-width: 430px;
    margin: 0 auto;
    padding-top: calc(env(safe-area-inset-top) + 72px);
  }
}
