/* Estimate Sum Calculator: a segmented choice of rounding place, three result stats and a table of rounded values. */
.t-est { grid-template-columns: minmax(0, 1fr); }
.t-est .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .t-est .stats { grid-template-columns: minmax(0, 1fr); } }
.t-est .stat-value { font-size: 24px; }
.t-est .stat-note { margin-top: 4px; }
.calc .calc-option { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; cursor: pointer; margin-top: 8px; }
.calc .calc-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }

.t-est-modes { border: 0; margin: 0; padding: 0; }
.t-est-modes legend { font-size: 14px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.t-est-seg { display: flex; flex-wrap: wrap; gap: 8px; }
.t-est-seg label { position: relative; cursor: pointer; }
.t-est-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.t-est-seg span { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; background: var(--card, #fff); color: var(--text); transition: background .15s, border-color .15s, color .15s; }
.t-est-seg label:hover span { border-color: var(--blue); }
.t-est-seg input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.t-est-seg input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.t-est .actions { flex-wrap: wrap; }
@media (max-width: 640px) { .t-est .actions .btn { flex: 1 1 auto; } .t-est .result-actions { flex-wrap: wrap; } }

.t-est .process ol { font-variant-numeric: tabular-nums; }
.t-est .process li { overflow-wrap: anywhere; }
.t-est-table { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.t-est-table:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.t-est-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.t-est-table th, .t-est-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.t-est-table th { position: sticky; top: 0; z-index: 1; background: var(--soft); font-weight: 600; }
.t-est-table .is-num { color: var(--muted); width: 1%; }
.t-est-table .is-up { color: var(--blue); }
.t-est-table .is-down { color: var(--danger); }
.t-est-table tbody tr:last-child td { border-bottom: 0; }
.t-est-table tfoot td { font-weight: 600; background: var(--soft); border-bottom: 0; border-top: 1px solid var(--line); }

/* Page sections (content.mid_html) */
.t-est-page td, .t-est-page th { font-variant-numeric: tabular-nums; }
.t-est-page .t-est-formula { margin: 16px 0; padding: 12px 16px; border-radius: var(--radius); background: var(--soft); font-size: 16px; line-height: 1.6; overflow-x: auto; }
