/* Mortgage repayment calculator: styles only this tool uses. The layout,
   stat tiles, chart and table are shared in ../assets/toolkit.css. */

/* Four stat tiles across only when the results column has the full width. */
@media (min-width: 761px) and (max-width: 900px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }

.oneoff-list { display: flex; flex-direction: column; gap: 8px; }
.oneoff-list:empty { display: none; }
.oneoff-row {
  display: grid; grid-template-columns: 1.1fr 1fr 1.3fr 36px; gap: 6px;
  align-items: center;
}
.oneoff-row .select, .oneoff-row .input { min-width: 0; }
.oneoff-row .select { padding: 11px 26px 11px 10px; background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; }
.oneoff-row .input--pre { padding-left: 24px; padding-right: 8px; }
.oneoff-row .input-affix--pre { left: 10px; }
#addOneOff { align-self: flex-start; }

/* "Work out the amount for me" helper */
.goal summary {
  display: flex; flex-direction: column; gap: 4px;
  cursor: pointer; list-style: none;
}
.goal summary::-webkit-details-marker { display: none; }
.goal-title {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  font-size: 0.875rem; font-weight: 600; color: var(--primary);
}
.goal-note { font-size: 0.75rem; color: var(--muted); line-height: 1.5; padding-left: 14px; }
.goal-title::before {
  content: ''; width: 6px; height: 6px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform 0.15s ease;
}
.goal[open] .goal-title::before { transform: rotate(45deg); }
.goal summary:hover .goal-title { text-decoration: underline; }
.goal summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.goal-body {
  margin-top: 12px; padding: 16px;
  background: var(--bg); border-radius: var(--radius-sm);
  display: flex; flex-direction: column; gap: 14px;
}
html[data-theme="dark"] .goal-body .input,
html[data-theme="dark"] .goal-body .select { background: var(--surface); }
#goalCalc { align-self: flex-start; }
.goal-result {
  font-size: 0.875rem; line-height: 1.55; color: var(--text);
  border-left: 3px solid var(--primary); padding-left: 12px;
}
.goal-result--warn { border-left-color: var(--warning); }

.schedule tr.month-row.is-over td:nth-child(3) { color: var(--primary); font-weight: 600; }

/* ── Phones ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  /* Lump sum rows: month + year + remove on one line, amount underneath. */
  .oneoff-row { grid-template-columns: 1fr 1fr 36px; }
  .oneoff-row .input-wrap { grid-column: 1 / 3; grid-row: 2; }
  .oneoff-row .icon-btn { grid-row: 1; grid-column: 3; }
  .oneoff-row + .oneoff-row { padding-top: 8px; border-top: 1px solid var(--border); }
}
