/* Mobile refinements: keep the notebook identity, give data room to breathe. */
html,
body {
  touch-action: pan-x pan-y;
}

body,
body * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

input,
textarea,
[contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
}

body {
  line-height: 1.35;
  -webkit-text-size-adjust: 100%;
}

button,
a,
input,
select {
  touch-action: manipulation;
}

button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #1263ad;
  outline-offset: 3px;
}

.main-content {
  padding-top: calc(80px + env(safe-area-inset-top));
  padding-bottom: calc(160px + env(safe-area-inset-bottom));
}

.topbar {
  position: fixed;
  z-index: 29;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 610px);
  min-height: calc(82px + env(safe-area-inset-top));
  margin: 0;
  padding: calc(13px + env(safe-area-inset-top)) 20px 24px;
  display: grid;
  grid-template-columns: 1fr;
  place-items: start center;
  background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, .96) 62%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.title-wrap {
  min-width: 0;
  justify-self: center;
  text-align: center;
}

.title-wrap h1 {
  margin: 0;
  font-size: clamp(29px, 7.7vw, 38px);
  line-height: 1.15;
}

.title-wrap>span {
  height: 5px;
  margin-top: 2px;
  background: var(--blue);
}

.sync-beacon {
  position: absolute;
  top: calc(22px + env(safe-area-inset-top));
  left: 21px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #aab2bd;
  pointer-events: none;
}

.sync-beacon-dot {
  position: relative;
  z-index: 2;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(170, 178, 189, .18);
  transition: color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.sync-beacon-wave {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 50%;
  opacity: .22;
  transition: color .2s ease, opacity .2s ease;
}

.sync-beacon-wave-two {
  width: 30px;
  height: 30px;
  opacity: .1;
}

.sync-beacon[data-state="session"] {
  color: #2484e4;
}

.sync-beacon[data-state="session"] .sync-beacon-dot {
  box-shadow: 0 0 0 3px rgba(36, 132, 228, .18);
}

.sync-beacon[data-state="syncing"] {
  color: #ed922b;
}

.sync-beacon[data-state="synced"] {
  color: #25ad72;
}

.sync-beacon[data-state="syncing"] .sync-beacon-dot {
  box-shadow: 0 0 0 4px rgba(237, 146, 43, .2), 0 0 13px rgba(237, 146, 43, .6);
  animation: sync-beacon-pulse .82s ease-in-out infinite alternate;
}

.sync-beacon[data-state="syncing"] .sync-beacon-wave {
  animation: sync-beacon-wave 1.35s ease-out infinite;
}

.sync-beacon[data-state="syncing"] .sync-beacon-wave-two {
  animation-delay: .42s;
}

.sync-beacon[data-state="synced"] .sync-beacon-dot {
  box-shadow: 0 0 0 4px rgba(37, 173, 114, .2);
  transform: scale(1.08);
}

.sync-beacon[data-state="error"] {
  color: #e45649;
}

@keyframes sync-beacon-pulse {
  to { transform: scale(1.28); }
}

@keyframes sync-beacon-wave {
  0% { opacity: .5; transform: scale(.55); }
  75%, 100% { opacity: 0; transform: scale(1.22); }
}

.month-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 6px auto 18px;
  touch-action: pan-y;
}

.month-navigation .month-chip {
  margin: 0;
  min-width: 0;
  justify-content: center;
  padding: 4px 15px;
  font-size: 22px;
  min-height: 48px;
}

.month-arrow {
  flex: 0 0 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #d5e0ea;
  background: #fffdf8;
  border-radius: 50%;
  font: 30px/1 system-ui;
  color: #245a82;
}

.text-button,
.cancel-button,
.pay-button,
.mini-tabs button,
.nav-item,
#closeSearch {
  min-height: 44px;
}

.text-button {
  flex-shrink: 0;
  color: #075faa;
}

.section-heading {
  gap: 8px;
  min-height: 44px;
}

.section-heading h2 {
  font-size: clamp(24px, 6.4vw, 31px);
  line-height: 1.2;
}

.today-tag {
  display: block;
  font: 12px/1.4 var(--sans);
  color: #52647b;
  margin-top: 3px;
}

.section-heading h2:after {
  bottom: -4px;
}

.filter-chip.is-active {
  outline: 2px solid #275e88;
  outline-offset: -2px;
}

.movements-panel .filter-row {
  margin: 0 -2px 8px;
  padding: 2px 2px 10px;
}

.pending-panel {
  position: relative;
  margin-left: 0;
  overflow: visible;
}

.pending-panel:before {
  content: "";
  position: absolute;
  z-index: 2;
  left: -10px;
  top: 18px;
  bottom: 18px;
  width: 19px;
  pointer-events: none;
  background: radial-gradient(circle at center, #f3f0e7 0 6px, transparent 6.5px) center top / 19px 34px repeat-y;
}

.pending-list {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 3px 2px 8px;
  scroll-snap-type: x mandatory;
  overscroll-behavior-inline: contain;
}

.pending-card {
  position: relative;
  isolation: isolate;
  flex: 0 0 156px;
  min-height: 156px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  scroll-snap-align: start;
  -webkit-touch-callout: none;
}

.pending-list.is-postit {
  gap: 12px;
  padding: 10px 3px 8px;
}

.pending-list.is-postit .pending-card {
  --postit-color: var(--coral-soft);
  border: 0;
  border-radius: 3px;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.pending-list.is-postit .pending-card:nth-child(3n+2) {
  --postit-color: var(--yellow-soft);
}

.pending-list.is-postit .pending-card:nth-child(3n+3) {
  --postit-color: var(--blue-soft);
}

.postit-paper,
.postit-fold {
  display: none;
}

.pending-list.is-postit .postit-paper {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  background: var(--postit-color);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 19px), calc(100% - 19px) 100%, 0 100%);
  pointer-events: none;
}

.pending-list.is-postit .postit-fold {
  position: absolute;
  z-index: 2;
  right: 4px;
  bottom: 4px;
  display: block;
  width: 15px;
  height: 15px;
  background: rgba(255, 255, 255, .72);
  clip-path: polygon(0 0, 0 100%, 100% 0);
  pointer-events: none;
}

.pending-list.is-postit .pending-card:before {
  content: "";
  position: absolute;
  z-index: 2;
  top: -7px;
  left: 50%;
  width: 46px;
  height: 15px;
  border: 1px solid rgba(168, 145, 93, .2);
  background: rgba(246, 232, 174, .9);
  clip-path: polygon(2% 8%, 97% 0, 100% 88%, 3% 100%);
  transform: translateX(-50%);
  pointer-events: none;
}

.pending-list.is-postit .pending-main,
.pending-list.is-postit .pending-card>header,
.pending-list.is-postit .automatic-payment-label,
.pending-list.is-postit .pending-actions {
  position: relative;
  z-index: 1;
}

.pending-list.is-postit .pending-main {
  padding-right: 0;
}

.pending-list.is-postit .pending-long-press {
  border-radius: 3px;
}

.pending-card:focus-visible {
  outline: 3px solid #1263ad;
  outline-offset: 2px;
}

.pending-card.is-long-pressing {
  user-select: none;
  -webkit-user-select: none;
}

.pending-long-press {
  position: absolute;
  z-index: 3;
  inset: -1px;
  overflow: hidden;
  border-radius: 14px;
  opacity: 0;
  pointer-events: none;
}

.pending-card.is-long-pressing .pending-long-press {
  opacity: 1;
}

.pending-long-press i {
  position: absolute;
  display: block;
  background: var(--coral);
  box-shadow: 0 0 7px rgba(255, 116, 94, .48);
}

.pending-long-press i:nth-child(1) {
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
}

.pending-long-press i:nth-child(2) {
  top: 0;
  right: 0;
  width: 3px;
  height: 0;
}

.pending-long-press i:nth-child(3) {
  right: 0;
  bottom: 0;
  width: 0;
  height: 3px;
}

.pending-long-press i:nth-child(4) {
  bottom: 0;
  left: 0;
  width: 3px;
  height: 0;
}

.pending-card.is-long-pressing .pending-long-press i:nth-child(1) {
  animation: pending-outline-width .75s linear forwards;
}

.pending-card.is-long-pressing .pending-long-press i:nth-child(2) {
  animation: pending-outline-height .75s .75s linear forwards;
}

.pending-card.is-long-pressing .pending-long-press i:nth-child(3) {
  animation: pending-outline-width .75s 1.5s linear forwards;
}

.pending-card.is-long-pressing .pending-long-press i:nth-child(4) {
  animation: pending-outline-height .75s 2.25s linear forwards;
}

@keyframes pending-outline-width {
  to {
    width: 100%;
  }
}

@keyframes pending-outline-height {
  to {
    height: 100%;
  }
}

.pending-card h3 {
  margin: 0 0 1px;
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.08;
}

.pending-card strong {
  display: block;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 23px;
  overflow-wrap: normal;
}

.pending-card strong.is-variable {
  white-space: normal;
  color: #39536f;
  font: 700 14px/1.25 var(--sans);
}

.pending-card header {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  flex-wrap: wrap;
  margin: 0 0 8px;
}

.pending-card .due {
  padding: 3px 7px;
  font: 11px/1.35 var(--sans);
}

.pending-main {
  flex: none;
  min-width: 0;
  display: block;
  margin: 0 0 7px;
}

.pending-card .pending-actions {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 0 !important;
  margin-top: auto;
}

.pending-card .pay-button {
  min-height: 40px;
  font-size: 17px;
}

.recurrence-label {
  color: #52606f;
  font: 11px/1.4 var(--sans);
}

.automatic-payment-label {
  display: flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: -2px 0 7px;
  padding: 3px 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .58);
  color: #38536b;
  font: 700 10px/1.25 var(--sans);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.automatic-payment-label span {
  flex: none;
  font-size: 12px;
}

.movement-row {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  min-height: 76px;
  gap: 10px;
  padding: 10px 0;
}

.category-icon {
  width: 40px;
  height: 40px;
  font-size: 20px;
}

.movement-main strong {
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.2;
}

.movement-main small {
  font: 12px/1.5 var(--sans);
  margin-top: 4px;
}

.movement-amount {
  font: 600 clamp(13px, 3.6vw, 17px)/1.4 var(--sans);
  font-variant-numeric: tabular-nums;
}

.empty-state {
  width: 100%;
  padding: 28px 10px;
}

.empty-state span {
  display: block;
  margin-top: 8px;
  font: 14px/1.6 var(--sans);
}

.summary-toggle strong {
  font-size: 23px;
}

.analysis-hero-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  margin-top: 0;
}

.analysis-metric {
  min-width: 0;
  padding: 2px 16px 4px;
}

.analysis-hero-grid>.analysis-metric:first-child {
  padding-left: 0;
  padding-right: 16px;
  border-right: 1px solid var(--line);
}

.analysis-hero-grid>.analysis-metric:nth-child(2) {
  padding-right: 0;
}

.analysis-metric h2 {
  position: relative;
  display: inline-block;
  margin: 0 0 16px;
  font-size: clamp(20px, 5.6vw, 28px);
  font-weight: 400;
  line-height: 1.05;
}

.analysis-metric h2:after {
  content: "";
  position: absolute;
  left: -2px;
  right: -5px;
  bottom: -5px;
  height: 4px;
  border-radius: 50%;
  background: var(--yellow);
}

.analysis-hero-grid>.analysis-metric>strong {
  display: block;
  font-size: clamp(26px, 7vw, 42px);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.analysis-hero-grid .analysis-metric p {
  margin-top: 7px;
}

.analysis-hero-grid .analysis-metric p>span {
  padding: 4px 8px;
  font: 700 12px/1.35 var(--sans);
}

.analysis-hero-grid p small {
  display: block;
  margin: 7px 0 0;
  font: 11px/1.35 var(--sans);
}

.pending-unknown-total {
  display: block;
  margin-top: 7px;
  color: #52647b;
  font: 11px/1.4 var(--sans);
}

.daily-block {
  grid-column: 1 / -1;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 13px 0 0;
  border-top: 1px solid var(--line);
}

.daily-block p strong {
  font-size: clamp(25px, 6vw, 34px);
  overflow-wrap: anywhere;
}

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

.donut {
  width: 185px;
}

.donut:after {
  width: 116px;
}

.donut strong {
  max-width: 116px;
  overflow-wrap: anywhere;
  font-size: 23px;
}

.legend {
  width: 100%;
}

.legend-row {
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 7px 0;
}

.legend-row span {
  overflow-wrap: anywhere;
}

.legend-row small,
.legend-row strong {
  font: 12px/1.5 var(--sans);
}

.mini-tabs {
  min-width: 134px;
}

.mini-tabs button {
  padding: 0 10px;
}

.trend-chart {
  min-height: 0;
}

.insight-strip p {
  font-size: 18px;
}

.top-expenses-panel .movement-row {
  grid-template-columns: 40px minmax(0, 1fr) auto;
}

.top-expenses-panel .movement-row:after {
  display: none;
}

.top-expenses-panel .movement-amount {
  grid-column: 3;
}

.analysis-pending-panel {
  padding: 17px 16px;
  margin-bottom: 16px;
}

.analysis-pending-list {
  display: grid;
}

.analysis-pending-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 3px 10px;
  min-height: 76px;
  padding: 10px 0;
  border-bottom: 1px solid #e4e7eb;
}

.analysis-pending-row:last-child {
  border-bottom: 0;
}

.analysis-pending-row>.category-icon {
  grid-column: 1;
  grid-row: 1 / 3;
}

.analysis-pending-main {
  min-width: 0;
}

.analysis-pending-main strong,
.analysis-pending-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analysis-pending-main strong {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
}

.analysis-pending-main small {
  margin-top: 3px;
  color: var(--muted);
  font: 12px/1.45 var(--sans);
  white-space: normal;
}

.analysis-pending-mode {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--gray-soft);
  color: #52647b;
  font: 700 10px/1.25 var(--sans);
}

.analysis-pending-mode.is-automatic {
  background: var(--mint-soft);
  color: #155648;
}

.analysis-pending-amount {
  grid-column: 3;
  grid-row: 1 / 3;
  font: 600 clamp(13px, 3.6vw, 17px)/1.4 var(--sans);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.analysis-pending-amount.is-variable {
  max-width: 72px;
  color: #52647b;
  font-size: 11px;
  text-align: right;
  white-space: normal;
}

.goal-card {
  display: block;
  padding: 18px;
}

.goal-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.goal-card header>div {
  display: block;
  min-width: 0;
}

.goal-card header>div:before {
  display: none;
}

.goal-card h3 {
  font-size: 27px;
  overflow-wrap: anywhere;
}

.goal-card .goal-date {
  display: block;
  color: #52647b;
  font: 12px/1.6 var(--sans);
  margin-top: 5px;
}

.goal-card .goal-numbers {
  margin: 14px 0 10px;
}

.goal-numbers strong {
  font-variant-numeric: tabular-nums;
}

.goal-card .progress-track {
  margin: 0;
  height: 10px;
}

.goal-card footer {
  margin: 12px 0 0;
  gap: 10px;
}

.goal-summary>div:first-child>strong {
  font-size: clamp(30px, 8vw, 46px);
  overflow-wrap: anywhere;
}

.goal-summary>div {
  min-width: 0;
}

.goal-summary h2 {
  font-size: 27px;
}

.overall-progress {
  width: 108px !important;
}

.overall-progress:after {
  width: 78px;
}

.next-contribution article {
  grid-template-columns: 44px minmax(0, 1fr);
}

.next-contribution article button {
  grid-column: 2;
  justify-self: start;
  min-height: 44px;
}

.next-contribution article h3,
.next-contribution article p {
  overflow-wrap: anywhere;
}

.account-card>div,
.profile-row>span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-card p {
  font: 13px/1.6 var(--sans);
  overflow-wrap: anywhere;
}

.profile-row b {
  font-size: 21px;
}

.profile-row small {
  font: 13px/1.5 var(--sans);
  margin-top: 4px;
}

.profile-row {
  grid-template-columns: 44px minmax(0, 1fr) auto 18px;
  gap: 9px;
}

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

.round-icon svg {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#syncNowButton {
  grid-template-columns: 44px minmax(0, 1fr) 18px;
}

#syncNowButton [data-icon]:last-child {
  grid-column: 3;
  grid-row: 1;
}

#lastSyncLabel {
  display: block;
  grid-column: 2;
  white-space: normal;
  font: 12px/1.5 var(--sans);
}

.safe-strip {
  font-size: 18px;
}

.fab {
  isolation: isolate;
  width: 60px;
  height: 60px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  overflow: visible;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.fab>[data-icon] {
  position: relative;
  z-index: 2;
}

.fab>[data-icon] svg {
  width: 32px;
  height: 32px;
}

.fab-progress {
  position: absolute;
  z-index: 3;
  inset: -5px;
  display: block;
  opacity: 0;
  pointer-events: none;
  transform: rotate(-90deg);
}

.fab-progress svg {
  display: block;
  width: 70px;
  height: 70px;
  overflow: visible;
}

.fab-progress circle {
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 182.3;
  stroke-dashoffset: 182.3;
  filter: drop-shadow(0 1px 2px rgba(72, 24, 18, .42));
}

.fab.is-long-pressing .fab-progress {
  opacity: 1;
}

.fab.is-long-pressing .fab-progress circle {
  animation: fab-outline-progress 2s linear forwards;
}

@keyframes fab-outline-progress {
  to {
    stroke-dashoffset: 0;
  }
}

.bottom-nav {
  --nav-index: 0;
  isolation: isolate;
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(calc(100% - 24px), 574px);
  padding: 5px 6px;
  border: 1px solid #dfe6ed;
  border-radius: 34px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(31, 45, 61, .18);
  backdrop-filter: none;
}

.bottom-nav:before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 5px;
  bottom: 5px;
  left: 6px;
  width: calc((100% - 12px) / 4);
  border-radius: 27px;
  background: #e8f3ff;
  transform: translateX(calc(var(--nav-hover-index, var(--nav-index)) * 100%));
  transition: transform .34s cubic-bezier(.22, .75, .28, 1);
  pointer-events: none;
}

body[data-view="inicio"] .bottom-nav {
  --nav-index: 0;
}

body[data-view="analisis"] .bottom-nav {
  --nav-index: 1;
}

body[data-view="metas"] .bottom-nav {
  --nav-index: 2;
}

body[data-view="perfil"] .bottom-nav {
  --nav-index: 3;
}

body .bottom-nav:has(.nav-item:nth-child(1):focus-visible) {
  --nav-hover-index: 0;
}

body .bottom-nav:has(.nav-item:nth-child(2):focus-visible) {
  --nav-hover-index: 1;
}

body .bottom-nav:has(.nav-item:nth-child(3):focus-visible) {
  --nav-hover-index: 2;
}

body .bottom-nav:has(.nav-item:nth-child(4):focus-visible) {
  --nav-hover-index: 3;
}

@media (hover: hover) and (pointer: fine) {
  body .bottom-nav:has(.nav-item:nth-child(1):hover) {
    --nav-hover-index: 0;
  }

  body .bottom-nav:has(.nav-item:nth-child(2):hover) {
    --nav-hover-index: 1;
  }

  body .bottom-nav:has(.nav-item:nth-child(3):hover) {
    --nav-hover-index: 2;
  }

  body .bottom-nav:has(.nav-item:nth-child(4):hover) {
    --nav-hover-index: 3;
  }
}

.nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 55px;
  gap: 0;
  padding: 3px 2px;
  border-radius: 27px;
  transition: color .28s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.nav-item>[data-icon] {
  flex: none;
  height: 22px;
  line-height: 1;
}

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

.nav-item small {
  font-size: 13px;
  line-height: 1;
}

.nav-item.is-active {
  color: #1263ad;
  background: transparent;
}

.nav-item.is-active small {
  border-bottom: 0;
}

.bottom-sheet {
  max-height: 90vh;
  max-height: 90dvh;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-inline: 20px;
  background-color: var(--paper);
  background-image: linear-gradient(rgba(104, 157, 195, .08) 1px, transparent 1px);
  background-size: 24px 24px;
}

.bottom-sheet.is-dragging,
.confirm-sheet.is-dragging {
  transition: none !important;
  overflow: hidden;
  user-select: none;
}

.sheet-header {
  justify-content: flex-start;
  gap: 12px;
}

.sheet-header h2 {
  font-size: clamp(26px, 7vw, 35px);
  line-height: 1.15;
}

.sheet-close {
  display: none !important;
}

.sheet-handle {
  position: relative;
  width: 64px;
  height: 44px;
  background: transparent;
  margin: 0 auto 0;
}

.sheet-handle:after {
  content: '';
  position: absolute;
  width: 44px;
  height: 5px;
  border-radius: 5px;
  background: #bbc4ce;
  top: 8px;
  left: 10px;
}

.field {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.field input,
.field select,
.history-search input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font: 16px/1.4 var(--sans);
  min-height: 48px;
}

.installment-count-row input {
  width: 100%;
  max-width: 100%;
}

.installment-preview {
  display: block;
  margin-top: 6px;
  color: #52647b;
  font: 12px/1.5 var(--sans);
}

.amount-field input {
  font-size: 38px;
}

.entry-tabs button {
  font-size: 19px;
  padding: 8px;
}

.coral-button {
  min-height: 54px;
  font-size: 25px;
}

.coral-button,
.pay-button {
  color: #351912;
}

.toggle-field {
  gap: 12px;
}

.toggle-field input {
  flex-shrink: 0;
}

.form-error {
  line-height: 1.5;
}

.history-sheet {
  background-color: var(--paper);
}

.history-summary {
  font: 14px/1.6 var(--sans);
  color: #44546a;
}

.history-search {
  display: block;
  font: 13px/1.6 var(--sans);
  color: #44546a;
}

.history-search input {
  display: block;
  width: 100%;
  margin: 6px 0 22px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #bdc9d5;
  border-radius: 12px;
}

.history-day {
  margin: 0 0 28px;
}

.history-day>header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0 2px 10px;
}

.history-day h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 400;
  text-transform: capitalize;
}

.history-day>header>span {
  font: 600 13px/1.4 var(--sans);
  white-space: nowrap;
}

.history-day>div {
  background: #fff;
  border: 1px solid #e0e5e9;
  border-radius: 14px;
  padding: 0 12px;
}

.history-day .movement-row {
  grid-template-columns: 36px minmax(0, 1fr) auto;
  column-gap: 8px;
}

.history-day .category-icon {
  width: 36px;
  height: 36px;
}

.history-day .movement-amount {
  grid-column: 3;
  grid-row: auto;
}

.movement-swipe-row {
  position: relative;
  overflow: hidden;
  margin: 4px 0;
  border-radius: 14px;
  border-bottom: 1px solid #e4e7eb;
  touch-action: pan-y;
}

.movement-swipe-row:last-child {
  border-bottom: 0;
}

.movement-swipe-row .movement-row {
  position: relative;
  z-index: 2;
  border-bottom: 0;
  border-radius: 13px;
  background: #fff;
  transition: transform .2s ease;
  will-change: transform;
}

.movement-swipe-row.is-swiping .movement-row {
  transition: none;
  user-select: none;
}

.movement-swipe-row:focus-visible {
  outline: 3px solid #1263ad;
  outline-offset: -3px;
}

.swipe-action {
  position: absolute;
  z-index: 1;
  inset-block: 5px;
  width: calc(50% - 8px);
  display: flex;
  align-items: center;
  padding-inline: 18px;
  border-radius: 14px;
  color: #17374f;
  font: 700 14px/1 var(--sans);
}

.swipe-edit {
  left: 4px;
  justify-content: flex-start;
  background: #ccefe4;
}

.swipe-cancel {
  right: 4px;
  justify-content: flex-end;
  background: #ffd2ca;
  color: #8e261b;
}

.movement-row.is-cancelled {
  opacity: .62;
}

.movement-row.is-cancelled .category-icon,
.movement-row.is-cancelled .movement-main {
  filter: grayscale(1);
}

.movement-row.is-cancelled .movement-main strong,
.movement-row.is-cancelled .movement-main small {
  text-decoration: line-through;
}

.movement-row.is-cancelled .movement-amount {
  color: #52647b;
  font-style: italic;
}

.recurrence-edit-help {
  margin: -8px 0 16px;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: #36506d;
  font: 13px/1.5 var(--sans);
}

.form-grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#expenseDateTimeField,
#pendingScheduleField,
#goalDateField,
#variablePaymentDateField {
  min-width: 0;
  overflow: visible;
}

.datetime-label {
  display: block;
  margin-bottom: 6px;
  font-size: 21px;
}

.datetime-pair {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.native-fields-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.datetime-part {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-width: 0;
  height: 58px;
  padding: 8px 38px 8px 12px;
  overflow: hidden;
  border: 1.5px solid #cbd4df;
  border-radius: 14px;
  background: #fff;
  box-sizing: border-box;
}

.datetime-part:focus-within {
  border-color: #1263ad;
  box-shadow: 0 0 0 3px rgba(18, 99, 173, .18);
}

.datetime-part small {
  position: absolute;
  top: 5px;
  left: 12px;
  color: #68778a;
  font: 11px/1.2 var(--sans);
}

.native-field-caption {
  position: absolute;
  top: 5px;
  left: 12px;
  margin: 0 !important;
  color: #68778a;
  font: 11px/1.2 var(--sans) !important;
}

.datetime-part strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font: 600 17px/1.15 var(--sans);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.datetime-part-icon,
.datetime-clock {
  position: absolute;
  z-index: 1;
  right: 11px;
  bottom: 12px;
  width: 20px;
  height: 20px;
  color: #52647b;
  pointer-events: none;
}

.datetime-part-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.datetime-clock {
  border: 1.8px solid currentColor;
  border-radius: 50%;
  box-sizing: border-box;
}

.datetime-clock:before {
  content: '';
  position: absolute;
  left: 8px;
  top: 3px;
  width: 1.8px;
  height: 6px;
  border-radius: 2px;
  background: currentColor;
}

.datetime-clock:after {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px;
  width: 5px;
  height: 1.8px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(25deg);
  transform-origin: left center;
}

.datetime-select-arrow {
  position: absolute;
  z-index: 1;
  right: 14px;
  bottom: 18px;
  width: 9px;
  height: 9px;
  border-right: 2px solid #52647b;
  border-bottom: 2px solid #52647b;
  transform: rotate(45deg);
  pointer-events: none;
}

.goal-date-part {
  width: 100%;
}

#entryDate,
#entryTime,
#entryDueDate,
#entryReminder,
#goalDate {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  opacity: .001;
  -webkit-appearance: auto;
  appearance: auto;
  cursor: pointer;
}

.amount-field.is-variable>div {
  background: #eef6ff;
  border-style: dashed;
}

.amount-field.is-variable input {
  color: #39536f;
  font: 700 20px/1 var(--sans);
  opacity: 1;
  -webkit-text-fill-color: #39536f;
}

.variable-amount-toggle {
  border-block: 1px solid rgba(104, 157, 195, .18);
}

.automatic-payment-toggle {
  border-bottom: 1px solid rgba(104, 157, 195, .18);
}

.payment-method-field small {
  display: block;
  margin-top: 6px;
  color: #52647b;
  font: 12px/1.45 var(--sans);
}

.variable-payment-sheet>p {
  margin: 0 0 18px;
  color: #52647b;
  font: 14px/1.55 var(--sans);
}

.variable-payment-amount>div {
  min-height: 72px;
}

.variable-payment-amount input {
  font-size: 38px;
}

.automatic-charge-date {
  margin-top: 14px;
}

.variable-payment-sheet .confirm-charge-button,
.pending-card .confirm-charge-button {
  font-size: 14px;
}

.variable-payment-reference {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--yellow-soft);
  color: #5b4a1f;
  font: 13px/1.45 var(--sans);
}

.variable-payment-sheet .coral-button {
  margin-top: 18px;
}

.quick-expense-form {
  display: grid;
  gap: 18px;
}

.quick-expense-form .field>span,
.quick-expense-form .category-field legend {
  font-size: 19px;
}

.quick-expense-form .category-field>div {
  padding: 2px 1px 7px;
}

.quick-expense-form .coral-button {
  margin-top: 0;
}

.quick-expense-form .cancel-button {
  margin-top: -3px;
}

.confirm-dialog {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.confirm-dialog>.confirm-sheet {
  width: min(100%, 610px);
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 0 24px calc(26px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background-color: var(--paper);
  background-image: linear-gradient(rgba(104, 157, 195, .08) 1px, transparent 1px);
  background-size: 24px 24px;
  box-shadow: var(--shadow);
  transform: translateY(105%);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}

.confirm-dialog.is-open>.confirm-sheet {
  transform: translateY(0);
}

.confirm-dialog .sheet-handle {
  display: block;
}

.confirm-dialog h2 {
  font-size: clamp(26px, 7vw, 35px);
}

.history-more {
  margin: 4px auto 18px;
}

.receipt-button {
  display: none;
}

.history-day .receipt-button {
  display: block;
  grid-column: 1 / 3;
  min-height: 44px;
  justify-self: start;
  border: 0;
  background: transparent;
  color: #075faa;
  font: 13px/1.4 var(--sans);
}

.install-help {
  margin: 14px 0;
  padding: 16px;
  font: 14px/1.6 var(--sans);
  background: var(--blue-soft);
  border-radius: 12px;
}

.confirm-verification {
  display: block;
  margin: 16px 0 4px;
  color: #44546a;
  font: 600 14px/1.45 var(--sans);
}

.confirm-verification input {
  display: block;
  width: 100%;
  min-height: 50px;
  margin-top: 7px;
  padding: 0 13px;
  border: 1.5px solid #cbd4df;
  border-radius: 12px;
  background: #fff;
  font: 700 18px/1 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
}

#confirmAccept:disabled {
  cursor: not-allowed;
  opacity: .45;
}

#languageSetting {
  z-index: 1;
  min-width: 104px;
  min-height: 42px;
  padding: 0 28px 0 10px;
  border: 1px solid #d8dee6;
  border-radius: 12px;
  background: #fff;
  font: 600 14px/1 var(--sans);
}

#languageRow .profile-chevron {
  position: relative;
  z-index: 2;
  grid-column: 4;
  display: grid;
  place-items: center;
  color: #536b8b;
  pointer-events: none;
}

#languageRow .profile-chevron svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.category-sheet {
  max-width: 610px;
}

.category-form {
  display: grid;
  gap: 12px;
  margin: 2px 0 20px;
  padding: 14px;
  border: 1px solid #dfe5eb;
  border-radius: 16px;
  background: rgba(255, 255, 255, .72);
}

.category-icon-picker {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.category-icon-picker legend {
  padding: 0;
  font-size: 19px;
}

.category-icon-picker p {
  margin: 2px 0 10px;
  color: #68778a;
  font: 12px/1.4 var(--sans);
}

.category-icon-gallery {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.category-icon-choice {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 13px;
  background: var(--category-gallery-color);
  font: 23px/1 system-ui;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.category-icon-choice.is-selected {
  z-index: 1;
  border-color: #27261f;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--category-gallery-color);
  transform: translateY(-2px);
}

.category-icon-choice:focus-visible {
  outline: 3px solid #087bff;
  outline-offset: 2px;
}

.category-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.category-form-actions .coral-button {
  width: auto;
  min-height: 46px;
  margin: 0;
  padding: 0 18px;
  font: 700 16px/1 var(--sans);
}

.category-order-hint {
  margin: 0 2px 9px;
  color: #68778a;
  font: 12px/1.4 var(--sans);
}

.category-manager-list {
  display: grid;
  gap: 8px;
  padding-bottom: 18px;
}

.category-manager-row {
  display: grid;
  grid-template-columns: 26px 44px minmax(0, 1fr) auto 42px;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: 8px 9px;
  border: 1px solid #dfe5eb;
  border-radius: 15px;
  background: #fff;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.category-manager-row.is-reordering {
  z-index: 2;
  border-color: #72b8f7;
  box-shadow: 0 8px 20px rgba(31, 45, 61, .16);
  opacity: .9;
  transform: scale(1.015);
}

.category-drag-handle {
  display: grid;
  place-items: center;
  width: 26px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #718096;
  font: 24px/1 system-ui;
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.category-drag-handle:active {
  cursor: grabbing;
  color: #1263ad;
}

.category-drag-handle:focus-visible {
  outline: 2px solid #087bff;
  outline-offset: 1px;
}

.category-manager-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font: 20px/1 system-ui;
}

.category-manager-name {
  min-width: 0;
}

.category-manager-row strong,
.category-manager-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-manager-row strong {
  font-size: 20px;
  font-weight: 400;
}

.category-manager-row small {
  margin-top: 2px;
  color: #68778a;
  font: 11px/1.2 var(--sans);
}

.category-edit-button,
.category-delete-button {
  min-height: 38px;
  border: 0;
  border-radius: 11px;
  font: 700 13px/1 var(--sans);
}

.category-edit-button {
  padding: 0 13px;
  background: var(--mint-soft);
  color: #155648;
}

.category-delete-button {
  display: grid;
  place-items: center;
  width: 40px;
  padding: 0;
  background: var(--coral-soft);
  color: #8e261b;
}

.category-delete-button svg {
  width: 19px;
  height: 19px;
}

.payment-method-sheet {
  max-width: 610px;
}

.payment-method-security {
  margin: 0 0 14px;
  padding: 11px 13px;
  border-radius: 13px;
  background: var(--blue-soft);
  color: #38536b;
  font: 13px/1.45 var(--sans);
}

.payment-method-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid #dfe5eb;
  border-radius: 16px;
  background: rgba(255, 255, 255, .72);
}

.payment-method-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.payment-method-form-actions .coral-button {
  width: auto;
  min-height: 46px;
  margin: 0;
  padding: 0 18px;
  font: 700 16px/1 var(--sans);
}

.payment-method-manager-list {
  display: grid;
  gap: 8px;
  padding-bottom: 18px;
}

.payment-method-manager-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 42px;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: 8px 9px;
  border: 1px solid #dfe5eb;
  border-radius: 15px;
  background: #fff;
}

.payment-method-manager-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--mint-soft);
  color: #24495a;
  font: 700 19px/1 system-ui;
}

.payment-method-manager-row>div {
  min-width: 0;
}

.payment-method-manager-row strong,
.payment-method-manager-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-method-manager-row strong {
  font-size: 20px;
  font-weight: 400;
}

.payment-method-manager-row small {
  margin-top: 2px;
  color: #68778a;
  font: 11px/1.2 var(--sans);
}

.payment-method-empty {
  padding-block: 18px;
}

.about-sheet {
  text-align: center;
}

.about-sheet .sheet-header {
  justify-content: center;
}

.about-app-mark {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  margin: 4px auto 8px;
  border-radius: 22px;
  background: var(--blue-soft);
  color: #1263ad;
}

.about-app-mark svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.about-sheet h3 {
  margin: 0;
  font-size: 30px;
  font-weight: 400;
}

.about-sheet>p {
  max-width: 440px;
  margin: 8px auto 18px;
  color: #52647b;
  font: 14px/1.55 var(--sans);
}

.about-details {
  display: grid;
  gap: 1px;
  margin: 0 0 18px;
  overflow: hidden;
  border: 1px solid #dfe5eb;
  border-radius: 14px;
  background: #dfe5eb;
  text-align: left;
}

.about-details>div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  background: #fff;
}

.about-details dt,
.about-details dd {
  margin: 0;
  font: 14px/1.3 var(--sans);
}

.about-details dd {
  color: #52647b;
}

.about-sheet .update-button {
  min-height: 52px;
  margin-top: 0;
  font-size: 20px;
}

.about-sheet .update-status {
  min-height: 22px;
  margin-bottom: 0;
}

.toast-region {
  bottom: calc(130px + env(safe-area-inset-bottom));
}

.toast {
  font: 14px/1.5 var(--sans);
}

@media (min-width: 470px) {
  .donut-layout {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 18px;
  }

  .donut {
    width: 175px;
  }
}

@media (max-width: 360px) {
  .main-content {
    padding-inline: 10px;
  }

  .month-navigation {
    gap: 5px;
  }

  .month-navigation .month-chip {
    font-size: 20px;
    padding-inline: 8px;
  }

  .section-heading {
    flex-wrap: wrap;
  }

  .profile-row {
    column-gap: 6px;
  }

  .goal-summary {
    gap: 8px;
  }

  .bottom-sheet {
    padding-inline: 14px;
  }

  .form-grid {
    gap: 12px 8px;
  }

  .daily-block .round-icon {
    display: none;
  }

  .category-manager-row {
    grid-template-columns: 24px 40px minmax(0, 1fr) 38px;
    gap: 6px;
  }

  .category-edit-button {
    grid-column: 3;
    justify-self: start;
  }

  .category-delete-button {
    grid-column: 4;
    grid-row: 1 / 3;
  }

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

  .payment-method-form-actions {
    grid-column: 1;
  }

  .payment-method-manager-row {
    grid-template-columns: 40px minmax(0, 1fr) 38px;
    gap: 6px;
  }

  .payment-method-manager-row .category-edit-button {
    grid-column: 2;
    justify-self: start;
  }

  .payment-method-manager-row .category-delete-button {
    grid-column: 3;
    grid-row: 1 / 3;
  }
}

@media (display-mode: standalone),
(display-mode: fullscreen) {
  .topbar {
    top: -20px;
  }

  .main-content {
    padding-top: calc(60px + env(safe-area-inset-top));
  }

  .bottom-nav {
    bottom: calc(env(safe-area-inset-bottom) - 5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
