.lcc-calculator {
  --lcc-border: #d5d8de;
  --lcc-text: #3a3f47;
  --lcc-muted: #6b7280;
  --lcc-heading: #2f3540;
  --lcc-accent: #fb8500;
  --lcc-panel: #ffffff;
  --lcc-bg: #f7f8fa;
  --lcc-focus: #fb8500;
  box-sizing: border-box;
  color: var(--lcc-text);
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
  max-width: none;
  width: 100%;
}

.lcc-calculator *,
.lcc-calculator *::before,
.lcc-calculator *::after {
  box-sizing: border-box;
}

.lcc-panel {
  background: var(--lcc-panel);
  border: 1px solid var(--lcc-border);
  border-radius: 10px;
  overflow: hidden;
  width: 100%;
}

.lcc-panel-heading {
  align-items: center;
  border-bottom: 1px solid var(--lcc-border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  justify-content: space-between;
  padding: 14px 16px 12px;
}

.lcc-panel-title {
  color: var(--lcc-heading);
  font-size: 18px;
  font-weight: 600;
}

.lcc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lcc-panel-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 16px;
  width: 100%;
}

.lcc-section {
  width: 100%;
}

.lcc-section-title {
  color: var(--lcc-heading);
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
}

.lcc-visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.lcc-fields {
  display: grid;
  gap: 12px 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}

.lcc-fields-common {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 480px;
}

.lcc-loan-pair {
  display: grid;
  gap: 16px 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
}

.lcc-loan-block {
  min-width: 0;
}

.lcc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  min-width: 0;
}

.lcc-field label {
  color: var(--lcc-text);
  font-size: 13px;
  font-weight: 400;
  margin: 0;
}

.lcc-input {
  appearance: none;
  background: #fff;
  border: 1px solid var(--lcc-border);
  border-radius: 2px;
  color: var(--lcc-text);
  font: inherit;
  height: 36px;
  padding: 4px 10px;
  width: 100%;
}

.lcc-input:focus {
  border-color: var(--lcc-focus);
  box-shadow: 0 0 0 2px rgba(251, 133, 0, 0.2);
  outline: none;
}

.lcc-btn {
  align-items: center;
  background: #fff;
  border: 1px solid var(--lcc-border);
  border-radius: 2px;
  color: var(--lcc-text);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  gap: 8px;
  height: 34px;
  justify-content: center;
  min-width: 110px;
  padding: 0 12px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.lcc-btn:hover {
  background: var(--lcc-bg);
  border-color: #b8bec8;
}

.lcc-btn-icon {
  font-size: 14px;
  line-height: 1;
}

.lcc-savings {
  background: rgba(251, 133, 0, 0.08);
  border: 1px solid rgba(251, 133, 0, 0.35);
  border-radius: 10px;
  color: var(--lcc-accent);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
  padding: 14px 16px;
  width: 100%;
}

.lcc-results-table {
  border: 1px solid var(--lcc-border);
  border-radius: 10px;
  overflow: hidden;
  width: 100%;
}

.lcc-result-row {
  align-items: center;
  display: grid;
  gap: 8px 16px;
  grid-template-columns: 1.4fr 1fr 1fr;
  padding: 12px 16px;
}

.lcc-result-row + .lcc-result-row {
  border-top: 1px solid var(--lcc-border);
}

.lcc-result-head {
  background: var(--lcc-bg);
  font-weight: 700;
}

.lcc-result-head span:not(:first-child),
.lcc-result-row strong {
  font-size: 14px;
  font-weight: 600;
  text-align: right;
}

.lcc-result-row span:first-child {
  color: var(--lcc-muted);
  font-size: 13px;
  text-align: left;
}

.lcc-chart-header {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.lcc-chart-header .lcc-section-title {
  margin: 0;
}

.lcc-chart-wrap {
  background: #fff;
  height: 280px;
  margin: 0;
  width: 100%;
}

.lcc-chart-wrap canvas {
  display: block;
  height: 100%;
  width: 100%;
}

.lcc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-end;
}

.lcc-legend-item {
  align-items: center;
  color: var(--lcc-muted);
  display: inline-flex;
  font-size: 12px;
  gap: 6px;
}

.lcc-swatch {
  background: #fb8500;
  border-radius: 1px;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.lcc-disclaimer {
  color: #544e4f;
  font-size: 11px;
  line-height: 1.5;
  margin: 0;
}

.lcc-modal[hidden] {
  display: none !important;
}

.lcc-modal {
  align-items: center;
  background: rgba(20, 24, 32, 0.45);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 100000;
}

.lcc-modal-dialog {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  max-height: min(90vh, 640px);
  max-width: 560px;
  overflow: auto;
  padding: 24px 28px;
  position: relative;
  width: 100%;
}

.lcc-modal-dialog p,
.lcc-modal-dialog li {
  color: var(--lcc-text);
  font-size: 13px;
  line-height: 1.55;
}

.lcc-modal-dialog ul {
  margin: 0;
  padding-left: 18px;
}

.lcc-modal-dialog li + li {
  margin-top: 8px;
}

.lcc-modal-close {
  background: transparent;
  border: 0;
  color: #666;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 12px;
  top: 8px;
}

body.lcc-modal-open {
  overflow: hidden;
}

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

  .lcc-fields-common {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .lcc-panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .lcc-toolbar {
    width: 100%;
  }

  .lcc-toolbar .lcc-btn {
    flex: 1 1 auto;
  }

  .lcc-loan-pair,
  .lcc-fields,
  .lcc-fields-common {
    grid-template-columns: 1fr;
  }

  .lcc-chart-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .lcc-legend {
    justify-content: flex-start;
  }

  .lcc-chart-wrap {
    height: 220px;
  }

  .lcc-result-row {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .lcc-result-head span:not(:first-child),
  .lcc-result-row strong {
    text-align: left;
  }
}

@media print {
  .lcc-toolbar,
  .lcc-modal {
    display: none !important;
  }

  .lcc-calculator {
    max-width: none;
    width: 100%;
  }

  .lcc-panel {
    border: 0;
  }
}
