.loan-shell {
  max-width: min(1080px, calc(100% - 32px));
  margin: 24px auto 56px;
  padding: 0;
  color: #0f172a;
}

.loan-page-head {
  margin-bottom: 16px;
}

.loan-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #6b737c;
  margin-bottom: 8px;
}

.loan-breadcrumbs a {
  color: #6b737c;
  text-decoration: none;
}

.loan-breadcrumbs a:hover,
.loan-breadcrumbs a:focus-visible {
  color: #2f6fdf;
  text-decoration: underline;
}

.loan-page-head h1 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #101828;
}

.loan-intro {
  margin: 0;
  max-width: 100%;
  color: #374151;
  font-size: 15px;
  line-height: 1.55;
}

.loan-inputs > h1 {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #101828;
}

.loan-inputs > .loan-intro {
  margin: 0 0 12px;
}

.loan-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.loan-card {
  background: #ffffff;
  border: 1px solid rgba(20, 24, 30, 0.1);
  border-radius: 14px;
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
  padding: 18px;
}

.loan-shell > .loan-card + .loan-card {
  margin-top: 16px;
}

.loan-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.loan-grid label {
  display: grid;
  gap: 5px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.loan-affix-input {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: stretch;
  border: 1px solid #c8d3e7;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}

.loan-affix-input-suffix {
  grid-template-columns: 1fr auto;
}

.loan-select-input {
  grid-template-columns: 1fr;
}

.loan-affix-input input,
.loan-affix-input select {
  border: 0;
  border-radius: 0;
  background: transparent;
  min-height: 40px;
  min-width: 0;
  width: 100%;
  font-size: 15px;
  padding: 0 10px;
  color: #111827;
}

.loan-select-input select {
  -webkit-appearance: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--rp-select-chevron-color, #334155) 50%),
    linear-gradient(135deg, var(--rp-select-chevron-color, #334155) 50%, transparent 50%);
  background-repeat: no-repeat;
  background-position:
    calc(100% - var(--rp-select-chevron-right, 18px)) 50%,
    calc(100% - var(--rp-select-chevron-right-inner, 13px)) 50%;
  background-size:
    var(--rp-select-chevron-size, 5px) var(--rp-select-chevron-size, 5px),
    var(--rp-select-chevron-size, 5px) var(--rp-select-chevron-size, 5px);
  padding-right: var(--rp-select-padding-right, 36px);
}

.loan-affix-input:focus-within {
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
  border-color: #2f6fdf;
}

.loan-affix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 34px;
  padding: 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #0f2454;
  border-left: 1px solid #bcc8df;
  background: #f4f7fd;
  white-space: nowrap;
}

.loan-affix-prefix {
  border-left: 0;
  border-right: 1px solid #bcc8df;
}

.loan-affix-suffix {
  min-width: 0;
  width: auto;
  padding: 0 10px;
}

.loan-validation {
  margin: 10px 0 0;
  min-height: 20px;
  font-size: 13px;
  color: #b91c1c;
  font-weight: 600;
}

.loan-results h2,
.loan-chart-card h2,
.loan-schedule-card h2,
.loan-reference h2 {
  margin: 0 0 12px;
  color: #101828;
}

.loan-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.loan-kpis article {
  border: 1px solid #dbe5f4;
  border-radius: 12px;
  background: #ffffff;
  padding: 10px 12px;
}

.loan-kpis h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #667085;
}

.loan-kpis p {
  margin: 6px 0 0;
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
  color: #101828;
}

.loan-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.loan-chart-modes {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.loan-chart-mode {
  border: 1px solid #c8d3e7;
  background: #ffffff;
  color: #334155;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.loan-chart-mode.is-active {
  border-color: #2f6fdf;
  background: #e8efff;
  color: #0f2454;
}

.loan-chart-wrap {
  position: relative;
  background: #ffffff;
  border: 1px solid #d6deee;
  border-radius: 14px;
  padding: 8px;
}

#loan-chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  cursor: crosshair;
}

.loan-axis {
  stroke: #94a3b8;
  stroke-width: 1.1;
}

.loan-grid-line {
  stroke: #e2e8f0;
  stroke-width: 1;
}

.loan-axis-text {
  fill: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.loan-area {
  pointer-events: none;
}

.loan-line {
  fill: none;
  stroke-width: 2.4;
}

.loan-dot {
  fill: #2f6fdf;
  stroke: #ffffff;
  stroke-width: 1.8;
  cursor: pointer;
}

.loan-chart-tooltip {
  position: absolute;
  transform: none;
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 5;
}

.loan-table-wrap {
  margin-top: 12px;
  border: 1px solid #dbe5f4;
  background: #ffffff;
  border-radius: 10px;
  padding: 10px 12px;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.loan-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 680px;
}

.loan-table th,
.loan-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
  white-space: nowrap;
}

.loan-table th.loan-col-principal,
.loan-table td.loan-col-principal,
.loan-table th.loan-col-interest,
.loan-table td.loan-col-interest,
.loan-table th.loan-col-remaining,
.loan-table td.loan-col-remaining,
.loan-table th.loan-col-mobile-switch,
.loan-table td.loan-col-mobile-switch {
  padding-left: 22px;
}

.loan-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
}

.loan-col-month {
  width: 16%;
}

.loan-col-principal,
.loan-col-interest,
.loan-col-remaining,
.loan-col-mobile-switch {
  width: 28%;
}

.loan-col-mobile-switch {
  display: none;
}

.loan-table-mobile-nav {
  display: none;
}

.loan-links {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.loan-links a {
  color: #1f4bc9;
}

.loan-reference {
  margin-top: 16px;
  background: #ffffff;
  border: 1px solid rgba(20, 24, 30, 0.08);
  border-radius: 12px;
  padding: 20px;
}

.loan-reference h2 {
  margin: 16px 0 8px;
  font-size: 22px;
  line-height: 1.3;
  color: #101828;
}

.loan-reference h3 {
  margin: 14px 0 6px;
  font-size: 18px;
  line-height: 1.35;
  color: #1f2937;
}

.loan-reference h2:first-child {
  margin-top: 0;
}

.loan-reference p {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: #374151;
}

.loan-reference li {
  margin: 0;
  margin-left: 15px;
  font-size: 15px;
  line-height: 1.65;
  color: #374151;
}

.loan-reference ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.loan-reference a {
  color: #2f6fdf;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.loan-reference a:hover,
.loan-reference a:focus-visible {
  color: #1f5cc9;
}

.loan-faq {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.loan-faq-item {
  border: 1px solid #d4d9e1;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

.loan-faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.loan-faq-item summary::-webkit-details-marker {
  display: none;
}

.loan-faq-item summary::before {
  content: "\25B6";
  font-size: 11px;
  color: #334155;
  transform: translateY(-1px);
  transition: transform 0.15s ease;
}

.loan-faq-item[open] summary::before {
  transform: rotate(90deg) translateX(1px);
}

.loan-faq-item > p {
  margin: 0;
  padding: 0 14px 14px 34px;
  font-size: 15px;
  line-height: 1.65;
  color: #374151;
}

.loan-faq-item > .loan-links {
  margin: 0;
  padding: 0 14px 14px 52px;
  display: grid;
  gap: 8px;
}

.loan-faq-item > .loan-links > li {
  margin: 0;
  margin-left: 15px;
  line-height: 1.65;
}

.loan-faq-item > p + .loan-links {
  margin-top: -2px;
}

@media (max-width: 980px) {
  .loan-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .loan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .loan-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .loan-shell {
    width: min(1080px, calc(100% - 20px));
    margin: 16px auto 40px;
    padding: 0;
  }

  .loan-grid {
    grid-template-columns: 1fr;
  }

  .loan-kpis {
    grid-template-columns: 1fr;
  }

  .loan-reference {
    padding: 14px;
  }

  .loan-table-wrap {
    padding: 9px 10px;
    touch-action: pan-y;
    overflow-x: visible;
  }

  .loan-table {
    min-width: 0;
  }

  .loan-col-month {
    width: 22%;
  }

  .loan-col-desktop-md,
  .loan-col-desktop-lg,
  .loan-col-remaining {
    display: none;
  }

  .loan-col-mobile-switch {
    display: table-cell;
    width: 78%;
  }

  .loan-table th.loan-col-mobile-switch,
  .loan-table td.loan-col-mobile-switch {
    padding-left: 35px;
  }

  .loan-table-mobile-nav {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
  }

  .loan-table-mobile-dots {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 2px;
  }

  .loan-table-mobile-dot {
    appearance: none;
    -webkit-appearance: none;
    width: 7px;
    min-width: 7px;
    height: 7px;
    min-height: 7px;
    padding: 0;
    border-radius: 50%;
    border: 0;
    background: #d4ddec;
    opacity: 0.9;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
  }

  .loan-table-mobile-dot.is-active {
    background: #2f6fdf;
    opacity: 1;
    transform: scale(1.1);
  }

  .loan-col-mobile-switch {
    transition: opacity 0.18s ease;
  }

  .loan-mobile-value {
    display: inline-block;
    width: 100%;
    will-change: transform, opacity;
  }
}
