/* WIDGET: loan-calculator — sliders drive a real recompute; bars scale via transform */
.lc-body { display: flex; flex-direction: column; gap: 16px; container-type: inline-size; }

.lc-controls { display: flex; flex-direction: column; gap: 14px; }

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

.lc-field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
}

.lc-field-head label, .lc-field-head span:first-child { color: var(--text-3); }

.lc-field-value {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lc-field input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 36px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.lc-field input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--line-2); }
.lc-field input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-2); }

.lc-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  margin-top: -9px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface-1);
  box-shadow: 0 0 0 1px var(--accent-line);
  cursor: pointer;
}

.lc-field input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface-1);
  box-shadow: 0 0 0 1px var(--accent-line);
  cursor: pointer;
}

.lc-field input[type="range"]:focus-visible { outline: none; }
.lc-field input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--accent-glow); }
.lc-field input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--accent-glow); }

.lc-bank-group { display: flex; flex-wrap: wrap; gap: 8px; }

.lc-bank-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 0.78rem;
  color: var(--text-3);
  cursor: pointer;
  transition: border-color var(--dur-2) var(--ease-hover), color var(--dur-2) var(--ease-hover), background-color var(--dur-2) var(--ease-hover);
}

.lc-bank-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.lc-bank-chip:has(input:checked) {
  border-color: var(--accent-line);
  color: var(--text-1);
  background: var(--accent-soft);
}

.lc-bank-chip:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.lc-rate-note {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 2px;
  font-size: 0.68rem;
  color: var(--text-3);
}

.lc-rate-tag {
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--text-4);
  white-space: nowrap;
}

.lc-outputs-primary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.lc-stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-1);
  background: var(--surface-1);
}

.lc-stat-card span { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.02em; color: var(--text-4); text-transform: uppercase; }
.lc-stat-card strong { font-size: 1rem; font-weight: 600; color: var(--text-1); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.lc-chart-wrap { display: flex; flex-direction: column; gap: 8px; }

.lc-chart-legend { display: flex; gap: 14px; font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-3); }
.lc-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lc-swatch { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.lc-swatch-goc { background: var(--prod-mf); }
.lc-swatch-lai { background: var(--accent); }

.lc-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 84px;
  padding: 0 2px;
  border-bottom: 1px solid var(--line-1);
}

.lc-year { flex: 1 1 0; display: flex; align-items: flex-end; gap: 1px; height: 100%; min-width: 0; }

.lc-bar {
  flex: 1 1 0;
  height: 100%;
  min-width: 1px;
  border-radius: 1px 1px 0 0;
  transform-origin: bottom;
  transition: transform var(--dur-4) var(--ease-out);
}

.lc-bar-goc { background: var(--prod-mf); }
.lc-bar-lai { background: var(--accent); }

.lc-chart-caption { margin: 0; font-size: 0.68rem; line-height: 1.5; color: var(--text-4); }

.lc-export { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.lc-export-btn { min-height: 36px; }

.lc-export-note {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-3);
}


@container (max-width: 340px) {
  .lc-outputs-primary { grid-template-columns: minmax(0, 1fr); }
  .lc-chart { height: 64px; }
}
