/* Screen: bank (overlay) — what you owe and what it costs a day (left), pay back and borrow (right).
   Debt is shown in calm slate, never red. One column on tablets in portrait and phones. */

.screen--bank {
  gap: var(--sp-4);
}

.screen--bank.is-rerender,
.screen--bank .mate.is-still {
  animation: none;
}

.screen--bank .mate {
  max-width: 640px;
}

/* ── Header ────────────────────────────────────────────── */
.bk-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.bk-head__sub {
  margin-top: var(--sp-1);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--ink-soft);
}

/* ── Emergency notice (pay-back-only mode) ─────────────── */
.bk-notice {
  display: flex;
  align-items: center;
  gap: var(--sp-3) var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  border: 2px solid var(--sand-400);
  background: var(--sand-100);
  box-shadow: var(--shadow-1);
}

.bk-notice__icon {
  font-size: 2.2rem;
  line-height: 1;
}

.bk-notice__title {
  font-weight: 900;
  font-size: var(--fs-md);
}

/* ── Layout ────────────────────────────────────────────── */
.bk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-4) var(--sp-5);
  align-items: start;
}

.bk-col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  min-width: 0;
}

@media (max-width: 53.75em) {
  .bk-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* One column: what you owe, pay back, borrow, then how it works. */
  .bk-col {
    display: contents;
  }

  .bk-owe { order: 1; }
  .bk-repay { order: 2; }
  .bk-borrow { order: 3; }
  .bk-how { order: 4; }
}

/* ── Cards ─────────────────────────────────────────────── */
.bk-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid rgba(13, 48, 71, 0.06);
  box-shadow: var(--shadow-2);
}

.bk-card__title {
  font-size: var(--fs-lg);
}

/* What you owe */
.bk-owe__big {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.bk-owe__label {
  font-weight: 800;
  color: var(--ink-faint);
}

.bk-owe__amount {
  font-size: var(--fs-3xl);
  font-weight: 900;
  color: var(--loss);
}

.bk-owe.is-free .bk-owe__amount {
  color: var(--gain);
}

.bk-owe__daily {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: 0 !important;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--loss-bg);
  border: 2px solid var(--line);
  font-size: var(--fs-md);
  font-weight: 900;
}

.bk-owe__clock {
  font-size: 1.6rem;
  line-height: 1;
}

.bk-owe__note {
  margin: 0 !important;
}

.bk-owe__free {
  font-weight: 800;
  color: var(--gain);
}

.bk-loans {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.bk-loan {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  border: 2px solid var(--line);
  background: var(--sea-50);
}

.bk-loan.is-emergency {
  border-color: var(--sand-400);
  background: var(--sand-50);
}

.bk-loan__icon {
  font-size: 1.5rem;
  line-height: 1;
}

.bk-loan__body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-1) var(--sp-3);
  flex: 1 1 auto;
}

.bk-loan__amount {
  font-weight: 900;
  font-size: var(--fs-md);
}

.bk-loan__cost {
  font-weight: 800;
  color: var(--ink-soft);
}

.bk-tag {
  padding: 0.1em 0.6em;
  border-radius: var(--r-pill);
  background: var(--sand-200);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 800;
}

/* How a loan works */
.bk-how {
  background: var(--sea-50);
  box-shadow: var(--shadow-1);
}

.bk-steps {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.bk-steps li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-weight: 700;
}

.bk-steps__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--line);
  font-size: 1.2rem;
}

/* Borrow and pay back */
.bk-limit {
  font-weight: 700;
}

.bk-limit strong {
  font-size: var(--fs-md);
}

.bk-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: var(--sp-3);
}

.bk-buttons .btn {
  width: 100%;
  padding-inline: 0.9em;
  white-space: nowrap;
}

.bk-buttons .btn--primary {
  grid-column: 1 / -1;
}

.bk-none {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--loss-bg);
  font-weight: 800;
}

.bk-none p + p {
  margin-top: var(--sp-1);
}

.bk-borrow.is-later {
  background: var(--loss-bg);
  box-shadow: var(--shadow-1);
  font-weight: 700;
}

/* ── Closed bank ───────────────────────────────────────── */
.bk-closed {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  text-align: center;
  padding: var(--sp-6) var(--sp-5);
}

.bk-closed__icon {
  font-size: 64px;
  line-height: 1;
}

/* ── Footer ────────────────────────────────────────────── */
.bk-foot {
  display: flex;
  justify-content: center;
}

@media (max-width: 37.5em) {
  .bk-card {
    padding: var(--sp-4);
    border-radius: var(--r-md);
  }

  .bk-owe__amount {
    font-size: var(--fs-2xl);
  }

  .bk-notice {
    align-items: flex-start;
  }
}

/* ── Debt has a schedule (WS-D): the plan, coins, previews ── */
.bk-loan__note {
  flex: 1 1 100%;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-soft);
}

.bk-plan {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  margin-top: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  border: 2px solid var(--sea-200);
  background: var(--card);
}

.bk-plan__title {
  font-weight: 900;
  color: var(--sea-800);
}

.bk-plan__schedule {
  font-weight: 800;
}

.bk-plan__left,
.bk-plan__next {
  font-weight: 700;
  color: var(--ink-soft);
}

/* One coin per payment: the paid ones filled (a paid-back bar of coins). */
.bk-coins {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: var(--sp-1) 0;
}

.bk-coin {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px dashed var(--accent-400);
  background: var(--accent-100);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 900;
}

.bk-coin.is-paid {
  border: 3px solid var(--accent-600);
  background: var(--accent-500);
}

/* After a missed payment the parts gone by are slate (no ✓: the bank can't say which one was missed). */
.bk-coin.is-gone {
  border: 3px solid var(--loss);
  background: var(--line-strong);
}

.bk-plan__missed {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-soft);
}

.bk-preview__lead {
  font-weight: 800;
  color: var(--ink);
}

.bk-buttons--preview {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
}

.bk-borrow-opt {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-2);
  border-radius: var(--r-md);
  background: var(--sea-50);
  border: 2px solid var(--line);
}

.bk-preview {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-soft);
}

.bk-preview__pay {
  color: var(--ink);
  font-weight: 800;
}

.bk-preview__tight {
  color: var(--loss);
  font-weight: 800;
}

.bk-steps__more {
  font-weight: 700;
}

/* ── C4: loan choices ("Pay it back in:" 4 parts or 2) and the cut after a missed loan payment ── */
.bk-parts {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.bk-parts__title {
  font-weight: 900;
  font-size: var(--fs-md);
}

.bk-parts__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-2);
}

.bk-parts__opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  padding: var(--sp-2);
  border: 3px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--line);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.bk-parts__opt:hover {
  border-color: var(--sea-300);
}

.bk-parts__opt.is-on {
  border-color: var(--accent-500);
  background: var(--accent-100);
  box-shadow: 0 3px 0 var(--accent-600);
}

.bk-parts__label {
  font-weight: 900;
  font-size: var(--fs-md);
}

.bk-parts__sub {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-soft);
}

.bk-cut {
  border-color: var(--sea-300);
  background: var(--sea-50);
}
