/* Reference and tool pages (python/daveth_ui/tools.py). Loaded after topic.css and hub.css,
   whose page frame, colours and link list they share; only the calculator and the tables are new. */
.ref-calc, .ref-section { max-width: var(--tp-col); margin: 40px 0 0; }
.ref-calc { padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.ref-calc h2, .ref-section h2 { margin: 0 0 14px; font-size: clamp(20px, 2.2vw, 24px); letter-spacing: -.01em; }
.ref-form { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.ref-form label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.ref-form input, .ref-form select {
  font: 500 17px/1.3 var(--tp-mono, ui-monospace, monospace); color: var(--text); background: var(--bg, transparent);
  border: 1px solid var(--line-strong, var(--line)); border-radius: 10px; padding: 10px 12px; min-width: 0;
}
.ref-form input:focus-visible, .ref-form select:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; }
.ref-help { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.ref-out { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 20px 0 0; }
.ref-out dt { font-size: 14.5px; color: var(--muted); }
.ref-out dd { margin: 0; font: 600 16px/1.4 var(--tp-mono, ui-monospace, monospace); color: var(--text); overflow-wrap: anywhere; }
.ref-out.is-error dd { font-family: inherit; font-weight: 500; }
.ref-section p, .ref-section li { font: 400 16.5px/1.65 var(--tp-prose, inherit); }
.ref-section ul { padding-left: 20px; }
.ref-src { color: var(--muted); font-size: 14.5px; }
.ref-table { max-width: var(--tp-col); margin: 32px 0 0; overflow-x: auto; }
.ref-table table { border-collapse: collapse; width: 100%; font-size: 15px; }
.ref-table caption { text-align: left; color: var(--muted); font-size: 14px; padding: 0 0 10px; }
.ref-table th, .ref-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ref-table thead th { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.ref-table tbody th { font-weight: 600; }
.ref-table td.n { font-variant-numeric: tabular-nums; text-align: right; }
.ref-table code { font-family: var(--tp-mono, ui-monospace, monospace); }
@media (max-width: 600px) {
  .ref-form { grid-template-columns: 1fr; }
  .ref-out { grid-template-columns: 1fr; gap: 2px 0; }
  .ref-out dd { margin-bottom: 8px; }
  .ref-calc { padding: 18px; }
}
