@charset "UTF-8";
:root {
  --ink: #1b2846;
  --muted: #69758b;
  --blue: #334eb8;
  --line: #e3e7f0;
  --bg: #f6f7fb;
  --white: #fff;
  --green: #217661;
  --red: #b33d4e;
  --radius: 22px;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Arial,
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #9babf2;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 36px;
  line-height: 1.2;
  letter-spacing: -1.3px;
  margin-bottom: 10px;
  font-weight: 650;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.4px;
  font-weight: 650;
}
h3 {
  font-size: 16px;
  font-weight: 650;
}
p {
  line-height: 1.6;
}
.muted {
  color: var(--muted);
}
.hint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 1.8px;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 12px;
}
.app-shell {
  max-width: 1176px;
  margin: auto;
  padding: 0 32px;
}
.topbar {
  height: 98px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 31px;
  font-weight: 750;
  letter-spacing: -1.5px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--blue);
  color: white;
  font-size: 28px;
  line-height: 1;
  padding-bottom: 6px;
  font-weight: 600;
}
.brand-dot {
  color: var(--blue);
  margin-left: -9px;
}
.top-right {
  display: flex;
  gap: 22px;
  align-items: center;
}
.sync-state {
  color: var(--muted);
  font-size: 13px;
}
.sync-state::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #4d9983;
  border-radius: 50%;
  margin-right: 7px;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #dce2f5;
  background: #e9edf9;
  color: #3d5088;
  font-weight: 650;
}
.navigation {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 36px;
}
.navigation button {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 21px 4px 19px;
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 14px;
  font-weight: 550;
}
.navigation button.active {
  border-color: var(--blue);
  color: var(--blue);
}
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 0 0 26px;
}
.page-heading .muted {
  margin-bottom: 0;
  font-size: 15px;
}
.heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.month-control {
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}
.month-control input {
  width: 160px;
  padding: 11px 4px;
  border: 0;
  background: none;
  font-size: 14px;
  margin: 0;
  min-height: 44px;
}
.month-control button {
  border: 0;
  background: none;
  padding: 10px;
  color: var(--muted);
  min-height: 44px;
}
.primary,
.secondary,
.text-button,
.danger {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 17px;
  border: 1px solid transparent;
}
.primary {
  background: var(--blue);
  color: white;
}
.primary:hover {
  background: #29409b;
}
.secondary {
  background: white;
  border-color: var(--line);
  color: var(--ink);
}
.secondary:hover {
  background: #f3f5fa;
}
.text-button {
  color: var(--blue);
  background: none;
  padding: 8px 0;
}
.danger {
  color: var(--red);
  background: #fff1f3;
  border-color: #f1cbd1;
}
.full {
  width: 100%;
  justify-content: space-between;
  margin-top: 10px;
}
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 22px;
}
.balance-card {
  border-radius: var(--radius);
  padding: 30px 32px;
  background: #2745a5;
  color: white;
  display: flex;
  flex-direction: column;
  min-height: 294px;
}
.balance-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #d7e0ff;
  font-size: 14px;
}
.balance-top > .month-pill {
  border: 1px solid #ffffff35;
  border-radius: 30px;
  padding: 5px 9px;
  font-size: 12px;
}
.balance-card h2 {
  font-size: 56px;
  letter-spacing: -2.5px;
  line-height: 1.2;
  font-weight: 550;
  margin: 17px 0 10px;
  overflow-wrap: anywhere;
}
.balance-card h2 small {
  font-size: 29px;
  opacity: 0.55;
  letter-spacing: -0.5px;
}
.balance-caption {
  color: #cfdbff;
  font-size: 14px;
  margin: 0 0 23px;
}
.balance-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid #ffffff25;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  font-size: 13px;
  color: #d9e2ff;
}
.balance-footer strong {
  display: block;
  font-size: 18px;
  color: white;
  margin-top: 4px;
  font-weight: 550;
}
.balance-footer .divider {
  width: 1px;
  background: #ffffff25;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 25px;
  min-width: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.panel-head h2 {
  margin: 0;
}
.panel-head .text-button {
  min-height: 30px;
  padding: 0;
}
.budget-panel {
  display: flex;
  flex-direction: column;
}
.budget-number {
  font-size: 31px;
  letter-spacing: -1px;
  margin: 3px 0 5px;
}
.budget-number span {
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0;
}
.meter {
  height: 8px;
  background: #edf0f7;
  border-radius: 20px;
  overflow: hidden;
  margin: 17px 0;
}
.meter i {
  display: block;
  background: #6880cf;
  height: 100%;
  border-radius: 20px;
}
.meter-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}
.daily-note {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #edf6f2;
  border-radius: 12px;
  padding: 14px;
  margin-top: auto;
  color: #2c6a59;
  font-size: 13px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 22px 0;
}
.stat {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 22px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.stat-icon,
.entry-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #edf0fb;
  color: #6475ae;
  flex-shrink: 0;
}
.stat-icon.green,
.entry-icon.green {
  background: #e8f4ef;
  color: #31826b;
}
.stat-icon.orange,
.entry-icon.orange {
  background: #fff1e6;
  color: #ae794b;
}
.stat p {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 6px;
}
.stat strong {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.5px;
}
.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 22px;
}
.entry {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid #edf0f5;
  min-width: 0;
}
.entry:first-child {
  border-top: 0;
  padding-top: 0;
}
.entry:last-child {
  padding-bottom: 0;
}
.entry-info {
  flex: 1;
  min-width: 0;
}
.entry-info strong {
  display: block;
  font-weight: 550;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.entry-info p {
  font-size: 13px;
  color: var(--muted);
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}
.entry-right {
  text-align: right;
  flex-shrink: 0;
}
.entry-right strong {
  font-size: 15px;
  font-weight: 600;
}
.entry-right p {
  font-size: 12px;
  color: var(--muted);
  margin: 5px 0 0;
}
.entry-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 7px;
}
.entry-actions button,
.entry-actions a {
  font-size: 12px;
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 6px 3px;
  min-height: 32px;
}
.amount-income {
  color: var(--green);
}
.badge {
  display: inline-block;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #f1f3f9;
  color: #66718b;
}
.badge.paid {
  background: #e9f5ee;
  color: #2c785c;
}
.badge.due {
  background: #fff2e5;
  color: #956331;
}
.badge.overdue {
  background: #fff0f2;
  color: #b13c4e;
}
.bill-row {
  align-items: flex-start;
}
.bill-row .entry-icon {
  margin-top: 4px;
}
.bill-row .secondary {
  font-size: 12px;
  padding: 7px 10px;
  min-height: 34px;
}
.empty {
  padding: 28px 8px;
  text-align: center;
}
.empty > svg {
  width: 35px;
  height: 35px;
  color: #8998c3;
  margin: 0 auto 14px;
}
.empty h3 {
  margin-bottom: 8px;
}
.empty p {
  color: var(--muted);
  font-size: 14px;
  max-width: 320px;
  margin: 0 auto 16px;
}
.empty .text-button {
  min-height: 36px;
}
.empty-start {
  border: 1px dashed #d9dfef;
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: #fafbff;
}
.empty-start h3 {
  margin: 0 0 6px;
}
.empty-start p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.notice {
  background: #eef2ff;
  border: 1px solid #dce4fe;
  border-radius: 13px;
  padding: 16px 20px;
  margin: 18px 0;
  font-size: 14px;
  line-height: 1.6;
}
.notice.error {
  background: #fff1f3;
  border-color: #f2d8de;
  color: #9d3245;
}
.notice.warning {
  background: #fff6e9;
  border-color: #f5e1c4;
  color: #8c6030;
}
.notice p:last-child {
  margin-bottom: 0;
}
.recovery code {
  display: block;
  font-size: 15px;
  overflow-wrap: anywhere;
  margin: 14px 0;
}
.recovery p {
  margin: 5px 0;
}
.page-footer {
  text-align: center;
  color: #949cad;
  font-size: 12px;
  margin: 34px 0;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.category-row {
  margin-top: 20px;
}
.category-row > div {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  gap: 10px;
}
.category-row .meter {
  margin: 10px 0;
}
.salary-card {
  background: #eaf4ef;
  border: 1px solid #dcebe3;
  padding: 26px;
  border-radius: var(--radius);
  margin-bottom: 22px;
}
.salary-card h2 {
  font-size: 28px;
  margin: 12px 0;
}
.salary-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #437360;
  font-size: 14px;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.toolbar input {
  margin: 0;
  max-width: 300px;
}
.toolbar .secondary {
  margin-left: auto;
}
.icon-button {
  width: 40px;
  height: 40px;
  border: 0;
  background: #f3f5fa;
  border-radius: 50%;
  font-size: 24px;
  color: var(--muted);
  display: grid;
  place-items: center;
}
.empty-total {
  font-size: 30px;
  color: var(--muted);
}
dialog {
  border: 0;
  border-radius: 24px;
  padding: 26px;
  max-width: 520px;
  width: calc(100% - 32px);
  max-height: 90dvh;
  overflow: auto;
  box-shadow: 0 24px 100px #17264b30;
  color: var(--ink);
}
dialog::backdrop {
  background: #14223c66;
  backdrop-filter: blur(3px);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.modal-head h2 {
  font-size: 24px;
  margin: 0;
}
.modal-head .icon-button {
  flex-shrink: 0;
}
form label {
  display: block;
  font-size: 14px;
  font-weight: 550;
  margin-top: 17px;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #dce1ee;
  border-radius: 10px;
  background: white;
  color: var(--ink);
  padding: 12px;
  margin-top: 7px;
  min-height: 46px;
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #7b91d6;
  box-shadow: 0 0 0 3px #eaf0ff;
}
textarea {
  resize: vertical;
  min-height: 82px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid label {
  min-width: 0;
}
.amount-input {
  font-size: 33px;
  font-weight: 550;
  letter-spacing: -1px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.form-actions .danger {
  margin-right: auto;
}
.form-error {
  color: var(--red);
  font-size: 14px;
  margin: 14px 0 0;
}
.form-tabs {
  display: flex;
  background: #f1f3fa;
  padding: 4px;
  border-radius: 11px;
  gap: 4px;
}
.form-tabs button {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
}
.form-tabs button.active {
  color: var(--blue);
  background: white;
  box-shadow: 0 2px 6px #14223c09;
}
.account-details {
  font-size: 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.settings-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 25px;
}
.check-label {
  display: flex;
  align-items: flex-start;
  gap: 10px !important;
  line-height: 1.5;
}
.check-label input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}
.receipt-link {
  color: var(--blue);
}
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 36px);
  width: max-content;
  background: #1d2b48;
  color: white;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 14px;
  box-shadow: 0 8px 30px #16264122;
  z-index: 99;
}
.auth-body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 36px;
}
.auth-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  width: min(1050px, 100%);
  min-height: 670px;
  overflow: hidden;
  border-radius: 28px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 20px 80px #1c2d5b06;
}
.auth-story {
  padding: 40px;
  background: #2745a5;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
}
.auth-story .brand-mark {
  background: #fff;
  color: #2745a5;
}
.auth-story .brand-dot {
  color: #acbdf3;
}
.auth-story .eyebrow {
  color: #b6c6fa;
  font-size: 11px;
}
.auth-story h1 {
  font-size: 45px;
  letter-spacing: -1.6px;
  line-height: 1.14;
}
.auth-story p {
  color: #c5d3fa;
  font-size: 14px;
}
.auth-foot {
  margin: 0;
  font-size: 12px !important;
}
.auth-form {
  padding: 70px 48px;
  align-self: center;
}
.auth-form h2 {
  font-size: 29px;
  line-height: 1.2;
  letter-spacing: -1px;
  margin: 16px 0;
}
.auth-form > .muted {
  font-size: 14px;
  margin-bottom: 26px;
}
.auth-form button.full {
  margin-top: 26px;
}
.auth-links {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 22px;
  color: var(--blue);
  font-size: 13px;
}
.mini-ledger {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 13px 20px;
  margin-top: 34px;
  padding: 22px;
  border: 1px solid #ffffff26;
  border-radius: 16px;
  font-size: 14px;
}
.mini-ledger b {
  font-weight: 400;
  opacity: 0.6;
}
.mini-highlight {
  color: #bdebd7;
}
.setup-card {
  width: min(490px, 100%);
  background: white;
  padding: 35px;
  border: 1px solid var(--line);
  border-radius: 24px;
}
.setup-card h1 {
  font-size: 29px;
  margin-top: 30px;
}
.setup-card > .muted {
  font-size: 14px;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1500px) {
  .app-shell {
    padding-top: 16px;
  }
}
@media (max-width: 900px) {
  .overview-grid,
  .lower-grid {
    grid-template-columns: 1fr 1fr;
  }
  .heading-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .page-heading {
    align-items: flex-start;
  }
  h1 {
    font-size: 30px;
  }
  .balance-card {
    padding: 26px;
  }
  .balance-card h2 {
    font-size: 45px;
  }
  .stat {
    padding: 17px;
    gap: 10px;
  }
  .stat strong {
    font-size: 20px;
  }
  .stat-icon {
    width: 34px;
    height: 34px;
  }
  .auth-form {
    padding: 45px 32px;
  }
  .auth-story {
    padding: 32px;
  }
  .auth-story h1 {
    font-size: 38px;
  }
  .split {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .app-shell {
    padding: 0 20px 92px;
  }
  .topbar {
    height: 78px;
    border: 0;
  }
  .brand {
    font-size: 27px;
  }
  .brand-mark {
    width: 31px;
    height: 31px;
    font-size: 25px;
    border-radius: 9px;
  }
  .top-right {
    gap: 12px;
  }
  .sync-state {
    font-size: 11px;
  }
  .navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fffffff5;
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    margin: 0;
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    gap: 0;
    z-index: 30;
    justify-content: space-around;
  }
  .navigation button {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 11px;
    min-width: 67px;
    max-width: 26%;
    border: 0;
    padding: 9px 7px;
    border-radius: 11px;
    text-align: center;
  }
  .navigation .active {
    background: #edf1fd;
  }
  .navigation svg {
    width: 21px;
    height: 21px;
  }
  .page-heading {
    margin: 22px 0;
    display: block;
  }
  .eyebrow {
    font-size: 10px;
    letter-spacing: 1.4px;
    margin-bottom: 9px;
  }
  h1 {
    font-size: 29px;
    letter-spacing: -1px;
  }
  .page-heading .muted {
    font-size: 13px;
  }
  .heading-actions {
    margin-top: 22px;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .month-control {
    flex: 1;
    max-width: 210px;
  }
  .month-control input {
    font-size: 13px;
    min-width: 0;
    flex: 1;
    width: 120px;
  }
  .heading-actions > .primary {
    font-size: 13px;
    padding: 12px 14px;
  }
  .overview-grid,
  .lower-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .balance-card {
    padding: 25px;
    min-height: 277px;
  }
  .balance-card h2 {
    font-size: 48px;
    margin-top: 20px;
  }
  .balance-card h2 small {
    font-size: 28px;
  }
  .balance-caption {
    font-size: 13px;
  }
  .balance-footer {
    font-size: 12px;
  }
  .balance-footer strong {
    font-size: 16px;
  }
  .budget-panel {
    gap: 0;
  }
  .budget-panel .daily-note {
    margin-top: 20px;
  }
  .panel {
    padding: 22px;
    border-radius: 19px;
  }
  .panel-head h2 {
    font-size: 18px;
  }
  .panel-head .text-button {
    font-size: 12px;
  }
  .stats {
    gap: 8px;
    margin: 18px 0;
  }
  .stat {
    padding: 15px 10px;
    display: block;
    border-radius: 13px;
  }
  .stat-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    margin-bottom: 12px;
  }
  .stat-icon svg {
    width: 17px;
    height: 17px;
  }
  .stat p {
    font-size: 11px;
    line-height: 1.4;
    min-height: 29px;
    margin-bottom: 3px;
  }
  .stat strong {
    font-size: 17px;
    overflow-wrap: anywhere;
    letter-spacing: -0.6px;
  }
  .entry {
    gap: 10px;
  }
  .entry-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }
  .entry-info strong {
    font-size: 13px;
  }
  .entry-info p {
    font-size: 12px;
  }
  .entry-right strong {
    font-size: 14px;
  }
  .entry-right {
    max-width: 42%;
  }
  .entry-actions {
    gap: 5px;
    flex-wrap: wrap;
  }
  .entry-actions button,
  .entry-actions a {
    font-size: 11px;
  }
  .empty-start {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .toolbar {
    gap: 8px;
  }
  .toolbar input {
    max-width: none;
    flex: 1;
    min-width: 150px;
  }
  .toolbar .secondary {
    font-size: 12px;
  }
  .page-footer {
    font-size: 11px;
    margin: 28px 0 14px;
  }
  .notice {
    padding: 14px;
    font-size: 13px;
  }
  dialog {
    padding: 22px;
    max-height: 90dvh;
    border-radius: 20px;
  }
  .modal-head h2 {
    font-size: 23px;
  }
  .form-grid {
    gap: 12px;
  }
  form label {
    font-size: 13px;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
  .form-actions {
    flex-wrap: wrap;
  }
  .form-actions .danger {
    font-size: 12px;
  }
  .form-actions .primary {
    flex: 1;
  }
  #toast {
    bottom: 96px;
    width: calc(100% - 40px);
    text-align: center;
  }
  .auth-body {
    padding: 0;
    display: block;
    background: white;
  }
  .auth-layout {
    display: block;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .auth-story {
    padding: 25px 28px 28px;
    gap: 25px;
  }
  .auth-story h1 {
    font-size: 33px;
    line-height: 1.12;
    margin-bottom: 12px;
  }
  .auth-story .eyebrow,
  .auth-foot,
  .mini-ledger {
    display: none;
  }
  .auth-story p {
    font-size: 13px;
    margin-bottom: 0;
  }
  .auth-story p br {
    display: none;
  }
  .auth-form {
    padding: 35px 28px 45px;
  }
  .auth-form h2 {
    font-size: 26px;
  }
  .setup-card {
    width: 100%;
    border: 0;
    border-radius: 0;
    padding: 30px 25px;
  }
  .salary-card {
    padding: 22px;
  }
  .salary-card h2 {
    font-size: 26px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button,
  a {
    transition:
      background 0.16s,
      color 0.16s;
  }
  dialog[open] {
    animation: appear 0.18s ease-out;
  }
  @keyframes appear {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Contextual explanations stay with their headings and open the shared dialog. */
.title-with-help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.help-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
}
.help-button::before {
  content: '';
  position: absolute;
  width: 23px;
  height: 23px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.65;
  pointer-events: none;
}
.help-button:hover {
  background: #697db51a;
}
.balance-card .help-button:hover {
  background: #ffffff18;
}
.commitments-heading,
.salary-top {
  flex-wrap: wrap;
  gap: 8px;
}
.salary-top .title-with-help > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* Monthly category distributions. Text legends expose the full chart data. */
.distribution-layout {
  align-items: start;
}
.distribution-panel {
  min-width: 0;
}
.distribution {
  padding-top: 2px;
}
.donut-chart {
  position: relative;
  display: grid;
  place-items: center;
  width: 244px;
  max-width: 100%;
  aspect-ratio: 1;
  margin: 12px auto 26px;
  border-radius: 50%;
  background: var(--donut-fill, #edf0f7);
}
.donut-chart::before {
  content: '';
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: white;
}
.donut-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
  max-width: calc(100% - 64px);
}
.donut-center > span {
  font-size: 13px;
  color: var(--muted);
}
.donut-center strong {
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.6px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.donut-center small {
  font-size: 12px;
  color: var(--muted);
}
.chart-legend {
  list-style: none;
  padding: 0;
  margin: 0;
}
.chart-legend li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.legend-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
}
.legend-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.legend-values {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 55%;
}
.legend-values strong {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.legend-values small {
  font-size: 12px;
  color: var(--muted);
}
.chart-empty {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}
.chart-footnote {
  margin: 16px 0 0;
}
@media (max-width: 640px) {
  .donut-chart {
    width: 224px;
    margin-top: 10px;
  }
  .donut-chart::before {
    inset: 20px;
  }
  .donut-center strong {
    font-size: 22px;
  }
  .distribution-panel .panel-head {
    flex-wrap: wrap;
  }
}

/* HeyPocket brand: approved pocket-P symbol and mint greeting dot. */
.brand {
  gap: 10px;
  letter-spacing: -1.15px;
}
.brand-logo {
  display: block;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
}
.brand-name {
  font-weight: 750;
  line-height: 1.2;
}
.auth-story .brand {
  color: #fff;
}
@media (max-width: 640px) {
  .brand {
    font-size: 25px;
    gap: 8px;
  }
  .brand-logo {
    width: 34px;
    height: 34px;
  }
  .top-right {
    gap: 10px;
  }
}
@media (max-width: 380px) {
  .topbar .sync-state {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .topbar .avatar {
    width: 36px;
    height: 36px;
  }
}

.page-footer .copyright {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: #818b9f;
  text-align: center;
}
.tool-grid {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}
.trend-panel {
  margin-top: 24px;
}
.trend-columns {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}
.trend-month {
  text-align: center;
  min-width: 0;
}
.trend-month strong,
.trend-month small {
  display: block;
  font-size: 12px;
  overflow-wrap: anywhere;
  margin-top: 6px;
}
.trend-bars {
  height: 120px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  border-bottom: 1px solid #e1e6f1;
}
.trend-bars i {
  width: 24%;
  background: #4562c5;
  border-radius: 4px 4px 0 0;
}
.comparison {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #edf0f7;
}
.quick-entry {
  display: none;
}
@media (max-width: 680px) {
  .quick-entry {
    display: flex;
    position: fixed;
    right: 20px;
    bottom: 92px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    padding: 16px;
    box-shadow: 0 4px 18px #223c7040;
    z-index: 5;
  }
  .trend-columns {
    gap: 5px;
  }
  .trend-month strong,
  .trend-month small {
    font-size: 10px;
  }
  .comparison {
    font-size: 13px;
  }
}
/* Right-side menu keeps the ledger visible behind the backdrop. */
.menu-trigger {
  gap: 8px;
  padding: 9px 13px;
}
.menu-open {
  overflow: hidden;
}
dialog.side-menu {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: 66.667vw;
  max-width: 420px;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 24px 0 0 24px;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  background: var(--white);
  color: var(--ink);
  overflow-y: auto;
}
dialog.side-menu[open] {
  display: flex;
  flex-direction: column;
}
.side-menu::backdrop {
  background: #101b3659;
  backdrop-filter: blur(2px);
}
.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}
.menu-header h2 {
  margin: 0;
  font-size: 24px;
}
.menu-content {
  display: grid;
  gap: 4px;
}
.menu-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  min-height: 60px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 12px 2px;
  font-size: 16px;
}
.menu-row:hover {
  background: var(--bg);
}
.theme-switch {
  display: block;
  flex: 0 0 42px;
  width: 42px;
  height: 25px;
  border-radius: 20px;
  background: #b6bfce;
  padding: 3px;
}
.theme-switch i {
  display: block;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px #0003;
}
.menu-row[aria-checked='true'] .theme-switch {
  background: var(--blue);
}
.menu-row[aria-checked='true'] .theme-switch i {
  transform: translateX(17px);
}
.menu-bottom {
  margin-top: auto;
  padding-top: 32px;
}
.menu-bottom .sync-state {
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.menu-copyright {
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
  margin: 18px 0 0;
}
@media (prefers-reduced-motion: no-preference) {
  dialog.side-menu[open] {
    animation: menu-in 0.2s ease-out;
  }
  .theme-switch i {
    transition: transform 0.16s;
  }
  @keyframes menu-in {
    from {
      transform: translateX(100%);
      opacity: 0.5;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }
}
/* Dark palette covers the ledger, forms, charts and both dialogs. */
:root[data-theme='dark'] {
  color-scheme: dark;
  --ink: #e6eaf5;
  --muted: #a4b0c8;
  --blue: #9aacff;
  --line: #33415b;
  --bg: #101827;
  --white: #1b263b;
  --green: #7dd9b5;
  --red: #ff9bac;
}
[data-theme='dark'] body {
  background: var(--bg);
}
[data-theme='dark'] .panel,
[data-theme='dark'] .stat,
[data-theme='dark'] .secondary,
[data-theme='dark'] .month-control,
[data-theme='dark'] dialog,
[data-theme='dark'] input,
[data-theme='dark'] select,
[data-theme='dark'] textarea,
[data-theme='dark'] .donut-chart::before {
  background: var(--white);
  color: var(--ink);
  border-color: var(--line);
}
[data-theme='dark'] .primary {
  background: #4a63ca;
  color: #fff;
}
[data-theme='dark'] .primary:hover {
  background: #3e55b3;
}
[data-theme='dark'] .secondary:hover,
[data-theme='dark'] .icon-button,
[data-theme='dark'] .form-tabs,
[data-theme='dark'] .meter {
  background: #2a3750;
}
[data-theme='dark'] .form-tabs button.active {
  background: #40517a;
  color: #fff;
}
[data-theme='dark'] .navigation {
  background: #101827f5;
}
[data-theme='dark'] .navigation .active {
  background: #263454;
}
[data-theme='dark'] .entry,
[data-theme='dark'] .comparison,
[data-theme='dark'] .trend-bars {
  border-color: var(--line);
}
[data-theme='dark'] .empty-start {
  background: #182339;
  border-color: #425373;
}
[data-theme='dark'] .salary-card,
[data-theme='dark'] .daily-note {
  background: #19382f;
  border-color: #355548;
  color: #b0e2ca;
}
[data-theme='dark'] .salary-top {
  color: #b0e2ca;
}
[data-theme='dark'] .stat-icon,
[data-theme='dark'] .entry-icon,
[data-theme='dark'] .badge {
  background: #2b395a;
  color: #c0ccf4;
}
[data-theme='dark'] .stat-icon.green,
[data-theme='dark'] .entry-icon.green,
[data-theme='dark'] .badge.paid {
  background: #224437;
  color: #9fe2c1;
}
[data-theme='dark'] .stat-icon.orange,
[data-theme='dark'] .entry-icon.orange,
[data-theme='dark'] .badge.due {
  background: #493823;
  color: #f2c48c;
}
[data-theme='dark'] .notice {
  background: #243453;
  border-color: #42577d;
}
[data-theme='dark'] .notice.warning {
  background: #403321;
  border-color: #655037;
  color: #f1cd99;
}
[data-theme='dark'] .notice.error,
[data-theme='dark'] .danger,
[data-theme='dark'] .badge.overdue {
  background: #492b36;
  border-color: #754554;
  color: #ffb4c1;
}
[data-theme='dark'] input:focus,
[data-theme='dark'] select:focus,
[data-theme='dark'] textarea:focus {
  box-shadow: 0 0 0 3px #34456c;
}
[data-theme='dark'] .page-footer,
[data-theme='dark'] .page-footer .copyright {
  color: var(--muted);
}

/* Compact equal-width mobile navigation; retain the full desktop label. */
.nav-label-short {
  display: none;
}
@media (max-width: 640px) {
  .navigation {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 5px max(8px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }
  .navigation button {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 48px;
    min-height: 48px;
    padding: 5px 2px;
    gap: 3px;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    font-size: 11px;
    line-height: 14px;
  }
  .navigation svg {
    width: 18px;
    height: 18px;
  }
  .navigation button span {
    white-space: nowrap;
  }
  .navigation .nav-label-full {
    display: none;
  }
  .navigation .nav-label-short {
    display: block;
  }
  .app-shell {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }
  .quick-entry {
    bottom: calc(74px + env(safe-area-inset-bottom));
  }
  #toast {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }
}

/* Keep bill reminder controls together at every screen width. */
.toolbar.bill-alert-tools {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.toolbar.bill-alert-tools .secondary {
  margin: 0;
  flex: 0 1 auto;
}
.bill-schedule-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.bill-schedule-grid input {
  min-width: 0;
  width: 100%;
}
form[data-form='bill'] input[type='month'] {
  padding-left: 8px;
  padding-right: 8px;
  font-size: 14px;
}

.money-display .money-value {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
.money-display .money-unit {
  white-space: nowrap;
}
.stat .money-display {
  overflow-wrap: normal;
}
@media (max-width: 640px) {
  .stats {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  .stat .money-unit {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 3px;
  }
  .stat .money-value {
    font-size: 17px;
  }
  .balance-card h2.money-display {
    font-size: clamp(24px, 7vw, 44px);
    letter-spacing: -1px;
  }
  .balance-card h2 .money-unit {
    display: block;
    font-size: 18px;
    letter-spacing: 0;
    margin-bottom: 5px;
  }
}

/* Visible action surfaces in both themes. */
:root {
  --action-bg: #edf1ff;
  --action-border: #8a9dd9;
  --action-ink: #27439c;
  --action-hover: #dce5ff;
  --paid-bg: #d9f2e6;
  --paid-border: #519f7f;
  --paid-ink: #15583f;
  --undo-bg: #fff0d4;
  --undo-border: #bb873a;
  --undo-ink: #774600;
}
:root[data-theme='dark'] {
  --action-bg: #293d68;
  --action-border: #718bd0;
  --action-ink: #e1e9ff;
  --action-hover: #354e80;
  --paid-bg: #204e40;
  --paid-border: #55ae89;
  --paid-ink: #c1f4dc;
  --undo-bg: #594324;
  --undo-border: #bd9656;
  --undo-ink: #ffe2a6;
}
.entry-actions button,
.entry-actions a,
.text-button {
  background: var(--action-bg);
  border: 1px solid var(--action-border);
  color: var(--action-ink);
  border-radius: 9px;
  padding: 9px 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  text-align: center;
  line-height: 1.35;
  text-decoration: none;
}
.secondary {
  border-color: var(--action-border);
}
[data-theme='dark'] .secondary {
  background: var(--action-bg);
  border-color: var(--action-border);
  color: var(--action-ink);
}
.panel-head .text-button {
  min-height: 44px;
  padding: 9px 12px;
  flex-shrink: 0;
}
.entry-actions [data-action='pay-bill'] {
  background: var(--paid-bg);
  border-color: var(--paid-border);
  color: var(--paid-ink);
}
.entry-actions [data-action='unpay-bill'] {
  background: var(--undo-bg);
  border-color: var(--undo-border);
  color: var(--undo-ink);
}
.entry-actions [data-action='purge-item'] {
  background: #fff1f3;
  border-color: #ce7a89;
  color: #932638;
}
[data-theme='dark'] .entry-actions [data-action='purge-item'] {
  background: #582f3b;
  border-color: #c47b8f;
  color: #ffd8e1;
}
.entry-actions button:not(:disabled):hover,
.entry-actions a:hover,
.text-button:not(:disabled):hover {
  box-shadow: 0 0 0 2px var(--action-border);
  filter: brightness(0.96);
}
.entry-actions button:focus-visible,
.entry-actions a:focus-visible,
.text-button:focus-visible {
  outline: 3px solid var(--action-border);
  outline-offset: 3px;
}
.entry-actions button:disabled,
.text-button:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}
@media (max-width: 640px) {
  .entry-actions button,
  .entry-actions a {
    padding: 8px 10px;
    font-size: 12px;
  }
  .panel-head {
    flex-wrap: wrap;
  }
  .panel-head .text-button {
    font-size: 12px;
  }
}
.bill-row .entry-actions .secondary {
  min-height: 44px;
  padding: 9px 12px;
}

.analytics-preference {
  font-size: 12px;
  margin-top: 10px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  padding: 9px 14px;
  border-radius: 9px;
  min-height: 40px;
}
.analytics-choice {
  position: fixed;
  bottom: 85px;
  left: 16px;
  right: 16px;
  max-width: 520px;
  margin: auto;
  z-index: 30;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 8px 40px #0003;
}
.analytics-choice p {
  font-size: 13px;
  margin: 8px 0 14px;
}
.analytics-choice > div {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.analytics-choice button {
  padding: 10px 14px;
  min-height: 44px;
  border: 1px solid var(--action-border);
  background: var(--action-bg);
  color: var(--action-ink);
  border-radius: 9px;
}

.pro-section {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 24px;
}
.pro-budget {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 12px 0;
}
.pro-budget .hint {
  margin: 8px 0 0;
}
.pro-summary {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}
.pro-summary p {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.pro-summary strong {
  white-space: nowrap;
}

.trend-locked {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 16px;
  min-height: 280px;
}
.trend-preview {
  filter: blur(7px);
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
  padding: 20px 8px;
}
.trend-unlock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background: color-mix(in srgb, var(--white) 65%, transparent);
}
.trend-unlock strong {
  font-size: 20px;
}
.trend-unlock p {
  max-width: 340px;
  margin: 10px 0 18px;
  color: var(--muted);
}
/* Ledger accents preserve fixed income, warning and payment status colors. */
:root[data-ledger-color] {
  --accent: #334bbe;
  --accent-light: #a9b8ff;
  --accent-soft: #edf0fc;
  --blue: var(--accent);
}
:root[data-ledger-color='green'] {
  --accent: #17664d;
  --accent-light: #81d8b6;
  --accent-soft: #e4f2eb;
}
:root[data-ledger-color='orange'] {
  --accent: #a44712;
  --accent-light: #ffbd88;
  --accent-soft: #fff0e5;
}
:root[data-ledger-color='purple'] {
  --accent: #7540af;
  --accent-light: #d2acff;
  --accent-soft: #f2eafa;
}
:root[data-ledger-color='teal'] {
  --accent: #076b76;
  --accent-light: #82dbe3;
  --accent-soft: #e2f2f4;
}
:root[data-ledger-color='rose'] {
  --accent: #aa385d;
  --accent-light: #ffacc9;
  --accent-soft: #fce8ef;
}
:root[data-ledger-color][data-theme='dark'] {
  --blue: var(--accent-light);
  --accent-soft: color-mix(in srgb, var(--accent) 28%, #1b263b);
}
:root[data-ledger-color] .primary,
:root[data-ledger-color] .balance-card {
  background: var(--accent);
  color: #fff;
}
:root[data-ledger-color] .primary:hover {
  background: color-mix(in srgb, var(--accent) 87%, #000);
}
:root[data-ledger-color] .navigation .active {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--accent-soft);
}
:root[data-ledger-color] .balance-card p,
:root[data-ledger-color] .balance-footer,
:root[data-ledger-color] .balance-card .month-pill {
  color: #f0f5ff;
}
:root[data-ledger-color] .form-tabs button.active {
  background: var(--accent-soft);
  color: var(--blue);
}
:root[data-ledger-color] .theme-switch {
  background: var(--accent);
}
.page-heading {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}
.page-heading .heading-actions {
  width: 100%;
  justify-content: space-between;
  margin-top: 0;
}
.ledger-selector {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  margin: 0;
  min-height: 44px;
}
.ledger-selector > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ledger-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  outline: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  outline-offset: 2px;
}
.ledger-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 18px;
}
.ledger-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
}
.ledger-choice > span:nth-child(2) {
  flex: 1;
  overflow-wrap: anywhere;
  min-width: 0;
}
.ledger-choice small {
  font-size: 11px;
  color: var(--muted);
}
.ledger-choice.selected {
  border-color: var(--blue);
  background: var(--accent-soft);
}
.current-ledger-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 18px;
  overflow-wrap: anywhere;
}
.ledger-colors {
  border: 0;
  padding: 0;
  margin: 22px 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.ledger-colors legend {
  font-size: 14px;
  margin-bottom: 8px;
}
.ledger-colors label {
  position: relative;
  text-align: center;
  min-width: 0;
  margin: 0;
  cursor: pointer;
}
.ledger-colors input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.ledger-colors label > span {
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin: 6px auto;
  color: white;
}
.ledger-colors input:checked + span {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.ledger-colors input:focus-visible + span {
  outline: 3px dashed var(--ink);
  outline-offset: 3px;
}
.ledger-colors small {
  font-size: 10px;
}
:root[data-ledger-color] {
  --action-bg: var(--accent-soft);
  --action-border: color-mix(in srgb, var(--accent) 65%, #fff);
  --action-ink: var(--accent);
  --action-hover: var(--accent-soft);
}
:root[data-ledger-color][data-theme='dark'] {
  --action-bg: var(--accent-soft);
  --action-border: color-mix(in srgb, var(--accent-light) 60%, #1b263b);
  --action-ink: var(--accent-light);
  --action-hover: var(--accent-soft);
}
:root[data-ledger-color] .secondary:not([data-action='pay-bill']):not([data-action='unpay-bill']) {
  border-color: var(--action-border);
  color: var(--action-ink);
}

.ledger-colors input:checked + span::after {
  content: '✓';
}
.guest-auth {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 44px;
  white-space: nowrap;
  font-size: 13px;
}
.guest-auth a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}
.guest-auth span {
  color: var(--muted);
}
.guest-storage {
  font-size: 12px;
  color: var(--muted);
  padding: 10px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 12px 0;
}
.welcome-offer h2 {
  font-size: 28px;
  line-height: 1.2;
}
.welcome-offer .full {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-top: 12px;
  min-height: 46px;
}
.welcome-offer .hint {
  font-size: 13px;
}
.guest-auth a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
/* Approved 2.2 second opening: icon, wordmark, fade to the live overview. */
.splash-active {
  overflow: hidden;
}
#pocket-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #f6f7fb;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pocket-splash-out 2.2s both;
  pointer-events: auto;
}
html[data-theme='dark'] #pocket-splash {
  background: #101827;
}
.splash-lockup {
  display: flex;
  align-items: center;
  flex-direction: column;
  transform: translateY(-3vh);
}
.splash-lockup img {
  display: block;
  width: 84px;
  height: 84px;
  animation: pocket-icon-in 0.48s 0.08s both cubic-bezier(0.215, 0.61, 0.355, 1);
}
.splash-lockup span {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Arial,
    sans-serif;
  font-size: 34px;
  font-weight: 750;
  letter-spacing: -1.5px;
  line-height: 1.15;
  margin-top: 16px;
  color: #1b2846;
  animation: pocket-word-in 0.42s 0.48s both cubic-bezier(0.215, 0.61, 0.355, 1);
}
html[data-theme='dark'] .splash-lockup span {
  color: #e6eaf5;
}
@keyframes pocket-icon-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes pocket-word-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes pocket-splash-out {
  0%,
  72.727% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  #pocket-splash {
    display: none;
  }
}

/* Income & Savings: compact navigation and ledger-scoped goals. */
.savings-panel {
  margin: 20px 0;
}
.savings-tabs {
  margin-bottom: 22px;
}
.goals-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.savings-goal {
  min-width: 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.savings-goal h3 {
  margin: 0;
  overflow-wrap: anywhere;
}
.savings-goal .panel-head {
  gap: 12px;
  align-items: flex-start;
}
.goal-symbol {
  font-size: 26px;
}
.goal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.goal-actions button {
  padding: 10px 14px;
}
.savings-empty {
  padding: 20px 0;
}
.savings-panel > .hint {
  margin-bottom: 0;
}
.month-control[hidden] {
  display: none;
}
.savings-panel .panel-head {
  flex-wrap: wrap;
  gap: 12px;
}
.savings-panel .hint {
  overflow-wrap: anywhere;
}
@media (max-width: 640px) {
  .goals-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .navigation button .income-nav-label {
    white-space: normal;
    font-size: 10px;
    line-height: 11px;
    max-width: 80px;
  }
  .navigation button {
    height: 56px;
    min-height: 56px;
  }
  .savings-panel .panel-head h2 {
    font-size: 18px;
  }
  .goal-actions button {
    font-size: 12px;
  }
  .savings-panel {
    padding: 20px;
  }
  .savings-tabs button {
    min-height: 44px;
  }
}

@media (max-width: 640px) {
  .navigation button > span:not(.nav-label-full) {
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .navigation .nav-label-full {
    display: none;
  }
}

:root {
  --goal-blue: #334bbe;
  --goal-green: #17664d;
  --goal-orange: #a44712;
  --goal-purple: #7540af;
  --goal-teal: #076b76;
  --goal-rose: #aa385d;
}
:root[data-theme='dark'] {
  --goal-blue: #91a8ff;
  --goal-green: #64c99c;
  --goal-orange: #f1b578;
  --goal-purple: #c29bec;
  --goal-teal: #6bd1d5;
  --goal-rose: #ee96b4;
}

/* Compact launch offer: one primary action, optional details. */
dialog.welcome-offer {
  width: calc(100% - 32px);
  max-width: 440px;
  padding: 32px;
  max-height: calc(100dvh - 32px);
  box-sizing: border-box;
}
.welcome-offer .eyebrow {
  margin: 0 0 20px;
  font-size: 10px;
  letter-spacing: 1.5px;
}
.welcome-offer h2 {
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.6px;
  margin: 0 0 14px;
}
.welcome-offer .offer-intro {
  font-size: 15px;
  line-height: 1.55;
  margin: 0 0 26px;
  color: var(--muted);
}
.welcome-offer .full {
  margin: 0;
  min-height: 48px;
}
.welcome-offer .offer-reassurance {
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
  color: var(--muted);
  margin: 12px 0 18px;
}
.welcome-offer .offer-guest-form {
  text-align: center;
  margin: 0;
}
.welcome-offer .offer-guest-link {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  padding: 10px 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.welcome-offer .offer-guest-link:hover {
  text-decoration-thickness: 2px;
}
.welcome-offer .offer-guest-link:focus-visible,
.welcome-offer summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}
.welcome-offer .offer-preference {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  min-height: 44px;
  margin: 4px 0 14px;
}
.welcome-offer .offer-preference input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 16px;
  accent-color: var(--blue);
}
.welcome-offer .offer-details {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: var(--muted);
  font-size: 12px;
}
.welcome-offer .offer-details summary {
  cursor: pointer;
  min-height: 36px;
  align-content: center;
  width: fit-content;
  margin: auto;
}
.welcome-offer .offer-details p {
  font-size: 12px;
  line-height: 1.65;
  margin: 12px 0 0;
}
@media (max-width: 640px) {
  dialog.welcome-offer {
    padding: 28px 24px;
  }
  .welcome-offer h2 {
    font-size: 28px;
  }
}

/* Separate the submit action from the compact secondary links. */
.auth-secondary {
  margin-top: 20px;
}
.auth-secondary .auth-guest-link {
  margin: 0;
  line-height: 24px;
}
.auth-secondary .auth-links {
  margin-top: 8px;
  line-height: 24px;
}
.auth-secondary a {
  display: inline-block;
  min-height: 24px;
}

/* Subscription overview, scoped to avoid affecting ledger screens. */
#menu-subscription {
  text-decoration: none;
  box-sizing: border-box;
  color: inherit;
}
.subscription-shell {
  max-width: 1000px;
}
.subscription-back {
  text-decoration: none;
}
.subscription-heading {
  margin: 38px 0 26px;
}
.subscription-heading h1 {
  margin: 0 0 12px;
}
.subscription-status {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  margin-top: 24px;
}
.plan-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.plan-card h2 {
  margin: 0 0 10px;
}
.plan-card ul {
  padding-left: 20px;
  margin: 22px 0;
  line-height: 1.65;
  font-size: 14px;
}
.plan-card li + li {
  margin-top: 10px;
}
.plan-pro {
  border: 2px solid var(--blue);
}
.plan-comparison {
  margin-bottom: 24px;
}
.plan-comparison table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}
.plan-comparison th,
.plan-comparison td {
  text-align: left;
  padding: 16px 10px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
  vertical-align: top;
}
.plan-comparison th:first-child {
  width: 44%;
  padding-left: 0;
}
.plan-comparison tbody th {
  font-weight: 500;
}
.plan-comparison thead th {
  color: var(--blue);
}
.plan-comparison tr:last-child > * {
  border-bottom: 0;
}
.subscription-faq details {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.subscription-faq summary {
  cursor: pointer;
  font-weight: 600;
  line-height: 1.5;
}
.subscription-faq details p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 0;
}
.subscription-return {
  display: inline-flex;
  text-decoration: none;
  margin-top: 24px;
}
.subscription-shell .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (max-width: 640px) {
  .subscription-shell {
    padding-bottom: 24px;
  }
  .subscription-heading {
    margin-top: 24px;
  }
  .subscription-heading h1 {
    font-size: 29px;
  }
  .plan-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .plan-comparison {
    padding: 20px 16px;
  }
  .plan-comparison table {
    font-size: 12px;
  }
  .plan-comparison th,
  .plan-comparison td {
    padding: 14px 6px;
  }
  .plan-comparison th:first-child {
    width: 42%;
  }
  .subscription-status {
    align-items: flex-start;
    flex-direction: column;
  }
  .subscription-back {
    font-size: 12px;
    padding: 10px;
  }
}

.menu-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: 18px;
  font-weight: 650;
  text-align: left;
}
.profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--action-bg);
  border: 1px solid var(--action-border);
  color: var(--action-ink);
  font-size: 22px;
  font-weight: 700;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-large {
  width: 72px;
  height: 72px;
  font-size: 30px;
}
.profile-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 6px 0 24px;
}
.profile-summary > div {
  min-width: 0;
}
.profile-summary .hint {
  overflow-wrap: anywhere;
  margin: 6px 0 0;
}
.menu-profile:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 5px;
  border-radius: 28px;
}
.side-menu .menu-bottom #dark-mode {
  margin-bottom: 12px;
}
.profile-summary + form {
  margin-bottom: 24px;
}

.side-menu .menu-bottom #dark-mode {
  background: transparent;
  color: inherit;
}
#modal-body:has([data-form='profile']) hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

.category-budgets,
.monthly-summary {
  margin-top: 24px;
}
.summary-chart {
  display: grid;
  gap: 18px;
  margin: 22px 0;
}
.summary-chart-row > div:first-child {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  margin-bottom: 8px;
}
.summary-chart-row span {
  overflow-wrap: anywhere;
}
.summary-chart-row strong {
  white-space: nowrap;
}
.summary-track {
  height: 12px;
  border-radius: 8px;
  background: var(--line);
  overflow: hidden;
}
.summary-track i {
  height: 100%;
  display: block;
  border-radius: 8px;
}
.summary-locked {
  display: grid;
  gap: 14px;
  filter: blur(5px);
  margin: 24px 0;
  pointer-events: none;
}
.summary-locked i {
  height: 12px;
  background: var(--blue);
  width: 80%;
  border-radius: 8px;
}
.summary-locked i:nth-child(2) {
  width: 55%;
}
.summary-locked i:nth-child(3) {
  width: 32%;
}
.monthly-summary .panel-head,
.category-budgets .panel-head {
  flex-wrap: wrap;
  gap: 12px;
}

.ledger-heading-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1/-1;
  justify-self: start;
  min-width: 0;
  margin: 12px 0;
}
.ledger-heading-controls .ledger-selector {
  margin: 0;
  min-width: 0;
  max-width: calc(100% - 74px);
}
.ledger-pro-add {
  flex-shrink: 0;
  min-height: 44px;
  gap: 6px;
  display: inline-flex;
  align-items: center;
}
.ledger-pro-add span {
  font-size: 11px;
}
.ledger-heading-controls .ledger-selector > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-heading-controls .ledger-selector {
  max-width: 100%;
}

.pro-required .full {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 46px;
  margin: 20px 0 12px;
}
.pro-required form {
  text-align: center;
}

/* A consistent, persistent Pro feature badge across all plans. */
.pro-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
  white-space: nowrap;
  background: #f0f3f9;
  color: #596b89;
  border: 0;
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 11px !important;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0;
  margin-left: 5px;
  text-decoration: none;
}
[data-theme='dark'] .pro-badge {
  background: #2d3b58;
  color: #c2ceeb;
}
.savings-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.modal-head h2 {
  line-height: 1.3;
}
.bill-alert-tools button {
  flex-wrap: wrap;
}
.menu-row .pro-badge {
  font-size: 10px !important;
}

/* Keep feature badges beside their labels, including full-width actions. */
.full > .pro-badge {
  margin-right: auto;
}

/* ==========================================================================
   HeyPocket Money refresh (2026-10)
   A layer on top of the v2 styles: calmer surfaces, tabular money figures,
   a compact mobile header, and an app-like bottom bar.
   ========================================================================== */
:root {
  --brand: #2f4ac0;
  --brand-deep: #1f3593;
  --brand-soft: #eef1fe;
  --mint: #3ccf9e;
  --card: #fff;
  --shadow-sm: 0 1px 2px #1b28460a, 0 2px 8px #1b28460d;
  --shadow-md: 0 10px 30px -12px #1f359340;
  --radius: 20px;
  --blue: var(--brand);
}
:root[data-theme='dark'] {
  --brand: #8fa2ff;
  --brand-deep: #6d82f0;
  --brand-soft: #232f4d;
  --card: #1b263b;
  --shadow-sm: none;
  --shadow-md: 0 12px 30px -14px #00000080;
}
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.money-display,
.money-value,
.stat strong,
.balance-card h2,
.donut-center strong,
.legend-values strong,
.entry-amount,
.bill-amount {
  font-variant-numeric: tabular-nums;
}

/* Brand lockup: "HeyPocket" + accent "Money" */
.brand-name b {
  font-weight: 750;
  color: var(--brand);
}
.auth-story .brand-name b {
  color: #b9c6ff;
}
[data-theme='dark'] .brand-name b {
  color: var(--brand);
}

/* Sticky, frosted header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}

/* Cards: hairline + soft shadow instead of heavy borders */
.panel,
.stat,
.card,
.balance-card {
  box-shadow: var(--shadow-sm);
}
.stat,
.panel {
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
}
.stat-icon,
.entry-icon {
  border-radius: 12px;
}

/* Hero: depth without noise */
.balance-card {
  background:
    radial-gradient(120% 140% at 100% 0%, #4b67e0 0%, transparent 55%),
    linear-gradient(160deg, var(--brand) 0%, var(--brand-deep) 100%);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.balance-card::after {
  content: '';
  position: absolute;
  right: -60px;
  bottom: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: #ffffff0d;
  pointer-events: none;
}
[data-theme='dark'] .balance-card {
  background: linear-gradient(160deg, #2a3f9e 0%, #1a2a6b 100%);
}

/* Buttons */
.primary {
  box-shadow:
    0 1px 0 #ffffff26 inset,
    0 6px 16px -8px #1f359399;
}
.primary:hover {
  filter: brightness(1.06);
}
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 18px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.check-row input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
  flex: 0 0 auto;
}

/* Desktop tabs: pill highlight */
@media (min-width: 641px) {
  .navigation {
    gap: 6px;
    border-bottom: 0;
    margin-bottom: 28px;
    padding: 6px;
    background: var(--card);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    width: max-content;
    max-width: 100%;
  }
  .navigation button {
    border-bottom: 0;
    border-radius: 11px;
    padding: 10px 16px;
  }
  .navigation button.active {
    background: var(--brand-soft);
    color: var(--brand);
  }
  .topbar {
    border-bottom: 0;
  }
}

/* Mobile: get to the numbers faster */
@media (max-width: 640px) {
  .topbar {
    height: 64px;
    margin: 0 -20px;
    padding: 0 20px;
  }
  .brand {
    font-size: 21px;
    letter-spacing: -0.8px;
  }
  .brand-logo {
    width: 30px;
    height: 30px;
  }
  .menu-trigger {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    border-radius: 14px;
  }
  .menu-trigger span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .page-heading {
    margin: 8px 0 18px;
    gap: 12px;
  }
  .page-heading .eyebrow {
    margin-bottom: 4px;
  }
  .page-heading h1 {
    font-size: 26px;
    letter-spacing: -0.6px;
    margin-bottom: 2px;
  }
  .page-heading .muted {
    display: none;
  }
  .page-heading .heading-actions {
    gap: 10px;
  }
  .balance-card {
    min-height: 0;
    padding: 22px;
  }
  .stat .money-unit {
    display: inline;
    font-size: 12px;
    margin: 0 4px 0 0;
    color: var(--muted);
  }
  .navigation {
    background: color-mix(in srgb, var(--card) 92%, transparent);
    border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    box-shadow: 0 -6px 20px -14px #1b284640;
  }
  .navigation button {
    font-weight: 600;
    font-size: 11px;
    gap: 4px;
  }
  .navigation .active {
    background: var(--brand-soft);
    color: var(--brand);
  }
  .quick-entry {
    background: linear-gradient(160deg, var(--brand), var(--brand-deep));
    box-shadow: 0 10px 24px -8px #1f3593aa;
  }
}
[data-theme='dark'] .navigation {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

/* Installed app (home screen / app shell) */
@media (display-mode: standalone) {
  .page-footer {
    display: none;
  }
  .topbar {
    padding-top: env(safe-area-inset-top);
    height: calc(64px + env(safe-area-inset-top));
  }
}
#pocket-splash {
  animation-duration: 1.3s;
}
/* Toasts never block taps (the quick-add button sits underneath on phones). */
#toast {
  pointer-events: none;
}
@media (max-width: 640px) {
  #toast {
    bottom: calc(140px + env(safe-area-inset-bottom));
    width: auto;
    max-width: calc(100% - 40px);
  }
}
/* Phone: three summary tiles in one row instead of 2 + an orphan. */
@media (max-width: 640px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .stats .stat {
    padding: 12px 10px;
  }
  .stats .stat-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 8px;
  }
  .stats .stat-icon svg {
    width: 16px;
    height: 16px;
  }
  .stats .stat p {
    font-size: 11px;
    line-height: 1.25;
    margin-bottom: 4px;
  }
  .stats .stat .money-unit {
    display: block;
    font-size: 10px;
    margin: 0 0 1px;
  }
  .stats .stat strong {
    font-size: 16px;
    letter-spacing: -0.3px;
  }
}

/* ---------- Bills: summary + grouped, compact rows ---------- */
.bills-summary .panel-head {
  margin-bottom: 10px;
}
.bills-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 6px 0 14px;
}
.bills-left > span {
  font-size: 13px;
  color: var(--muted);
}
.bills-left .money-display {
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 650;
  letter-spacing: -1px;
}
.bills-left .money-unit {
  display: inline;
  font-size: 0.5em;
  color: var(--muted);
  margin-right: 6px;
  letter-spacing: 0;
}
.bills-bar {
  height: 10px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--line) 80%, transparent);
  overflow: hidden;
}
.bills-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f9e7a, #3ccf9e);
  transition: width 0.3s;
}
.bills-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.bills-figures span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.bills-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.bills-dot.paid {
  background: #2f9e7a;
}
.bills-dot.transfer {
  background: #8b97b5;
}
.bills-reminders {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.bills-reminders .secondary {
  font-size: 13px;
  padding: 8px 12px;
  min-height: 40px;
  gap: 7px;
}
.bills-reminders svg {
  width: 16px;
  height: 16px;
}
.bills-list {
  margin-top: 16px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.bill-group + .bill-group {
  margin-top: 10px;
}
.bill-group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.bill-group h3 span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--brand-soft);
  color: var(--brand);
}
.bill-group.is-urgent h3 {
  color: #b4532a;
}
.bill-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.bill-group h3 + .bill-item {
  border-top: 0;
}
.bill-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 50px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  line-height: 1;
}
.bill-date b {
  font-size: 18px;
  font-weight: 700;
}
.bill-date small {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 3px;
  opacity: 0.8;
}
.is-overdue .bill-date {
  background: #fdecee;
  color: #b3263f;
}
.is-today .bill-date,
.is-soon .bill-date {
  background: #fff2e6;
  color: #b4532a;
}
.is-paid .bill-date {
  background: #e8f6f0;
  color: #2b8a6a;
}
.bill-main {
  min-width: 0;
}
.bill-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bill-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.bill-status {
  font-weight: 600;
}
.is-overdue .bill-status {
  color: #b3263f;
}
.is-today .bill-status,
.is-soon .bill-status {
  color: #b4532a;
}
.is-paid .bill-status {
  color: #2b8a6a;
}
.bill-progress {
  display: block;
  height: 4px;
  margin-top: 8px;
  max-width: 180px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--line) 80%, transparent);
  overflow: hidden;
}
.bill-progress i {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: inherit;
}
.bill-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.bill-amount {
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
}
.is-paid .bill-amount {
  color: var(--muted);
  font-weight: 550;
}
.bill-pay {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #bfe6d6;
  border-radius: 99px;
  background: #e9f7f1;
  color: #1f7a5c;
  font-size: 13px;
  font-weight: 650;
}
.bill-pay svg {
  width: 14px;
  height: 14px;
}
.bill-pay:hover {
  background: #dcf2e8;
}
.bill-undo {
  font-size: 12.5px;
  padding: 4px 2px;
  min-height: 28px;
  color: var(--muted);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bill-more {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.bill-more:hover {
  background: var(--brand-soft);
  color: var(--brand);
}
.is-transfer .bill-amount::after {
  content: ' ↔';
  color: var(--muted);
  font-weight: 500;
}
[data-theme='dark'] .is-overdue .bill-date {
  background: #3a1d26;
  color: #ff9bac;
}
[data-theme='dark'] .is-today .bill-date,
[data-theme='dark'] .is-soon .bill-date {
  background: #3a2a1c;
  color: #ffbe8a;
}
[data-theme='dark'] .is-paid .bill-date {
  background: #173328;
  color: #7dd9b5;
}
[data-theme='dark'] .bill-pay {
  background: #173328;
  border-color: #245a45;
  color: #7dd9b5;
}
[data-theme='dark'] .is-overdue .bill-status {
  color: #ff9bac;
}
[data-theme='dark'] .is-today .bill-status,
[data-theme='dark'] .is-soon .bill-status {
  color: #ffbe8a;
}
[data-theme='dark'] .is-paid .bill-status {
  color: #7dd9b5;
}
[data-theme='dark'] .bill-group.is-urgent h3 {
  color: #ffbe8a;
}
@media (max-width: 640px) {
  .bill-item {
    gap: 10px;
    padding: 12px 0;
  }
  .bill-date {
    width: 42px;
    height: 46px;
  }
  .bill-pay {
    min-height: 40px;
    padding: 8px 12px;
  }
  .bill-more {
    width: 32px;
    margin-right: -6px;
  }
}
@media (max-width: 640px) {
  .bill-title {
    white-space: normal;
    overflow: visible;
    line-height: 1.3;
  }
  .bill-meta {
    flex-direction: column;
    gap: 1px;
  }
  .bill-sep {
    display: none;
  }
  .bills-reminders .secondary {
    flex: 1 1 0;
    justify-content: center;
    padding: 8px 6px;
    font-size: 12.5px;
  }
  .bills-reminders .pro-badge {
    display: none;
  }
}
.bill-danger-zone {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.bill-danger-zone .hint {
  margin: 0 0 10px;
}
.bill-danger-zone .form-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

/* Language picker */
.lang-row{cursor:default}
.lang-select{appearance:none;-webkit-appearance:none;border:1px solid var(--line);border-radius:10px;background:var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2369758b' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center;color:var(--ink);font-size:14px;padding:7px 28px 7px 10px;min-height:36px}
.auth-lang{display:flex;justify-content:flex-end;margin-bottom:12px}
:lang(zh) body{font-family:Inter,-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Noto Sans SC","Segoe UI",sans-serif}
:lang(zh) .eyebrow{letter-spacing:.12em}
.lang-row>span{white-space:nowrap}
.auth-lang .lang-select,.lang-row .lang-select{width:auto;max-width:60%}

/* Quick picks in the add-entry form */
.shortcut-chips{margin:0 0 14px}
.shortcut-label{display:block;font-size:12px;font-weight:600;color:var(--muted);margin-bottom:6px}
.shortcut-row{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.shortcut-row::-webkit-scrollbar{display:none}
.shortcut-chip{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-start;gap:1px;max-width:160px;padding:7px 12px;border:1px solid var(--line);border-radius:12px;background:var(--card);color:var(--ink);font-size:13px;font-weight:600;text-align:left}
.shortcut-chip span{max-width:136px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.shortcut-chip small{font-size:11.5px;font-weight:500;color:var(--muted);font-variant-numeric:tabular-nums}
.shortcut-chip:hover{border-color:var(--brand);background:var(--brand-soft)}
.shortcut-chip.selected{border-color:var(--brand);background:var(--brand-soft);color:var(--brand)}
/* Analytics prompt sits above the quick-add button on phones instead of covering it. */
@media (max-width: 640px) {
  .analytics-choice { bottom: calc(140px + env(safe-area-inset-bottom)); padding: 16px; }
  .analytics-choice > div { flex-wrap: nowrap; }
  .analytics-choice button { flex: 1 1 0; }
}
