/* ==========================================================================
   SMUI.HTML: ANALYZE > FIT MODEL (smui-p-fitmodel.js)
   The launch dialog's Construct Model Effects part, the Effect Summary's
   LogWorth bars, the Prediction Profiler's grid of plots, the controls of
   Stepwise, Generalized Regression and the contour profiler. Colours are
   kvot.css's tokens (and the core's), so both themes read.
   ========================================================================== */

/* ---- the launch dialog ------------------------------------------------------ */
.sm-fm-construct { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-color); }
.sm-fm-construct h4 { margin: 10px 0 6px; }
.sm-fm-pers { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12px; }
.sm-fm-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-primary); }
.sm-fm-opt > span { color: var(--text-secondary); white-space: nowrap; }
.sm-fm-opt select, .sm-fm-opt input[type="text"], .sm-fm-degree input, .sm-fm-prof-x input[type="text"], .sm-fm-prof-x select {
  padding: 2px 5px; border: 1px solid var(--border-color); border-radius: 3px; background: var(--input-bg); color: var(--text-primary); font: inherit; font-size: 12px; min-width: 0;
}
.sm-fm-effbox { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 7px; align-items: start; }
.sm-fm-tools { display: flex; flex-direction: column; gap: 5px; }
.sm-fm-tools .sm-btn { justify-content: center; width: 104px; }
.sm-fm-degree, .sm-fm-noint { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-secondary); }
.sm-fm-degree input { width: 2.6em; text-align: right; }
.sm-role-list.sm-fm-effects { min-height: 150px; max-height: 260px; }

/* ---- Effect Summary ----------------------------------------------------------- */
.sm-fm-esum td.sm-fm-barcell { position: relative; width: 150px; min-width: 110px; padding: 0 4px; }
.sm-fm-esum th.sm-fm-barhead { width: 150px; }
.sm-fm-bar { display: block; height: 11px; border-radius: 1px; background: var(--color-kvot-accent); opacity: 0.8; }
.sm-fm-ref { position: absolute; top: 1px; bottom: 1px; width: 0; border-left: 1px solid var(--sm-cont, #2f6ec7); }
.sm-fm-esum tbody tr.is-selected td { background: var(--sm-sel-bg); }
.sm-fm-esum-btns { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 2px 0 4px; }

/* ---- report parts --------------------------------------------------------------- */
.sm-fm-modelline { display: flex; flex-wrap: wrap; gap: 2px 18px; margin: 2px 0 8px; font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.sm-fm-modelline b { font-weight: 600; color: var(--text-primary); }
.sm-fm-expr { margin: 2px 0 6px; padding: 6px 9px; max-width: 820px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--code-bg); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; line-height: 1.5; overflow-wrap: anywhere; }
.sm-fm-controls { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 2px 0 8px; }
.sm-fm-swtable td input[type="checkbox"] { margin: 0; }
.sm-fm-swtable tbody tr.is-entered td { font-weight: 600; }

/* ---- the Prediction Profiler ------------------------------------------------------------ */
.sm-fm-profwrap { max-width: 100%; overflow-x: auto; padding-bottom: 4px; }
.sm-fm-prof { display: grid; gap: 0 2px; align-items: center; width: max-content; }
.sm-fm-prof .sm-plot { min-width: 0; }
.sm-fm-prof-y { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 1px; padding-right: 4px; font-size: 11.5px; text-align: right; }
.sm-fm-prof-name { color: var(--text-secondary); overflow-wrap: anywhere; max-width: 130px; }
.sm-fm-prof-val { font-size: 14px; font-weight: 600; color: var(--sm-nom, #c0392b); font-variant-numeric: tabular-nums; }
.sm-fm-prof-ci { color: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.sm-fm-prof-corner { color: var(--text-muted); font-size: 11px; align-self: start; padding-top: 4px; }
.sm-fm-prof-x { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 2px 0 4px; font-size: 11.5px; box-sizing: border-box; }
.sm-fm-prof-x input[type="text"] { width: 7.5em; text-align: right; }
.sm-fm-prof-x select { max-width: 100%; }
.sm-fm-prof-x input[type="range"] { width: 90%; margin: 0; accent-color: var(--color-kvot-accent); }
.sm-fm-prof-fname { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 760px) {
  .sm-fm-effbox { grid-template-columns: 1fr; }
  .sm-fm-tools { flex-direction: row; flex-wrap: wrap; }
  .sm-fm-tools .sm-btn { width: auto; }
  .sm-fm-esum th, .sm-fm-esum td { padding: 2px 5px; }
  .sm-fm-esum td.sm-fm-barcell, .sm-fm-esum th.sm-fm-barhead { width: 46px; min-width: 36px; }
}
