:root {
  --ink: #eaf4ef;
  --muted: #91aaa1;
  --paper: #0b1515;
  --card: #122321dd;
  --line: #29423d;
  --mint: #8fcbb0;
  --mint-deep: #62b38e;
  --coral: #ee8d73;
  --gold: #e2bd69;
  --shadow: 0 18px 50px #00000030;
  --scotia: #e4484d;
  --scotia-grey: #a2a7ad;
  --neo: #55bd83;
  --rogers: #ec3b46;
  --black-card: #d7dde1;
}
:root.light {
  --ink: #18322f;
  --muted: #71837f;
  --paper: #f7f4ee;
  --card: #fffdf9;
  --line: #e7e1d6;
  --mint: #b7d8c6;
  --mint-deep: #2d6b5d;
  --shadow: 0 18px 50px #18322f12;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0, #174c3d 0, transparent 32%),
    radial-gradient(circle at 0 100%, #182d3c 0, transparent 34%), var(--paper);
  font:
    15px/1.45 Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
  transition:
    background 0.25s,
    color 0.25s;
}
:root.light body {
  background:
    radial-gradient(circle at 90% 0, #d9eee4 0, transparent 32%),
    radial-gradient(circle at 0 100%, #e9eef0 0, transparent 34%), var(--paper);
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
.shell {
  max-width: 1240px;
  margin: auto;
  padding: 24px 28px 60px;
}
.topbar,
.hero,
.section-head,
.month-nav,
.top-actions,
.filters,
.form-actions,
.insight-tabs {
  display: flex;
}
.topbar {
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 27px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 22px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  color: #0b1515;
  background: var(--mint);
  box-shadow: 5px 5px 0 #306954;
}
.custom-logo-mark {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  border: 0;
  box-shadow: none;
  filter: saturate(0.86) contrast(1.08);
}
.top-actions,
.month-nav {
  gap: 10px;
  align-items: center;
}
.avatar {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--mint-deep);
  font-weight: 800;
}
.eyebrow {
  color: var(--mint-deep);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 11px;
}
h1 {
  margin: 5px 0 8px;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.055em;
}
h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.04em;
}
h3 {
  margin: 0;
  font-size: 15px;
}
.intro {
  color: var(--muted);
  max-width: 590px;
  margin: 0;
}
.hero {
  justify-content: space-between;
  align-items: end;
  gap: 30px;
  margin-bottom: 20px;
}
.primary {
  border: 0;
  border-radius: 12px;
  padding: 13px 18px;
  color: #08201a;
  background: var(--mint);
  font-weight: 850;
  box-shadow: 0 5px 0 #306954;
  transition: transform 0.15s;
}
.primary:hover {
  transform: translateY(-2px);
}
.ghost {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
  color: var(--ink);
  background: #ffffff0b;
  font-weight: 700;
}
.stats {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}
.card {
  background: color-mix(in srgb, var(--card) 93%, transparent);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.stat {
  min-height: 137px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stat:first-child {
  position: relative;
  padding-right: 142px;
  background: linear-gradient(135deg, #1f5144, #123a31);
  color: #fff;
  border-color: #38735f;
}
.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.stat:first-child .stat-label,
.stat:first-child small {
  color: #b9d2c8;
}
.stat-value {
  font-size: 31px;
  font-weight: 850;
  letter-spacing: -0.06em;
}
.stat small {
  color: var(--muted);
}
.commitment-progress {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 9px;
  min-width: 104px;
}
.progress-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  column-gap: 7px;
  align-items: center;
}
.progress-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 900;
}
.progress-item.paid .progress-icon {
  color: #b8f2ce;
  background: #70c99428;
}
.progress-item.remaining .progress-icon {
  color: #ffd29a;
  background: #f0b26228;
}
.progress-copy {
  display: grid;
  line-height: 1.05;
}
.progress-copy small {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.progress-copy strong {
  font-size: 13px;
  letter-spacing: -0.02em;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.8fr);
  gap: 18px;
  align-items: start;
}
.section {
  padding: 22px;
}
.section-head {
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.month-nav button {
  border: 1px solid var(--line);
  background: #ffffff0b;
  border-radius: 9px;
  width: 32px;
  height: 32px;
  color: var(--ink);
}
.filters {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.search {
  flex: 1 1 180px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #ffffff0b;
  color: var(--ink);
  outline: none;
}
.search:focus,
input:focus,
select:focus {
  border-color: var(--mint-deep);
  box-shadow: 0 0 0 3px #b7d8c655;
}
select,
label input,
label select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  background: #182d2a;
  color: var(--ink);
}
.timeline {
  display: grid;
  gap: 10px;
}
.payment {
  display: grid;
  grid-template-columns: 47px 1fr auto auto;
  gap: 13px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #ffffff0b;
  transition: 0.15s;
}
.payment.past {
  opacity: 0.45;
}
.payment.today {
  border-color: var(--coral);
  box-shadow: 0 0 0 2px #ee8d7333;
}
.payment.next {
  border-color: var(--mint);
  background: #79cba51c;
  box-shadow: 0 0 0 2px #79cba522;
}
.payment:hover {
  border-color: var(--mint);
  transform: translateX(2px);
}
.date {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #79cba522;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--mint);
  font-weight: 850;
  line-height: 1.05;
  font-size: 12px;
}
.date span {
  display: block;
  font-size: 16px;
}
.past .date {
  background: #ffffff0a;
  color: var(--muted);
}
.today .date {
  background: #ee8d7333;
  color: var(--coral);
}
.next .date {
  background: #79cba544;
}
.payment-name {
  font-weight: 800;
}

.payment-name .eyebrow {
    margin-left: 10px;
}

.payment-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.account-marker {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-right: 5px;
  border-radius: 50%;
  color: #08201a;
  background: var(--neo);
  font-size: 9px;
  font-weight: 900;
  vertical-align: -3px;
}
.account-marker.neo-world,
.account-marker.neo-master {
  color: #fff;
  background: #202628;
  border: 1px solid #d7dde1;
}
.account-marker.scotia {
  background: var(--scotia);
}
.account-marker.scotia-grey {
  background: var(--scotia-grey);
  color: #18322f;
}
.account-marker.rogers {
  background: var(--rogers);
  color: #fff;
}
.amount {
  font-weight: 850;
  text-align: right;
}
.payment-actions {
  display: flex;
  gap: 5px;
}
.payment-actions button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
}
.payment-actions button:hover {
  color: var(--ink);
  border-color: var(--mint);
}
.payment-actions svg {
  width: 14px;
  height: 14px;
}
.tag {
  display: inline-block;
  padding: 0px 5px;
  border-radius: 50px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
}
.tag.green {
  background: #e4f1e9;
  color: #2d6b5d;
}
.tag.red {
  background: #f9e5df;
  color: #a6533c;
}
.side-stack {
  display: grid;
  gap: 18px;
}
.side-stack .section {
  padding: 20px;
}
.chart {
  height: 180px;
  display: flex;
  gap: 11px;
  align-items: end;
  padding: 18px 4px 23px;
  border-bottom: 1px solid var(--line);
}
.bar-wrap {
  height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.bar {
  width: 100%;
  max-width: 34px;
  border: 0;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(#82bba5, var(--mint-deep));
  min-height: 12px;
  transition: 0.2s;
}
.bar:hover,
.bar.active {
  background: linear-gradient(#f0c875, var(--coral));
  transform: scaleY(1.05);
  transform-origin: bottom;
}
.legend {
  display: flex;
  justify-content: space-between;
  padding-top: 14px;
  color: var(--muted);
  font-size: 12px;
}
.history-current {
  display: grid;
  justify-items: end;
  gap: 0;
}
#historyComparison {
  display: none;
}
.commitment-rhythm {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 18px;
  line-height: 1.2;
  white-space: nowrap;
}
.commitment-rhythm .material-symbols-outlined {
  flex: 0 0 auto;
  font-size: 16px;
  font-weight: 800;
}
.commitment-rhythm.less {
  color: var(--ink);
}
.commitment-rhythm.more {
  color: var(--ink);
}

.history-comparison {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 4px;
  font-size: 12px;
  font-weight: 800;
}
.history-comparison .material-symbols-outlined {
  font-size: 16px;
}
.history-comparison.less {
  color: var(--accent);
}
.history-comparison.more {
  color: var(--today);
}
.history-comparison.same {
  color: var(--muted);
}
.tag.bill-type-tag {
  font-weight: 400;
}
.reminder {
  display: flex;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.reminder:last-child {
  border: 0;
  padding-bottom: 0;
}
.reminder-icon {
  color: var(--coral);
  font-size: 19px;
}
.reminder p {
  margin: 0;
  font-weight: 750;
}
.reminder small {
  color: var(--muted);
}
.insight-tabs {
  gap: 6px;
  margin: -4px 0 14px;
}
.insight-tabs button {
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 6px 10px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}
.insight-tabs button.active {
  color: var(--ink);
  background: #79cba522;
  border-color: #79cba566;
}
.mini-bars {
  display: grid;
  gap: 10px;
}
.mini-line {
  display: grid;
  grid-template-columns: 105px 1fr 50px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.mini-track {
  height: 9px;
  border-radius: 99px;
  background: #ffffff0c;
  overflow: hidden;
}
.mini-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--neo);
}
.mini-fill.scotia {
  background: var(--scotia);
}
.mini-fill.gold {
  background: var(--gold);
}
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  padding: 24px;
  background: #18322f88;
  place-items: center;
  z-index: 3;
}
.modal-backdrop.open {
  display: grid;
}
.modal {
  width: min(450px, 100%);
  padding: 24px;
  background: #142824;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 25px 80px #00000066;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 20px;
}
.close {
  border: 0;
  background: none;
  font-size: 22px;
  color: var(--muted);
}
.reminder-confirmation .intro {
  margin: 0 0 16px;
}
.reminder-confirmation-details {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff08;
}
.reminder-confirmation-details strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}
.reminder-confirmation-details span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.form-grid {
  display: grid;
  gap: 13px;
}
label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
label input,
label select {
  width: 100%;
  outline: none;
}
.form-actions {
  justify-content: end;
  gap: 8px;
  margin-top: 20px;
}
.month-view {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.weekday {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  padding: 4px;
}
.day-cell {
  min-height: 82px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff08;
}
.day-cell.today {
  border-color: var(--coral);
}
.day-number {
  color: var(--muted);
  font-size: 12px;
}
.day-payment {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-top: 6px;
  padding: 3px 5px;
  border-radius: 5px;
  background: #79cba533;
  color: var(--ink);
  font-size: 10px;
}
@media (max-width: 850px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stats .stat:first-child {
    grid-column: span 2;
  }
  .layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 590px) {
  .shell {
    padding: 22px 15px 40px;
  }
  .hero {
    display: block;
  }
  .hero .primary {
    margin-top: 19px;
    width: 100%;
  }
  .stats {
    gap: 9px;
  }
  .stat {
    min-height: 118px;
    padding: 15px;
  }
  .stat-value {
    font-size: 24px;
  }
  .section {
    padding: 15px;
  }
  .payment {
    grid-template-columns: 43px 1fr auto;
    gap: 9px;
    padding: 11px 9px;
  }
  .amount {
    font-size: 13px;
  }
  .month-view {
    gap: 3px;
  }
  .day-cell {
    min-height: 64px;
    padding: 4px;
  }
  .day-payment {
    font-size: 9px;
  }
}
#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 5;
  display: grid;
  gap: 8px;
  max-width: min(360px, calc(100vw - 44px));
}
.toast-item {
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #142824;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease-out;
}
.toast-item.success {
  border-color: var(--mint-deep);
}
.toast-item.error {
  border-color: var(--coral);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.payment-meta {
  display: flex;
  align-items: center;
  gap: 2px;
}
.account-marker {
  flex: 0 0 17px;
  margin-right: 3px;
}
.mini-fill.neo {
  background: var(--neo);
}
.mini-fill.neo-world,
.mini-fill.neo-master {
  background: #d7dde1;
}
.mini-fill.scotia {
  background: var(--scotia);
}
.mini-fill.scotia-grey {
  background: var(--scotia-grey);
}
.mini-fill.rogers {
  background: var(--rogers);
}
:root {
  --field: #182d2a;
  --modal: #142824;
}
:root.light {
  --field: #fffdf9;
  --modal: #fffdf9;
}
select,
label input,
label select {
  background: var(--field);
  color: var(--ink);
}
label input[type="color"] {
  width: 58px;
  height: 40px;
  padding: 3px;
  border-radius: 9px;
  cursor: pointer;
}
label input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
label input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 5px;
}
label input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: 5px;
}
.modal {
  background: var(--modal);
}
.reminder {
  width: 100%;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}
.reminder-copy {
  min-width: 0;
  flex: 1;
}
.reminder-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reminder-chevron {
  color: var(--muted);
  font-size: 18px;
}
.reminder:hover,
.reminder:focus-visible {
  color: var(--gold);
  outline: none;
}
.reminder:focus-visible {
  box-shadow: 0 0 0 3px #b7d8c655;
  border-radius: 8px;
}
/* Gradient mockup palette */
:root {
  --ink: #fff8f1;
  --muted: #c6a9a1;
  --paper: #160f18;
  --card: #241822cc;
  --line: #53313b;
  --modal: #261923;
  --field: #261923;
  --gradient: linear-gradient(135deg, #f65923, #f44455 48%, #f6ce13);
  --accent: #ffb11e;
  --accent-deep: #f65923;
  --accent-soft: #ffb11e22;
  --today: #ff5c5c;
  --today-soft: #ff5c5c33;
  --on-gradient-muted: #fff1cf;
}
:root.green {
  --ink: #eaf4ef;
  --muted: #91aaa1;
  --paper: #0b1515;
  --card: #122321aa;
  --line: #29423d;
  --control: #ffffff0b;
  --wash: #ffffff0c;
  --modal: #142824;
  --field: #182d2a;
  --gradient: linear-gradient(135deg, #8fcbb0, #62b38e 48%, #2d6b5d);
  --accent: #8fcbb0;
  --accent-deep: #62b38e;
  --accent-soft: #79cba522;
  --today: #ee8d73;
  --today-soft: #ee8d7333;
  --on-gradient-muted: #b9d2c8;
}
body {
  background:
    radial-gradient(circle at 90% 0, #8b283f 0, transparent 30%),
    radial-gradient(circle at 0 100%, #48213b 0, transparent 34%), var(--paper);
}
:root.green body {
  background:
    radial-gradient(circle at 90% 0, #174c3d 0, transparent 32%),
    radial-gradient(circle at 0 100%, #182d3c 0, transparent 34%), var(--paper);
}
.brand-mark {
  color: #fff;
  background: var(--gradient);
  box-shadow: 5px 5px 0 var(--accent-deep);
}
.primary {
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 5px 0 var(--accent-deep);
}
.stat:first-child {
  background: var(--gradient);
  border-color: var(--accent);
}
.stat:first-child .stat-label,
.stat:first-child small {
  color: var(--on-gradient-muted);
}
.search:focus,
input:focus,
select:focus {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.payment.today {
  border-color: var(--today);
  box-shadow: 0 0 0 2px var(--today-soft);
}
.payment.next {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.payment:hover,
.payment-actions button:hover {
  border-color: var(--accent);
}
.date {
  background: var(--accent-soft);
  color: var(--accent);
}
.today .date {
  background: var(--today-soft);
  color: var(--today);
}
.next .date {
  background: var(--accent-soft);
}
.theme-switch {
  width: 56px;
  height: 32px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: linear-gradient(90deg, #f65923, #f6ce13);
  position: relative;
  transition: 0.25s;
}
.theme-switch::after {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff8f1;
  box-shadow: 0 2px 5px #0006;
  transition: transform 0.25s;
}
.theme-switch[aria-checked="true"] {
  background: linear-gradient(90deg, #2d6b5d, #8fcbb0);
}
.theme-switch[aria-checked="true"]::after {
  transform: translateX(24px);
  background: #eaf4ef;
}
.theme-switch:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 2px;
}
#reminderDaysLabel[hidden],
#paymentReminderDaysLabel[hidden] {
  display: none;
}
.reminder-danger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.reminder-danger strong,
.reminder-danger small {
  display: block;
  color: var(--muted);
}
.reminder-danger strong {
  font-size: 12px;
  font-weight: 700;
}
.reminder-danger small {
  margin-top: 2px;
  font-size: 11px;
}
.danger-icon-button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
}
.danger-icon-button[hidden] {
  display: none;
}
.danger-icon-button:hover,
.danger-icon-button:focus-visible {
  color: var(--today);
  border-color: var(--today);
  background: var(--today-soft);
  outline: none;
}
.danger-icon-button svg {
  width: 15px;
  height: 15px;
}
/* Keep time-sensitive reminders ahead of the optional spending breakdown. */
.side-stack > section:nth-child(2) {
  order: 3;
}
.side-stack > section:nth-child(3) {
  order: 2;
}
.account-list {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}
.account-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.account-swatch {
  width: 13px;
  height: 13px;
  border: 1px solid #ffffff66;
  border-radius: 50%;
}
.account-row span:last-child {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
.account-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.account-tools h3 {
  grid-column: 1/-1;
}
.account-tools .form-actions {
  grid-column: 1/-1;
  margin-top: 0;
}
@media (max-width: 590px) {
  .account-tools {
    grid-template-columns: 1fr;
  }
}
.account-row-actions {
  display: flex;
  gap: 5px;
  margin-left: auto;
}
.account-row-actions + span {
  margin-left: 0;
}
.account-icon-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
}
.account-icon-button:hover,
.account-icon-button:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}
.account-icon-button.delete:hover,
.account-icon-button.delete:focus-visible {
  color: var(--today);
  border-color: var(--today);
}
.account-icon-button svg {
  width: 14px;
  height: 14px;
}
.payment-picker {
  display: grid;
  gap: 7px;
  max-height: 190px;
  margin-top: 12px;
  overflow: auto;
}
.payment-choice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
}
.payment-choice small {
  color: var(--muted);
}
.payment-choice input {
  accent-color: var(--accent);
}
.avatar {
  color: #fff;
  background: var(--gradient);
  border-color: var(--accent);
  box-shadow: 0 4px 12px var(--accent-soft);
}
#accountManager {
  align-items: center;
}
#accountManager .modal {
  width: min(860px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
#accountManager .account-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
}
#accountManager .account-row {
  min-width: 0;
  padding: 11px 12px;
}
#accountManager .account-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#accountManager .account-count {
  margin-left: 0 !important;
}
#accountManager .account-row-actions {
  flex: 0 0 auto;
}
#accountManager .account-tools {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 12px 16px;
}
#accountManager .account-tools h3,
#accountManager .payment-picker,
#accountManager .account-tools .form-actions {
  grid-column: 1/-1;
}
#accountManager .payment-picker {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 220px;
  margin: 0;
  padding-right: 3px;
}
#accountManager .payment-choice {
  min-width: 0;
}
@media (max-width: 650px) {
  #accountManager {
    padding: 14px;
  }
  #accountManager .account-list,
  #accountManager .account-tools,
  #accountManager .payment-picker {
    grid-template-columns: 1fr;
  }
}
/* Responsive layout: wide dashboard to tablet to compact phone. */
@media (min-width: 1280px) {
  .shell {
    max-width: 1360px;
    padding-left: 40px;
    padding-right: 40px;
  }
  .layout {
    grid-template-columns: minmax(0, 1.7fr) minmax(310px, 0.78fr);
  }
}
@media (max-width: 1080px) {
  .shell {
    padding-left: 22px;
    padding-right: 22px;
  }
  .top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats .stat:first-child {
    grid-column: span 2;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  }
}
@media (max-width: 850px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .side-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  .side-stack > section:first-child {
    grid-column: span 2;
  }
  .side-stack > section:nth-child(2),
  .side-stack > section:nth-child(3) {
    order: initial;
  }
}
@media (max-width: 640px) {
  .shell {
    padding: 16px 14px 38px;
  }
  .topbar {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 22px;
  }
  .brand {
    font-size: 20px;
  }
  .brand .custom-logo-mark {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }
  .top-actions {
    gap: 7px;
  }
  .top-actions .ghost {
    padding: 9px 10px;
  }
  .avatar {
    width: 34px;
    height: 34px;
  }
  .hero {
    align-items: stretch;
    gap: 16px;
  }
  .hero .primary {
    flex: 0 0 auto;
  }
  .section {
    padding: 16px;
  }
  .section-head {
    align-items: flex-start;
  }
  .filters > * {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }
  .filters .search {
    flex-basis: 100%;
  }
  .side-stack {
    grid-template-columns: 1fr;
  }
  .side-stack > section:first-child {
    grid-column: auto;
  }
  .payment {
    grid-template-columns: 43px minmax(0, 1fr) auto;
  }
  .payment > div:nth-child(2) {
    min-width: 0;
  }
  .payment-actions {
    grid-column: 2 / -1;
    justify-content: flex-end;
  }
  .month-view {
    grid-template-columns: repeat(7, minmax(58px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .modal-backdrop {
    padding: 12px;
    align-items: end;
  }
  .modal {
    width: 100%;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 18px;
    border-radius: 18px;
  }
  .form-actions {
    position: sticky;
    bottom: -18px;
    margin: 18px -18px -18px;
    padding: 12px 18px;
    background: var(--modal);
    border-top: 1px solid var(--line);
  }
  .account-row strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .account-row span:last-child {
    white-space: nowrap;
  }
}
@media (max-width: 460px) {
  .topbar {
    display: grid;
    grid-template-columns: 1fr auto;
  }
  .top-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
  }
  .top-actions .ghost {
    flex: 1;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .stats .stat:first-child {
    grid-column: auto;
  }
  .stat {
    min-height: 124px;
  }
  .stat:first-child {
    padding-right: 126px;
  }
  .commitment-progress {
    right: 14px;
    min-width: 96px;
  }
  .stat-value {
    font-size: 26px;
  }
  .hero-actions {
    flex-direction: column;
  }
  .hero-actions > * {
    width: 100%;
  }
  .hero .primary {
    width: 100%;
  }
  .section-head .ghost {
    padding: 8px 10px;
  }
  .legend {
    gap: 8px;
    flex-wrap: wrap;
  }
  .mini-line {
    grid-template-columns: minmax(82px, 1fr) minmax(50px, 1.2fr) 48px;
  }
  .payment {
    padding: 11px 10px;
  }
  .payment-meta {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .account-row {
    gap: 7px;
    padding: 9px;
  }
  .account-row span:last-child {
    font-size: 11px;
  }
  .payment-choice {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .payment-choice small {
    grid-column: 2;
  }
}
/* Final schedule and account-manager alignment overrides. */
#accountManager .account-row {
  align-items: center;
}
#accountManager .account-row strong {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}
#accountManager .account-row > span:not(.account-swatch) {
  margin-left: auto !important;
  white-space: nowrap;
}
#manageAccounts {
  width: auto;
  padding: 13px 18px;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
#toggleView {
  display: grid;
  place-items: center;
  padding: 0;
}
#toggleView svg {
  width: 16px;
  height: 16px;
}
.timeline.month-view {
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  width: 100%;
  max-width: 100%;
}
.timeline.month-view > * {
  min-width: 0;
}
/* Keep each calendar date square; payment names use the available space instead of resizing a row. */
.timeline.month-view .day-cell {
  aspect-ratio: 1;
  min-height: 0;
  height: auto;
  overflow-y: auto;
  scrollbar-width: thin;
}
.timeline.month-view .day-payment {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  overflow-wrap: anywhere;
  line-height: 1.2;
}
.material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}
.payment {
  position: relative;
}
.reminder-bell {
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
}
.payment > .reminder-bell {
  position: absolute;
  top: 25px;
  left: -10px;
  z-index: 1;
}
.day-payment .reminder-bell {
  margin-right: 3px;
}
.auto-pay-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}
.auto-pay-toggle input {
  width: auto;
  accent-color: var(--accent);
}
.payment.is-paid {
  opacity: 0.62;
}
.completion-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  color: #55bd83;
  vertical-align: -3px;
  cursor: help;
}
.completion-mark .material-symbols-outlined {
  font-size: 16px;
}
.remaining-count {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.payment-actions button.paid-toggle {
  width: auto;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 800;
}
.payment-actions button.paid-toggle[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.loading-state {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}
.loading-state::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.app-loading {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--paper) 76%, transparent);
  backdrop-filter: blur(10px);
  transition:
    opacity 0.2s,
    visibility 0.2s;
}
.app-loading[hidden] {
  display: grid;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.app-loading-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: min(280px, 100%);
  padding: 26px 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  box-shadow: var(--shadow);
  text-align: center;
}
.app-loading-card .custom-logo-mark {
  flex-basis: 56px;
  width: 56px;
  height: 56px;
  border-radius: 16px;
}
.auth-card .custom-logo-mark {
  flex-basis: 72px;
  width: 72px;
  height: 72px;
  border-radius: 20px;
}
.app-loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
.app-loading-copy {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
@media (prefers-reduced-motion: reduce) {
  .app-loading {
    transition: none;
  }
}
/* Keep shared surfaces and brand treatments on the active theme. */
.toast-item {
  background: var(--modal);
}
.brand-mark,
.primary,
.avatar,
.stat:first-child {
  background: var(--gradient);
}
.brand-mark {
  color: #fff;
  box-shadow: 5px 5px 0 var(--accent-deep);
}
.custom-logo-mark {
  background: transparent;
  box-shadow: none;
}
.primary {
  color: #fff;
  box-shadow: 0 5px 0 var(--accent-deep);
}
.stat:first-child {
  border-color: var(--accent);
}
.avatar {
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 12px var(--accent-soft);
}
.account-marker {
  background: var(--account-color, var(--neo));
}
.day-payment.account-colored {
  border-left: 3px solid var(--account-color, var(--accent));
}
.mini-fill.account-colored {
  background: var(--account-color, var(--accent));
}
.auto-pay-indicator {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 5px;
  color: var(--accent);
  vertical-align: -4px;
}
.auto-pay-indicator svg {
  width: 16px;
  height: 16px;
}
.progress-item {
  display: block;
}
.progress-icon {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .side-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  .side-stack > section:first-child {
    grid-column: span 2;
  }
  .side-stack > section:nth-child(2) {
    order: 3;
  }
  .side-stack > section:nth-child(3) {
    order: 2;
  }
}
@media (max-width: 640px) {
  /* The tablet rule above must not squeeze the sidebar cards on phones. */
  .side-stack {
    grid-template-columns: 1fr;
  }
  .side-stack > section:first-child {
    grid-column: auto;
  }
  .insight-tabs {
    flex-wrap: wrap;
  }
  .month-view {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    padding-bottom: 0;
    gap: 2px;
  }
  .month-view .day-cell {
    min-width: 0;
    min-height: 58px;
    padding: 3px;
  }
  .month-view .weekday {
    padding: 2px 0;
    font-size: 10px;
  }
  .month-view .day-payment {
    margin-top: 3px;
    padding: 2px;
    font-size: 8px;
  }
}
@media (max-width: 640px) {
  .timeline.month-view .day-cell {
    min-height: 0;
  }
}
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #07100fc7;
  backdrop-filter: blur(14px);
}
.auth-gate[hidden] {
  display: none;
}
.auth-card {
  width: min(390px, 100%);
  padding: 28px;
  text-align: center;
  background: var(--modal);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 80px #0008;
}
.auth-card .brand-mark {
  margin: 0 auto 18px;
}
.auth-card h2 {
  margin-bottom: 8px;
}
.auth-card p {
  margin: 0 0 20px;
  color: var(--muted);
}
.auth-card .primary {
  width: 100%;
}
.auth-message {
  min-height: 20px;
  margin-top: 14px !important;
  color: var(--coral) !important;
  font-size: 13px;
}
.account-menu {
  position: relative;
}
.avatar {
  cursor: pointer;
  user-select: none;
  padding: 0;
}
.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 5;
  width: min(280px, calc(100vw - 28px));
  padding: 14px;
  background: var(--modal);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 50px #0008;
}
.user-menu[hidden] {
  display: none;
}
.user-details {
  padding: 2px 2px 12px;
  border-bottom: 1px solid var(--line);
}
.user-details strong,
.user-details small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-details small {
  margin-top: 3px;
  color: var(--muted);
}
.user-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 2px;
}
.user-menu-row span {
  font-size: 13px;
  font-weight: 800;
}
.user-signout {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--today);
  background: transparent;
  font-weight: 800;
}
.user-signout:hover,
.user-signout:focus-visible {
  border-color: var(--today);
  background: var(--today-soft);
  outline: none;
}

/* Responsive containment: keep intrinsic content from widening dashboard columns. */
.hero > div,
.section-head > div,
.payment > div,
.payment-name,
.payment-meta,
.amount,
.legend > span,
.history-current,
.mini-line > * {
  min-width: 0;
}
.payment-name,
.payment-meta,
.reminder-name,
.mini-line > span:first-child {
  overflow-wrap: anywhere;
}
.payment-meta {
  flex-wrap: wrap;
}
.payment-actions {
  min-width: 0;
  flex-wrap: wrap;
}
.payment-choice span,
.payment-choice small {
  min-width: 0;
  overflow-wrap: anywhere;
}
.legend {
  min-width: 0;
}

@media (max-width: 640px) {
  .section-head h2 {
    overflow-wrap: anywhere;
  }
  .legend {
    align-items: flex-start;
  }
  .history-current {
    max-width: 100%;
    text-align: right;
  }
  .form-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 380px) {
  .payment {
    grid-template-columns: 39px minmax(0, 1fr);
  }
  .payment > .amount {
    grid-column: 2;
    text-align: left;
  }
  .payment-actions {
    grid-column: 2;
    justify-content: flex-start;
  }
  .stat:first-child {
    padding-right: 112px;
  }
  .commitment-progress {
    right: 10px;
    min-width: 86px;
  }
}
