/* Loan term comparison calculator: page styles on top of the shared style.css.
   Everything here is prefixed "lt-" so it never changes another page.
   Colours: the three terms are gold, slate and ink (each term keeps its colour everywhere);
   interest = rust (a cost), the loan itself = a quiet ink tint, saved = dashed gold. */

.lt-head { padding-block: 24px 4px; }
.lt-head h1 { font-size: var(--step-3); margin-top: 6px; }

.lt-work { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px 40px; align-items: start; padding-top: 16px; }
.lt-stage { display: grid; min-width: 0; }

.lt-answer { display: grid; gap: 2px; justify-items: start; }
.lt-answer .label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.lt-answer .big { font-size: clamp(2.6rem, 2rem + 2.4vw, 4rem); }
.lt-answer .big.is-gold { color: var(--gold); }
.lt-answer .big.is-ink { color: var(--ink); }
.lt-answer-line { color: var(--muted); font-size: 0.93rem; max-width: 60ch; margin-top: 6px; }
.lt-answer-line strong { color: var(--ink); font-weight: 600; }

.lt-figure { margin: 0; padding-top: 12px; min-width: 0; }
.lt-legend-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 24px; padding-top: 8px; }
.lt-legend-row .hint { font-size: 0.8rem; }
.lt-key { display: inline-flex; align-items: center; gap: 7px; }
.lt-swatch { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.lt-swatch.lt-sw-principal { background: color-mix(in srgb, var(--ink) 20%, transparent); }
.lt-swatch.lt-sw-interest { background: color-mix(in srgb, var(--rust) 62%, transparent); }
.lt-swatch.lt-sw-saved { background: transparent; border: 1.5px dashed var(--gold); }
.lt-short { display: none; }

/* the three terms' colours */
.lt-c0 { --c: var(--gold); }
.lt-c1 { --c: var(--slate); }
.lt-c2 { --c: var(--ink); }
.lt-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; flex: none; }
.chip.lt-c0, .chip.lt-c1, .chip.lt-c2 { border-color: var(--c); }

/* chart marks */
.chart-box .lt-bar-principal { fill: var(--ink); fill-opacity: 0.2; }
.chart-box .lt-bar-interest { fill: var(--rust); fill-opacity: 0.62; }
.chart-box .lt-bar-saved { fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart-box .lt-cap { stroke-width: 3; stroke-linecap: round; }
.chart-box .lt-name { font-family: var(--font-body); font-size: 14px; font-weight: 600; fill: var(--ink); }
.chart-box .lt-pay { font-size: 13px; font-weight: 700; }
.chart-box .lt-pay-s { font-size: 11.5px; fill: var(--muted); }
.chart-box .lt-v { font-size: 12px; font-weight: 700; }
.chart-box .lt-s { font-size: 11px; fill: var(--muted); }
.chart-box .lt-line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart-box .lt-line.lt-thin { stroke-width: 1.6; }
.chart-box .lt-mark { font-size: 11.5px; font-weight: 700; }
.chart-box .lt-mark-sub { font-size: 11px; fill: var(--muted); }
.chart-box .lt-you { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 3 3; opacity: 0.55; }
.chart-box .lt-empty { fill: var(--muted); font-family: var(--font-body); font-style: normal; font-size: 13px; }
.chart-box .lt-halo { paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.chart-box .lt-gap { stroke: var(--rust); stroke-width: 1.5; }
.tip .t-h { font-weight: 700; font-size: 0.78rem; margin-top: 4px; }
.tip .t-row .k { display: inline-flex; align-items: center; gap: 6px; }
.tip .t-row .k i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; }
.tip .t-sub { color: var(--muted); font-size: 0.76rem; }

/* comparison table */
.lt-table-wrap { margin-top: 20px; overflow-x: auto; }
.lt-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.93rem; border-top: 1px solid var(--ink); }
.lt-table th, .lt-table td { padding: 8px 0 8px 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.lt-table th:first-child { text-align: left; padding-left: 0; font-weight: 600; color: var(--muted); font-size: 0.8rem; white-space: normal; }
.lt-table thead th { font-family: var(--font-display); font-weight: 500; font-size: 1.02rem; color: var(--ink); padding-top: 10px; vertical-align: bottom; }
.lt-table thead th .lt-th-in { display: inline-flex; align-items: center; gap: 7px; }
.lt-table thead th small { display: block; font-family: var(--font-body); font-size: 0.74rem; color: var(--muted); font-weight: 400; }
.lt-table td.best { font-weight: 700; }
.lt-table td.best::before { content: "Lowest"; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); margin-right: 6px; vertical-align: 1px; }
.lt-table td.z { color: var(--muted); }
.lt-table tbody tr.lt-key-row td { font-weight: 700; }

/* inputs */
.lt-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 4px; min-width: 0; position: sticky; top: 12px; }
.lt-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 12px; }
.lt-panel-head h2 { flex: none; font-size: 1.3rem; white-space: nowrap; }
.lt-panel-head .btn-row { flex: 0 1 auto; flex-wrap: nowrap; gap: 4px; min-width: 0; justify-content: flex-end; }
.lt-panel-head .inline-field { min-width: 0; flex: 0 1 auto; }
.lt-panel-head .inline-field select { max-width: 10rem; width: 100%; min-width: 0; }
.lt-panel-head .btn-ghost { padding-inline: 6px; }
.lt-form { display: grid; border-top: 1px solid var(--ink); }
.lt-group { border: 0; margin: 0; padding: 14px 0; display: grid; gap: 10px; min-width: 0; align-content: start; }
.lt-group + .lt-group { border-top: 1px solid var(--line); }
.lt-group:last-child { padding-bottom: 6px; }
.lt-group legend { float: left; width: 100%; padding: 0; font-family: var(--font-display); font-size: 1.05rem; }
.lt-group legend + * { clear: both; }
.lt-group .hint { font-size: 0.8rem; }
.lt-panel .privacy { margin-top: 6px; }
.lt-panel input[type="text"] { min-height: 42px; }
.lt-terms { display: grid; grid-template-columns: 10px minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; align-items: center; }
.lt-th { font-size: 0.8rem; font-weight: 600; color: var(--muted); line-height: 1; }
.lt-terms input::placeholder { color: var(--muted); opacity: 0.7; }

/* sections */
.lt-section { padding-top: 64px; }
.lt-section-head { display: grid; gap: 8px; margin-bottom: 8px; }
.lt-msg { font-size: 1.05rem; max-width: 70ch; }
.lt-msg b { font-weight: 700; }
.lt-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 40px; }
.lt-fig-h { font-family: var(--font-body); font-size: 0.8rem; font-weight: 700; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 4px; }
.lt-pair-note { margin-top: 10px; font-size: 0.8rem; }

@media (max-width: 1200px) and (min-width: 961px) { .lt-work { grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; } }
@media (max-width: 960px) {
  .lt-work { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .lt-stage { display: contents; }
  .lt-answer { order: 1; }
  .lt-stage .lt-figure { order: 2; }
  .lt-panel { order: 3; margin-top: 18px; position: static; }
  .lt-table-wrap { order: 4; margin-top: 28px; }
}
@media (max-width: 960px) and (min-width: 640px) {
  .lt-form { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); column-gap: 20px; }
  .lt-form .lt-group + .lt-group { border-top: 0; border-left: 1px solid var(--line); padding-left: 20px; }
}
@media (max-width: 720px) {
  .lt-pair { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 600px) {
  .lt-head { padding-block: 16px 0; }
  .lt-head .eyebrow { display: none; }
  .lt-head h1 { font-size: 1.4rem; }
  .lt-answer .label { font-size: 0.76rem; }
  .lt-answer .big { font-size: 2.3rem; }
  .lt-answer-line { font-size: 0.86rem; }
  .lt-answer-line .lt-more { display: none; }
  .lt-figure { padding-top: 6px; }
  .lt-hover-hint { display: none; }
  .lt-long { display: none; }
  .lt-short { display: inline; }
  .lt-stage .lt-legend-row .legend { gap: 4px 14px; }
  .lt-panel { padding: 14px; margin-inline: -4px; }
  .lt-panel-head { padding-bottom: 8px; }
  .lt-panel-head h2 { font-size: 1.2rem; }
  .lt-group { padding: 12px 0; gap: 8px; }
  .lt-group legend { font-size: 1rem; }
  .lt-group .hint { font-size: 0.76rem; }
  .lt-terms { gap: 6px 8px; }
  .lt-section { padding-top: 52px; }
  .lt-table { font-size: 0.8rem; }
  .lt-table th, .lt-table td { padding-left: 6px; }
  .lt-table thead th { font-size: 0.88rem; }
  .lt-table thead th .lt-th-in { gap: 5px; }
  .lt-table thead .lt-dot { width: 8px; height: 8px; }
  .lt-table th:first-child { font-size: 0.74rem; }
  .lt-table td.best::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-right: 5px; vertical-align: 2px; }
  .lt-table th:first-child { white-space: nowrap; }
}

/* while a field has an error, the last good results stay, dimmed */
.lt-has-errors .lt-answer, .lt-has-errors .lt-stage .lt-figure, .lt-has-errors .lt-table-wrap, .lt-has-errors .lt-section { opacity: 0.4; transition: opacity 0.15s; }

/* Keep the currency picker readable: it used to shrink to an empty box once Share joined Reset.
   When "Your numbers" and the buttons don't fit on one line, the buttons move under the title. */
.lt-panel-head { flex-wrap: wrap; row-gap: 8px; }
.lt-panel-head .btn-row { flex: 0 0 auto; max-width: 100%; flex-wrap: wrap; row-gap: 6px; }
.lt-panel-head .inline-field { flex: 0 0 auto; }
.lt-panel-head .inline-field select { width: 8rem; min-width: 8rem; max-width: 8rem; }
