.breadcrumbs { color: #566478; }
.field-note { color: #536174; }
.result-actions a.primary {
  color: #fff;
  background: #0869c7;
}
.result-actions a.primary:hover { background: #075fc7; }

.loan-section {
  margin: 0;
  padding: 0;
  border: 0;
}

.loan-section + .loan-section {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.loan-section legend {
  width: 100%;
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.new-loan legend { color: #0872dc; }

.payment-comparison { padding: 8px 0 4px; }
.comparison-bars { display: grid; gap: 15px; }
.comparison-bars > div {
  display: grid;
  grid-template-columns: 58px minmax(100px, auto);
  align-items: center;
  gap: 5px 14px;
}
.comparison-bars span { color: #aebccd; font-size: 12px; }
.comparison-bars strong { color: #fff; text-align: right; font-size: 16px; }
.comparison-bars i {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  display: block;
  overflow: hidden;
  background: rgba(255, 255, 255, .12);
}
.comparison-bars b {
  width: var(--bar, 0%);
  height: 100%;
  border-radius: inherit;
  display: block;
  background: var(--coral);
  transition: width .45s ease;
}
.comparison-bars > div:last-child b { background: var(--sky); }

.result-card.is-negative .result-value { color: #ff9a8f; }
.result-card.is-positive .result-value { color: #fff; }

.legend-current,
.legend-new {
  width: 18px;
  height: 3px;
  border-radius: 99px;
  display: inline-block;
  background: var(--coral);
}
.legend-new { background: var(--sky); }

.refi-chart-shell {
  position: relative;
  padding: 18px 18px 12px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fbfcfe;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s ease, transform .7s cubic-bezier(.22, 1, .36, 1);
}
.refi-chart-shell.is-visible { opacity: 1; transform: translateY(0); }
.refi-chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
#chartGrid line { stroke: rgba(9, 27, 54, .08); stroke-width: 1; }
#chartLabels text { fill: #68758a; font-size: 11px; }
.refi-line {
  fill: none;
  stroke: var(--coral);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: left center;
  opacity: .05;
  transform: scaleX(.02);
}
.refi-chart-shell.is-visible .refi-line {
  animation: refi-line-in .75s cubic-bezier(.22, 1, .36, 1) both;
}
.refi-line.proposed {
  stroke: var(--sky);
}
.refi-chart-shell.is-visible .refi-line.proposed {
  animation-delay: .08s;
}
.refi-cursor {
  stroke: #0b2d55;
  stroke-width: 1.4;
  stroke-dasharray: 4 4;
  pointer-events: none;
}
@keyframes refi-line-in {
  from { opacity: .05; transform: scaleX(.02); }
  to { opacity: 1; transform: scaleX(1); }
}

.refi-table { min-width: 940px; }
.refi-table th:first-child,
.refi-table td:first-child { text-align: center; }

.refi-table-note {
  max-width: 820px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.refi-conditions strong {
  font-size: 16px;
  line-height: 1.25;
}

.refi-saved-dialog {
  width: min(620px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 0;
  border-radius: 28px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 80px rgba(9, 27, 54, .28);
}
.refi-saved-dialog::backdrop { background: rgba(4, 9, 19, .72); backdrop-filter: blur(6px); }
.refi-saved-dialog > div { position: relative; padding: 30px; }
.refi-saved-dialog h2 { margin: 0 0 18px; font-size: 28px; }
#closeSavedDialog {
  position: absolute;
  top: 15px;
  right: 18px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 30px;
  cursor: pointer;
}
#savedList { display: grid; gap: 9px; }
#savedList article {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  background: #f6f8fb;
}
#savedList article > div { display: grid; gap: 3px; }
#savedList span { color: var(--muted); font-size: 11px; }
#savedList a,
#savedList button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #075fc7;
  background: #fff;
  font-size: 11px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
#savedList button { color: #b12e25; }

@media (max-width: 620px) {
  .loan-section + .loan-section { margin-top: 23px; padding-top: 22px; }
  .refi-chart-shell { padding: 12px 8px 10px; border-radius: 20px; }
  .refi-table { min-width: 0; }
  .refi-table tbody tr:not(.schedule-gap),
  .refi-table tfoot tr { grid-template-columns: 1fr 1fr; }
  .refi-table td:nth-child(1)::before { content: "Месяц №"; }
  .refi-table td:nth-child(2)::before { content: "Дата"; }
  .refi-table td:nth-child(3)::before { content: "Платёж сейчас"; }
  .refi-table td:nth-child(4)::before { content: "Новый платёж"; }
  .refi-table td:nth-child(5)::before { content: "Экономия"; }
  .refi-table td:nth-child(6)::before { content: "Остаток сейчас"; }
  .refi-table td:nth-child(7)::before { content: "Новый остаток"; }
  .refi-table tbody tr:not(.schedule-gap) td:nth-child(odd) { border-right: 1px solid rgba(9, 27, 54, .08); }
  .refi-table tfoot td:first-child { display: none; }
  .refi-table tfoot td:nth-child(2) { grid-column: 1 / -1; }
  #savedList article { grid-template-columns: 1fr 1fr; }
  #savedList article > div { grid-column: 1 / -1; }
  #saveButton,
  #savedButton,
  #printButton,
  #pdfButton { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .refi-chart-shell {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .refi-line,
  .comparison-bars b { animation: none !important; transition: none !important; }
  .refi-line { opacity: 1; transform: none; }
}

@media print {
  .program-back-to-calculator { display: none !important; }
}
