:root {
  color-scheme: light;
  --ink: #13213a;
  --muted: #667085;
  --line: #e5e9f0;
  --surface: #fff;
  --bg: #f3f6fa;
  --purple: #6d3be8;
  --green: #16845b;
  --green-bg: #eaf8f1;
  --red: #bd2c3b;
  --red-bg: #fff0f1;
  --yellow: #9a6700;
  --yellow-bg: #fff8dd;
  --blue: #2367c9;
  --blue-bg: #edf4ff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.45 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px max(24px, calc((100vw - 1180px) / 2));
  background: #14213d;
  color: #fff;
}
.topbar h1 {
  margin: 2px 0 0;
  font-size: 22px;
}
.top-actions {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 13px;
  color: #d6deef;
}
.top-actions a {
  color: #fff;
}
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 22px 60px;
}
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topbar .eyebrow {
  color: #aebbd3;
}
.notice {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px 18px;
  border: 1px solid #f3ce73;
  border-radius: 12px;
  background: #fff7dc;
}
.notice span {
  flex: 1;
}
.notice a,
.period-nav a,
.top-actions a {
  font-weight: 650;
  text-decoration: none;
}
.period-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.period-nav > a:last-child {
  text-align: right;
}
.period-nav div {
  text-align: center;
}
.period-nav span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.period-nav strong {
  font-size: 17px;
}
.jump-current {
  display: block;
  margin-top: 3px;
  font-size: 12px;
}
.month-nav {
  display: flex;
  gap: 14px;
}
.month-nav a {
  color: var(--purple);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.hero {
  padding: 28px;
  border-radius: 18px;
  color: #fff;
  box-shadow: 0 8px 28px rgba(25, 40, 70, 0.12);
}
.hero.needs-transfer {
  background: linear-gradient(135deg, #5d32d4, #7c48ec);
}
.hero.safe {
  background: linear-gradient(135deg, #117457, #1b9870);
}
.hero .eyebrow {
  color: #e7ddff;
}
.transfer {
  margin: 4px 0;
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.hero p {
  margin: 0 0 24px;
  color: #f0ecff;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.metrics div {
  padding: 13px 15px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.13);
}
.metrics span {
  display: block;
  font-size: 12px;
  opacity: 0.85;
}
.metrics strong {
  font-size: 18px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 3px 14px rgba(30, 45, 70, 0.04);
}
.card.full {
  margin-top: 18px;
}
#scheduled-bills {
  scroll-margin-top: 18px;
}
.checklist-totals {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  padding: 10px 8px;
  border-block: 1px solid var(--line);
  color: var(--muted);
}
.checklist-totals strong {
  margin-left: 6px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.card-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 14px;
}
.card h2 {
  margin: 2px 0 0;
  font-size: 19px;
}
.preview-total {
  font-size: 20px;
}
.item {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 11px 8px;
  border-top: 1px solid var(--line);
}
.item:first-child {
  border-top: 0;
}
#scheduled-bills .pay-period-band-0 {
  background: transparent;
}
#scheduled-bills .pay-period-band-1 {
  background: rgba(44, 123, 229, 0.07);
}
.status-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  font-weight: 800;
}
.item-main small {
  display: block;
  color: var(--muted);
}
.item-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.status-paid .status-icon {
  background: var(--green-bg);
  color: var(--green);
}
.status-posted .status-icon {
  background: var(--blue-bg);
  color: var(--blue);
}
.status-ready .status-icon {
  background: var(--yellow-bg);
  color: var(--yellow);
}
.status-waiting .status-icon {
  background: #f0f2f5;
  color: #667085;
}
.status-overdue .status-icon {
  background: var(--red-bg);
  color: var(--red);
}
.status-paid {
  background: linear-gradient(90deg, var(--green-bg), transparent 55%);
}
.empty {
  color: var(--muted);
}
.changes ul {
  margin-bottom: 0;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}
.login-card {
  width: min(420px, 100%);
  padding: 38px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 15px 45px rgba(25, 40, 70, 0.12);
}
.login-card h1 {
  margin: 12px 0 8px;
}
.login-card p {
  color: var(--muted);
}
.mark {
  display: grid;
  width: 50px;
  height: 50px;
  margin: auto;
  place-items: center;
  border-radius: 14px;
  background: var(--purple);
  color: #fff;
  font-size: 26px;
  font-weight: 800;
}
.button {
  display: block;
  margin-top: 24px;
  padding: 12px 18px;
  border-radius: 9px;
  background: var(--purple);
  color: #fff;
  font-weight: 750;
  text-decoration: none;
}
.error {
  padding: 12px;
  border-radius: 8px;
  background: var(--red-bg) !important;
  color: var(--red) !important;
}
.status-upcoming .status-icon {
  background: var(--blue-bg);
  color: var(--blue);
}
.autopay-icon {
  display: inline-grid;
  width: 20px;
  height: 20px;
  margin-left: 6px;
  place-items: center;
  border-radius: 50%;
  background: #e8f7f7;
  color: #087f8c;
  font-size: 14px;
  font-weight: 800;
  vertical-align: -2px;
  cursor: help;
}
.float-icon {
  display: inline-grid;
  width: 20px;
  height: 20px;
  margin-left: 6px;
  place-items: center;
  border-radius: 50%;
  background: #f0ebff;
  color: var(--purple);
  font-size: 14px;
  vertical-align: -2px;
  cursor: help;
}
.hero-warning {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(91, 15, 24, 0.35);
  font-weight: 700;
}
.account-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.account-strip div {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.account-strip span,
.account-strip small {
  color: var(--muted);
}
.account-strip strong {
  font-size: 22px;
}
.period-totals {
  font-size: 18px;
  font-weight: 800;
}
.bill-total {
  text-align: right;
}
.bill-total span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.bill-total strong {
  font-size: 20px;
}
.settings-page form {
  display: block;
}
.settings-card label > span,
.rule-row label > span {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}
.setting-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.setting-fields label small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}
.setting-fields .checkbox {
  grid-column: 1 / -1;
}
input[type="text"], input[type="number"], input:not([type]) {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd3df;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.input-prefix {
  display: flex;
  align-items: center;
  border: 1px solid #cbd3df;
  border-radius: 8px;
  background: #fff;
}
.input-prefix > span {
  padding-left: 12px;
  color: var(--muted);
}
.input-prefix input {
  border: 0;
}
.checkbox {
  display: flex;
  gap: 9px;
  align-items: center;
}
.checkbox input {
  width: 18px;
  height: 18px;
}
.checkbox > span {
  margin: 0 !important;
}
.settings-help {
  color: var(--muted);
}
.rule-row {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(140px, 1fr) auto auto;
  gap: 14px;
  align-items: end;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.rule-check {
  min-height: 42px;
}
.secondary-button, .remove-rule {
  padding: 9px 12px;
  border: 1px solid #cbd3df;
  border-radius: 8px;
  background: #fff;
  color: var(--purple);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.remove-rule {
  min-height: 42px;
  color: var(--red);
}
.settings-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
}
.settings-actions .button {
  margin: 0;
  border: 0;
  cursor: pointer;
}
.settings-actions a {
  color: var(--muted);
}
.saved-notice {
  border-color: #93d5b8;
  background: var(--green-bg);
}
@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
  }
  .top-actions span {
    display: none;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: 1fr;
  }
  .transfer {
    font-size: 42px;
  }
  .period-nav {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
  }
  .notice {
    align-items: flex-start;
    flex-direction: column;
  }
  .checklist-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .month-nav {
    width: 100%;
    justify-content: space-between;
  }
  .item {
    grid-template-columns: 28px 1fr;
  }
  .item-amount {
    grid-column: 2;
  }
  .topbar {
    padding: 18px;
  }
  .page {
    padding: 18px 12px 40px;
  }
  .setting-fields, .rule-row {
    grid-template-columns: 1fr;
  }
  .rule-check, .remove-rule {
    min-height: auto;
  }
}
