.credit-card {
  grid-area: credit;
  --card-accent: #78a7ff;
}

.tracker-column {
  display: contents;
}

.credit-color {
  color: #9bbcff;
}

.credit-balance-editor {
  display: grid;
  gap: 12px;
  padding: 18px 20px 20px;
}

.credit-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.credit-setting-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.credit-setting-field > span:first-child {
  color: rgba(239, 245, 255, 0.78);
  font-size: 0.86rem;
  font-weight: 700;
}

.credit-billing-field {
  grid-column: 1 / -1;
}

.credit-balance-input-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(100%, 310px);
  padding: 11px 14px;
  border: 1px solid rgba(132, 169, 255, 0.3);
  border-radius: 14px;
  background: rgba(5, 14, 29, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.credit-balance-input-wrap:focus-within {
  border-color: rgba(122, 166, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(79, 128, 255, 0.13);
}

.credit-balance-input-wrap > span {
  color: #9bbcff;
  font-weight: 800;
}

#creditAmountInput,
#creditLimitInput {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #9bbcff;
  font: inherit;
  font-size: 1.06rem;
  font-weight: 800;
  text-align: left;
}

#creditAmountInput[readonly] {
  cursor: not-allowed;
  opacity: 0.78;
}

#creditBillingDay {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid rgba(132, 169, 255, 0.3);
  border-radius: 14px;
  outline: 0;
  background: rgba(5, 14, 29, 0.76);
  color: rgba(239, 245, 255, 0.94);
  color-scheme: dark;
  font: inherit;
  font-weight: 750;
  text-align: center;
}

#creditBillingDay:focus-visible {
  border-color: rgba(122, 166, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(79, 128, 255, 0.13);
}

.credit-auto-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: rgba(241, 246, 255, 0.92);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 700;
}

.credit-auto-option input,
.savings-withdraw-choice input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #6c91ff;
}

.credit-auto-add-option {
  margin-inline-start: 28px;
  color: rgba(220, 232, 249, 0.84);
  font-size: 0.86rem;
}

.credit-auto-add-option[hidden] {
  display: none !important;
}

.credit-saved-message {
  min-height: 1.25em;
  margin: -4px 0 0;
  color: #75e6b1;
  font-size: 0.86rem;
  font-weight: 800;
}

.credit-calculation-note {
  margin: -5px 0 0;
  color: rgba(219, 229, 245, 0.58);
  font-size: 0.78rem;
  line-height: 1.55;
}

.credit-utilization {
  display: grid;
  gap: 9px;
  margin-top: 5px;
}

.credit-progress-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.credit-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 220ms ease, background-color 220ms ease;
}

.credit-progress-fill.is-green { background: #86efac; }
.credit-progress-fill.is-yellow { background: #fde047; }
.credit-progress-fill.is-orange { background: #fb923c; }
.credit-progress-fill.is-red { background: #ef4444; }

.credit-available-text {
  margin: 0;
  color: rgba(226, 235, 249, 0.78);
  font-size: 0.88rem;
  line-height: 1.55;
}

.credit-history-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.credit-history-section[hidden] {
  display: none !important;
}

@media (min-width: 641px) {
  .tracker-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.14fr) minmax(0, 0.86fr);
    grid-template-areas: "primary secondary";
    align-items: stretch;
    column-gap: 32px;
    row-gap: 0;
  }

  .tracker-column {
    display: flex;
    position: relative;
    min-width: 0;
    flex-direction: column;
    gap: 26px;
  }

  .tracker-column-primary {
    grid-area: primary;
  }

  .tracker-column-secondary {
    grid-area: secondary;
  }

  .tracker-column > .finance-card {
    width: 100%;
    min-width: 0;
    min-height: 0;
    align-self: stretch;
    flex: 0 0 auto;
  }

  .tracker-column > .finance-card:hover {
    z-index: 1;
    transform: translateY(-2px) scale(1);
  }

  .tracker-column-primary > .variable-card,
  .tracker-column-secondary > .summary-card {
    flex: 1 1 auto;
  }
}

@media (max-width: 640px) {
  .tracker-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "income"
      "fixed"
      "variable"
      "savings"
      "checking"
      "credit"
      "summary";
  }
}

.savings-withdraw-button {
  width: 100%;
  margin-top: 14px;
  padding: 11px 16px;
  border: 1px solid rgba(98, 217, 177, 0.38);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(33, 134, 105, 0.26), rgba(23, 93, 122, 0.22));
  color: #8ce9c4;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.savings-withdraw-button:hover,
.savings-withdraw-button:focus-visible {
  border-color: rgba(117, 230, 177, 0.72);
  background: linear-gradient(135deg, rgba(33, 134, 105, 0.38), rgba(23, 93, 122, 0.3));
  outline: none;
  transform: translateY(-1px);
}

.savings-withdraw-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
}

.savings-withdraw-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 7, 17, 0.78);
  backdrop-filter: blur(10px);
}

.savings-withdraw-dialog {
  width: min(100%, 520px);
  max-height: min(88vh, 760px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid rgba(125, 159, 213, 0.27);
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(13, 27, 49, 0.99), rgba(6, 16, 31, 0.99));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  color: #f4f7ff;
}

.savings-withdraw-dialog h3 {
  margin: 0 0 8px;
  font-size: 1.24rem;
}

.savings-withdraw-dialog > p {
  margin: 0 0 18px;
  color: rgba(226, 235, 249, 0.7);
  line-height: 1.6;
}

.savings-withdraw-section {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.savings-withdraw-section > strong {
  font-size: 0.92rem;
}

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

.savings-withdraw-choice {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 45px;
  padding: 10px 12px;
  border: 1px solid rgba(126, 160, 216, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  font-weight: 700;
}

.savings-withdraw-field {
  display: grid;
  gap: 7px;
}

.savings-withdraw-field span {
  color: rgba(230, 237, 250, 0.72);
  font-size: 0.82rem;
  font-weight: 700;
}

.savings-withdraw-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid rgba(126, 160, 216, 0.28);
  border-radius: 11px;
  outline: 0;
  background: rgba(3, 12, 25, 0.78);
  color: #fff;
  font: inherit;
}

.savings-withdraw-field input:focus {
  border-color: rgba(110, 151, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(79, 128, 255, 0.12);
}

.savings-withdraw-field input[readonly] {
  cursor: not-allowed;
  color: #91edc8;
  background: rgba(38, 111, 88, 0.12);
}

.savings-withdraw-calculation,
.savings-withdraw-summary {
  display: grid;
  gap: 9px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(115, 149, 204, 0.2);
  border-radius: 14px;
  background: rgba(2, 10, 22, 0.48);
}

.savings-withdraw-calculation div,
.savings-withdraw-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.savings-withdraw-calculation b,
.savings-withdraw-summary b {
  color: #91edc8;
}

.savings-withdraw-error {
  min-height: 1.3em;
  margin: 10px 0 0;
  color: #ff9da8;
  font-size: 0.86rem;
  font-weight: 700;
}

.savings-withdraw-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.savings-withdraw-actions button {
  padding: 10px 15px;
  border-radius: 11px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.savings-withdraw-cancel,
.savings-withdraw-back {
  border: 1px solid rgba(148, 169, 204, 0.28);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(236, 242, 252, 0.82);
}

.savings-withdraw-next,
.savings-withdraw-confirm {
  border: 1px solid rgba(100, 221, 178, 0.42);
  background: linear-gradient(135deg, #2c9c76, #347ab4);
  color: #fff;
}

@media (max-width: 640px) {
  .credit-balance-editor {
    padding: 14px 12px 18px;
  }

  .credit-balance-input-wrap {
    width: 100%;
    box-sizing: border-box;
  }

  .credit-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .credit-billing-field {
    grid-column: auto;
  }

  .credit-progress-track {
    height: 11px;
  }

  .credit-auto-option {
    align-items: flex-start;
    line-height: 1.45;
  }

  .credit-auto-add-option {
    margin-inline-start: 0;
  }

  .savings-withdraw-dialog {
    max-height: 92vh;
    padding: 20px 16px;
    border-radius: 19px;
  }

  .savings-withdraw-choices {
    grid-template-columns: 1fr;
  }

  .savings-withdraw-actions {
    flex-direction: column-reverse;
  }

  .savings-withdraw-actions button {
    width: 100%;
  }
}
