/* Fit model step. */
.fit-flow { min-width:0; }
.fit-intro { margin:0 0 24px; color:var(--ink-soft, #536477); }
.fit-stage { margin:20px 0 12px; font-size:16px; }
.model-choice-row { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
body.modern .model-choice { margin-bottom:24px; }
body.modern .equation-mode-options{ gap:0; border:1px solid #b7c6d5; border-radius:6px; background:#f2f5f8; padding:3px; }
body.modern .equation-mode-options label{ border:0; border-radius:4px; background:transparent; color:#526476; padding:9px 12px; min-height:38px; font-weight:400; }
body.modern .equation-mode-options input:checked + label{ color:#244e7c; background:#fff; box-shadow:0 1px 3px #23384a30; font-weight:600; }
body.modern .equation-mode-field{ margin-bottom:14px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.root-expression-wrap { position:relative; min-width:0; }
body.modern #formula{ width:100%; box-sizing:border-box; margin:0; padding:12px; border:1px solid #bacbdc; border-radius:4px; font:14px/1.7 ui-monospace,SFMono-Regular,Consolas,monospace; white-space:pre-wrap; overflow-wrap:anywhere; word-break:break-word; tab-size:2; background:#fff; resize:none; min-height:82px; overflow:hidden; display:block; }
#formula:focus { outline:2px solid #346295; outline-offset:2px; }
.parameter-table-scroll { overflow:auto; }
.param-table { width:100%; table-layout:fixed; }
.param-table th:first-child { width:20%; }
.param-table th:nth-child(2) { width:35%; }
.param-table th:nth-child(3) { width:45%; }
body.modern .param-table input[data-pname]{ background:#f7f8fa; border-color:transparent; color:#617183; font-weight:400; }
body.modern .param-table input[data-pguess]{ background:#fff; border:1px solid #8da8c2; color:#18364f; font-weight:600; }
.param-table td.idx { color:#657487; white-space:normal; overflow-wrap:anywhere; }
body.modern .parameter-guide-button{ color:#315e8c; background:transparent; border:0; box-shadow:none; padding:6px 0; font-weight:400; text-decoration:underline; min-height:38px; }
body.modern .parameter-guide-button:hover:not(:disabled){ color:#183f6b; background:transparent; border:0; }
body.modern #btn-fit{ background:#245b92; color:#fff; font-weight:700; padding:12px 28px; min-height:46px; }
.fit-bar-save { flex:none; }
body.modern details > summary{ list-style:none; display:flex; align-items:center; gap:8px; cursor:pointer; min-height:40px; padding:6px 0; }
details > summary::-webkit-details-marker { display:none; }
details > summary::before { content:''; width:0; height:0; border-top:6px solid transparent; border-bottom:6px solid transparent; border-left:8px solid currentColor; flex:none; transform-origin:4px 6px; }
details[open] > summary::before { transform:rotate(90deg); }
body.modern .fit-plot-settings { padding:14px 24px; }
.plot-settings-body { padding-top:16px; }
body.modern .fit-plot-settings > summary { font-size:17px; font-weight:600; }
.hint-inline { font-size:13px; font-weight:400; color:#667789; }
.parameter-paste { margin:12px 0; }
.visual-match-layout { display:grid; gap:16px; }
.visual-preview-plot, .visual-controls-pane { min-width:0; }
.guess-preview-panel { container-type:inline-size; }
@container (min-width:760px) {
  .starting-values-panel.is-adjusting .visual-match-layout { grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); align-items:start; }
  .visual-preview-plot { position:sticky; top:12px; }
  .visual-controls-pane { max-height:min(560px,calc(90vh - 130px)); overflow:auto; padding:2px 6px 2px 2px; }
}
.parameter-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin:12px 0; }
body.modern .parameter-heading .fit-stage{ margin:0; }
body.modern .parameter-help-icon{ display:inline-flex; align-items:center; justify-content:center; flex:none; min-height:28px; width:28px; padding:0; border:1px solid #bacbdc; border-radius:50%; text-decoration:none; font-size:14px; }
.parameter-heading { justify-content:flex-start; }
.starting-values-panel { padding:16px; margin:12px 0; border:1px solid #d4dfe9; border-radius:6px; background:#fbfcff; }
.starting-values-panel [hidden] { display:none!important; }
.starting-values-panel .visual-preview-plot { max-width:640px; }
.starting-values-panel.is-adjusting .visual-preview-plot { max-width:none; }
.starting-values-status { margin:12px 0 4px; font-size:14px; font-weight:600; color:#344e68; }
.starting-values-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:12px 0 4px; }
.starting-values-editor { margin:14px 0; }
.starting-values-editor > summary { font-weight:600; }
#starting-values-error { color:#a53030; }
body.modern :is(#visual-match-open, #starting-values-manual) { background:#fff; color:#285987; border:1px solid #8caac7; font-weight:600; padding:10px 16px; }
body.modern #visual-match-open.primary{ background:#245b92; color:#fff; border-color:#245b92; }
body.modern :is(#visual-match-open, #starting-values-manual):disabled { opacity:.55; }
.visual-mode-label { display:flex; align-items:center; flex-wrap:wrap; gap:10px; font-weight:600; }
body.modern #visual-adjust-mode{ width:auto; min-width:150px; }
body.modern #visual-adjustments input[type="text"] { min-height:36px; padding:6px 8px; font-size:14px; }
body.modern .visual-value-row button { min-height:40px; padding:6px 12px; }
.visual-tips { margin:4px 0 8px; }
#visual-parameters { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)); gap:12px; }
.visual-parameter { min-width:0; padding:12px; border:1px solid #c2cfdb; border-radius:6px; background:#f7f9fc; }
.visual-parameter-name { display:block; font-weight:600; margin-bottom:8px; overflow-wrap:anywhere; }
.visual-value-row { display:flex; align-items:center; gap:6px; }
.visual-value-row input { flex:1; width:0; min-width:0; }
.visual-value-row button { flex:none; min-width:40px; font-size:19px; }
.visual-step-row { display:flex; align-items:end; flex-wrap:wrap; gap:8px; margin-top:10px; }
.visual-step-row > label { flex:1; min-width:90px; font-size:12px; }
.visual-step-row input { display:block; width:100%; box-sizing:border-box; min-width:0; }
.visual-magnitude-buttons { display:flex; gap:4px; }
.visual-magnitude-buttons button { padding:6px 8px; min-height:36px; }
.visual-slider-controls { margin-top:10px; }
.visual-slider-controls input[type="range"] { display:block; width:100%; padding:0; accent-color:#245b92; min-height:30px; }
.visual-range-row { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.visual-range-row label:first-child { grid-column:1/-1; }
.visual-range-row label { min-width:0; font-size:12px; }
.visual-range-row input, .visual-range-row select { width:100%; min-width:0; box-sizing:border-box; }
#visual-match-error { color:#a53030; }
.guess-preview-panel svg { width:100%; height:auto; display:block; max-height:260px; }
.guess-preview-legend { display:flex; flex-wrap:wrap; gap:20px; font-size:13px; color:#526476; margin:8px 0; }
.preview-line-key::before { content:''; display:inline-block; width:22px; border-top:2px dashed #346295; vertical-align:middle; margin-right:6px; }
.preview-point-key::before { content:''; display:inline-block; width:6px; height:6px; border-radius:50%; background:#354759; margin-right:6px; }
input::placeholder, textarea::placeholder { color:#8794a2; font-weight:400; font-style:italic; }
@media (max-width:600px) {
  body.modern .fit-plot-settings { padding:10px 16px; }
  .fit-bar { flex-wrap:wrap; gap:8px; }
  .fit-bar #fit-status { flex-basis:100%; order:5; }
  .fit-bar #modern-back { font-size:12px; padding:8px; }
  body.modern #btn-fit { padding:10px 24px; }
  body.modern .equation-mode-options label { font-size:12px; padding:8px; }
  .param-table th, .param-table td { padding:6px 4px; font-size:12px; }
  .param-table input { min-width:0; width:100%; }
}
/* Override older text-glyph arrows so every disclosure uses the same triangle. */
body.modern :is(details, details.fold, details.diagnostic-config, details.ml-guide, details.expander) > summary::before{ content:''; font-size:inherit; width:0; height:0; margin:0; border-top:6px solid transparent; border-bottom:6px solid transparent; border-left:8px solid currentColor; }
body.modern :is(details, details.fold, details.diagnostic-config, details.ml-guide, details.expander)[open] > summary::before{ content:''; transform:rotate(90deg); }
@media (max-width:600px) {
}
@media (max-width:600px) {
}

#hist-fit-options { margin: 16px 0 24px; padding: 16px; border: 1px solid #d4dfe9; border-radius: 6px; background: #f7f9fc; }
#hist-fit-options .field { max-width: 420px; margin-bottom: 8px; }
#hist-fit-options .hist-fit-reference > summary { font-size: 13px; color: #536477; }
#hist-fit-options .hist-fit-reference p { margin: 8px 0 0; }


