/* Bank's capital — self-contained styling for the calculator page (same tokens as demo.css). */

:root {
  /* KreditChain brand specification v1.0, unaltered.
     Blockchain Blue #0070C0 · AI Teal #00C0A0 · Institutional Navy #0C2040.
     AI Teal is 2.3:1 on white and must never carry text — use --teal-ink. */
  --ink:      #0C2040;
  --ink-2:    #2A3E5C;
  --ink-3:    #5C728E;   /* 4.7:1 on white — it labels 12px text */
  --blue:     #0070C0;
  --blue-ink: #005A9A;
  --teal:     #00C0A0;
  --teal-ink: #00806B;
  --tint:     #E6F1FA;
  --tint-2:   #F4F9FD;
  --line:     #DCE5ED;
  --line-2:   #C3D1DE;
  --bg:       #F7F9FB;
  --surface:  #FFFFFF;
  --good:     #00806B;
  --bad:      #A8452C;
  --warn:     #8A6A1F;
  /* the navy band at the top, and the three token colours */
  --band:         var(--ink);
  --band-fg:      #FFFFFF;
  --band-mute:    #BCCFE4;
  --band-eyebrow: #93AEC9;
  --held:   var(--ink);
  --senior: #CFE4F5;
  --equity: var(--blue);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: Inter, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: Montserrat, Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

/* --- the band: title and the live headline ---------------------------- */
.band { background: var(--band); color: var(--band-fg); padding: 26px 0 28px; }
.band-in { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: end; }
.eyebrow {
  font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--band-eyebrow); font-weight: 600; margin: 0 0 8px;
}
.band h1 {
  font-family: var(--display); font-size: 27px; font-weight: 700;
  letter-spacing: -0.2px; margin: 0 0 8px; text-wrap: balance;
}
.band p { margin: 0; color: var(--band-mute); font-size: 14px; max-width: 64ch; }
.headline .hl {
  font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: -0.6px;
  line-height: 1.1; font-variant-numeric: tabular-nums; margin: 0;
}
.headline .hl.bad { color: #E2947E; }
.headline .hs { color: var(--band-mute); font-size: 13.5px; margin-top: 6px; }
@media (min-width: 901px) { .headline { text-align: right; } }
@media (max-width: 900px) { .band-in { grid-template-columns: 1fr; } }

/* --- layout ----------------------------------------------------------- */
main { padding: 26px 0 70px; }
.cols { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 18px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 20px 20px; min-width: 0;
}
.card h2 {
  margin: 0 0 3px; font-size: 11px; letter-spacing: 1.3px; text-transform: uppercase;
  color: var(--ink-3); font-weight: 650;
}
.card p { margin: 6px 0; color: var(--ink-2); font-size: 13.5px; }

/* --- inputs ----------------------------------------------------------- */
.fields { display: grid; gap: 12px; margin-top: 10px; }
.field { display: grid; gap: 4px; }
.field label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field .in {
  display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 7px;
  background: var(--surface); overflow: hidden;
}
.field .in:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 112, 192, .22); }
.field input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 15px; padding: 7px 10px; font-variant-numeric: tabular-nums; outline: none;
}
.field .unit {
  padding: 0 10px; font-size: 12px; color: var(--ink-3); border-left: 1px solid var(--line);
  align-self: stretch; display: flex; align-items: center; background: var(--tint-2); white-space: nowrap;
}
.field .unit:first-child { border-left: 0; border-right: 1px solid var(--line); }
.field .hint { font-size: 11.5px; color: var(--ink-3); }
.field .hint.warn { color: var(--warn); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.of { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; color: var(--ink-3); font-size: 13px; }
.reset {
  margin-top: 14px; width: 100%; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 7px;
  background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13px; cursor: pointer;
}
.reset:hover { border-color: var(--blue); color: var(--blue); }
.reset:focus-visible, .field input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* --- the token strip -------------------------------------------------- */
.strip { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.tok {
  width: 54px; height: 54px; border-radius: 6px; overflow: hidden; display: flex; flex-direction: column;
  border: 1px solid var(--line-2); font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.tok .eq { background: var(--equity); color: #fff; display: flex; align-items: center; justify-content: center; }
.tok .sr { background: var(--senior); color: var(--ink); flex: 1; display: flex; align-items: center; justify-content: center; }
.tok.held { background: var(--held); color: #fff; align-items: center; justify-content: center; }
.key { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }
.key span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid var(--line-2); flex: none; }

/* --- the three steps -------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px 18px; min-width: 0;
}
.step .n { font-family: var(--display); font-size: 12px; font-weight: 700; color: var(--blue); letter-spacing: .4px; }
.step h3 { margin: 4px 0 8px; font-size: 14px; font-weight: 650; }
.step .big {
  font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -0.4px;
  font-variant-numeric: tabular-nums; line-height: 1.15; overflow-wrap: anywhere;
}
.step .big .arrow { color: var(--ink-3); font-weight: 400; margin: 0 4px; }
.step .detail { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.step .detail b { color: var(--ink); }
.step .detail .warn { color: var(--warn); }

/* --- before and after ------------------------------------------------- */
.tablewrap { overflow-x: auto; margin-top: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td {
  text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
th:first-child, td:first-child { text-align: left; color: var(--ink-2); white-space: normal; }
th { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-3); font-weight: 650; }
tr.tot td { font-weight: 650; border-bottom: 0; }
tr.tot td:first-child { color: var(--ink); }
td.delta { color: var(--good); }
td.delta.neg { color: var(--bad); }

/* --- what could change it --------------------------------------------- */
.sens { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
@media (max-width: 760px) { .sens { grid-template-columns: 1fr; } }
.sens .fig { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.4px; font-variant-numeric: tabular-nums; }
.sens .lab { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }

/* --- assumptions and basis -------------------------------------------- */
.assume { display: grid; gap: 6px; margin: 8px 0 0; padding: 0 0 0 18px; color: var(--ink-2); font-size: 13.5px; }
.basis { font-size: 12px; color: var(--ink-3); margin-top: 12px; }
