/* Slope Field & Phase Plane Plotter, 2026-11-06. Only what ft-tool-20261106.css lacks; tokens only. */

#tool [hidden] { display: none !important; }

/* Layout: equations and settings on the left, the plot on the right from 896 px; one column below. */
.sfpp-layout { display: grid; gap: var(--ft-space-4); align-items: start; }
.sfpp-layout > * { min-width: 0; }
@media (min-width: 56rem) {
  .sfpp-layout {
    grid-template-columns: minmax(17rem, 21rem) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "eq plot" "side plot";
  }
  .sfpp-area-eq { grid-area: eq; }
  .sfpp-area-plot { grid-area: plot; }
  .sfpp-area-side { grid-area: side; }
}
.sfpp-results { margin-top: var(--ft-space-4); }

/* Equations: the left-hand side is the visible label, joined to the input. */
.sfpp-eq { display: grid; gap: var(--ft-space-1); }
.sfpp-eq__row { display: flex; align-items: stretch; min-width: 0; }
.sfpp-eq__lhs {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-width: 4.25rem;
  padding: 0 0.7rem;
  border: 1px solid var(--ft-line-strong);
  border-right: 0;
  border-radius: var(--ft-radius) 0 0 var(--ft-radius);
  background: var(--ft-surface-2);
  color: var(--ft-ink);
  font-family: var(--ft-font-mono);
  font-size: var(--ft-text-sm);
  font-weight: 650;
  white-space: nowrap;
}
.sfpp-eq__input { flex: 1 1 auto; min-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; font-family: var(--ft-font-mono); }
.sfpp-eq__read { min-height: 1.45em; font-family: var(--ft-font-mono); overflow-wrap: anywhere; }

/* Plot */
.sfpp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ft-space-2); margin-bottom: var(--ft-space-3); }
.sfpp-frame {
  --ft-chart-ratio: 16 / 10;
  --ft-chart-ratio-narrow: 1 / 1;
  cursor: crosshair;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.sfpp-frame.is-panning { cursor: grabbing; }
.sfpp-frame:focus-visible { outline: 3px solid var(--ft-focus); outline-offset: 2px; }
.sfpp-svg { position: absolute; inset: 0; }
.sfpp-svg > svg { display: block; width: 100%; height: 100%; }
.sfpp-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: var(--ft-space-4); color: var(--ft-ink-2); font-size: var(--ft-text-sm); text-align: center; }
.sfpp-legend { min-height: 1.5rem; }
.sfpp-legend svg { flex: none; overflow: visible; }
.sfpp-readout { min-height: 1.45em; font-variant-numeric: tabular-nums; }
/* Touch screens without a hover pointer get the touch sentence instead of the mouse and keyboard ones. */
.sfpp-hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .sfpp-hint-fine { display: none; }
  .sfpp-hint-touch { display: inline; }
}
@media (max-width: 40rem) { .sfpp-readout { min-height: 2.9em; } }
.sfpp-show { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--ft-space-4); margin: var(--ft-space-2) 0 var(--ft-space-2); }
.sfpp-show__title { margin: 0 var(--ft-space-1) 0 0; color: var(--ft-ink); font-size: var(--ft-text-sm); font-weight: 650; }
.sfpp-downloads { margin-top: var(--ft-space-4); }
.sfpp-downloads + .ft-hint { margin-top: var(--ft-space-2); }
.sfpp-linkbox { display: grid; gap: var(--ft-space-1); margin-bottom: var(--ft-space-3); }
/* One column: the page script moves the Parameters block here, just under the plot (see placeParams). */
.sfpp-params-slot:empty { display: none; }
.sfpp-params-slot { margin: var(--ft-space-3) 0 var(--ft-space-2); padding-top: var(--ft-space-3); border-top: 1px solid var(--ft-line); }
.sfpp-area-side .ft-stack > .sfpp-divider:first-child { display: none; }
.sfpp-note { margin-bottom: 0; }

/* Settings */
.sfpp-side__title { margin-bottom: var(--ft-space-4); }
.sfpp-h3 { margin: 0 0 var(--ft-space-3); color: var(--ft-ink); font-size: var(--ft-text-md); font-weight: 650; line-height: 1.3; }
.sfpp-divider { margin: 0; }
.sfpp-params { display: grid; gap: var(--ft-space-1); }
.sfpp-param { display: grid; grid-template-columns: minmax(2rem, max-content) minmax(0, 1fr) 5.75rem; align-items: center; gap: var(--ft-space-3); }
.sfpp-param__name { color: var(--ft-ink); font-family: var(--ft-font-mono); font-size: var(--ft-text-sm); font-weight: 650; overflow-wrap: anywhere; }
.sfpp-param__num { padding: 0.4rem 0.55rem; }
.sfpp-ranges { margin-top: var(--ft-space-3); }
.sfpp-ranges__table .ft-input { min-width: 4.5rem; padding: 0.3rem 0.45rem; }
.sfpp-ranges__table th[scope="row"] { font-family: var(--ft-font-mono); vertical-align: middle; }
.sfpp-ranges .ft-hint { margin-top: var(--ft-space-2); }
.sfpp-window { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ft-space-3); }
.sfpp-window + .ft-error { margin-top: var(--ft-space-2); }

/* Results: equilibria */
.sfpp-summary { margin: 0 0 var(--ft-space-3); color: var(--ft-ink-2); font-size: var(--ft-text-sm); }
.sfpp-eqlist { display: grid; gap: var(--ft-space-3); margin: 0 0 var(--ft-space-4); padding: 0; list-style: none; }
.sfpp-eqitem { padding: var(--ft-space-3) var(--ft-space-4); border: 1px solid var(--ft-line); border-radius: var(--ft-radius); background: var(--ft-surface); }
.sfpp-eqitem__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ft-space-1) var(--ft-space-3); margin: 0; color: var(--ft-ink); font-weight: 650; }
.sfpp-eqitem__num { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; padding: 0 0.3rem; border-radius: 999px; background: var(--ft-accent-soft); color: var(--ft-ink); font-size: var(--ft-text-xs); font-variant-numeric: tabular-nums; }
.sfpp-eqitem__pt { font-variant-numeric: tabular-nums; }
.sfpp-eqitem__type { display: inline-flex; align-items: center; gap: var(--ft-space-2); }
.sfpp-eqitem__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.75rem), 1fr)); gap: var(--ft-space-2) var(--ft-space-4); margin: var(--ft-space-3) 0 0; }
.sfpp-eqitem__facts dt { color: var(--ft-ink-2); font-size: var(--ft-text-xs); font-weight: 600; }
.sfpp-eqitem__facts dd { margin: 2px 0 0; color: var(--ft-ink); font-size: var(--ft-text-sm); font-variant-numeric: tabular-nums; }
.sfpp-eqitem__note { margin: var(--ft-space-2) 0 0; color: var(--ft-ink-2); font-size: var(--ft-text-sm); }
/* A 2 × 2 matrix in square brackets (the brackets are the two pseudo-elements). */
.sfpp-matrix {
  position: relative;
  display: inline-grid;
  grid-template-columns: repeat(2, auto);
  gap: 0 var(--ft-space-3);
  padding: 1px 0.6rem;
  text-align: right;
  white-space: nowrap;
}
.sfpp-matrix::before, .sfpp-matrix::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0.3rem;
  border: 1.5px solid var(--ft-ink-2);
}
.sfpp-matrix::before { left: 0; border-right: 0; }
.sfpp-matrix::after { right: 0; border-left: 0; }
.sfpp-td { margin-top: var(--ft-space-2); }
.sfpp-td__frame { --ft-chart-ratio: 4 / 3; --ft-chart-ratio-narrow: 4 / 3; }

/* Results: solutions */
.sfpp-sollist { display: grid; gap: var(--ft-space-2); margin: 0 0 var(--ft-space-4); padding: 0; list-style: none; }
.sfpp-sol {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "pick remove" "info remove";
  align-items: center;
  gap: 0 var(--ft-space-2);
  padding: 0 var(--ft-space-1) var(--ft-space-2) var(--ft-space-3);
  border: 1px solid var(--ft-line);
  border-radius: var(--ft-radius);
  background: var(--ft-surface);
}
.sfpp-sol.is-selected { border-color: var(--ft-accent); box-shadow: inset 4px 0 0 var(--ft-accent); }
.sfpp-sol__pick { grid-area: pick; display: inline-flex; align-items: center; gap: var(--ft-space-2); min-height: var(--ft-target); color: var(--ft-ink); font-size: var(--ft-text-sm); font-weight: 650; font-variant-numeric: tabular-nums; cursor: pointer; }
.sfpp-sol__pick input { flex: none; width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--ft-accent); cursor: pointer; }
.sfpp-sol__pick input:focus-visible { outline: 3px solid var(--ft-focus); outline-offset: 2px; }
.sfpp-sol__info { grid-area: info; color: var(--ft-ink-2); font-size: var(--ft-text-sm); }
.sfpp-sol__remove { grid-area: remove; border-color: transparent; background: transparent; color: var(--ft-ink-2); }
.sfpp-add { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; align-items: end; gap: var(--ft-space-2) var(--ft-space-3); margin-bottom: var(--ft-space-2); }
.sfpp-add__title { grid-column: 1 / -1; margin: 0; color: var(--ft-ink); font-size: var(--ft-text-sm); font-weight: 650; }
@media (max-width: 26rem) { .sfpp-add { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sfpp-add .ft-btn { grid-column: 1 / -1; } }
.sfpp-tabs { margin-top: var(--ft-space-5); }
@media (max-width: 40rem) { .sfpp-tabs .ft-tab { padding: 0 var(--ft-space-3); } }
.sfpp-tabintro { margin: 0 0 var(--ft-space-3); color: var(--ft-ink-2); font-size: var(--ft-text-sm); }
.sfpp-cmp-controls { display: flex; flex-wrap: wrap; align-items: end; gap: var(--ft-space-3) var(--ft-space-5); margin-bottom: var(--ft-space-3); }
.sfpp-cmp-controls .ft-field { width: 8rem; }
.sfpp-tabpanel-gap, #sfpp-panel-compare .ft-tablewrap { margin-bottom: var(--ft-space-3); }
.sfpp-time__frame { --ft-chart-ratio: 16 / 9; --ft-chart-ratio-narrow: 4 / 3; }
.sfpp-values-actions { margin-top: var(--ft-space-3); }
.sfpp-steps { margin-top: var(--ft-space-3); }

/* Worked example */
.sfpp-example { margin-block: var(--ft-space-4); }
.sfpp-example .ft-example__step > p:not(.ft-example__label) { margin: var(--ft-space-2) 0 0; }
.sfpp-example .ft-example__step > .ft-example__label + p { margin-top: 0; }

@media print {
  .sfpp-toolbar, .sfpp-show, .sfpp-downloads, #sfpp-keys, #sfpp-dl-hint, .sfpp-add, .sfpp-area-side, .sfpp-params-slot, .sfpp-sol__remove, .sfpp-readout, .sfpp-linkbox, .sfpp-cmp-controls { display: none !important; }
  .sfpp-layout { display: block; }
  .sfpp-frame, .sfpp-eqitem, .sfpp-sol { break-inside: avoid; }
}

/* Mobile form controls (16px to prevent iOS Safari zoom) and 44px primary buttons */
@media screen and (max-width: 640px), screen and (hover: none) and (pointer: coarse) {
  .ft-tool input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  .ft-tool select,
  .ft-tool textarea,
  .ft-tool .ft-input,
  .ft-tool .ft-select,
  .ft-tool .ft-textarea,
  .ft-tool .ft-inputgroup > .ft-select.ft-inputgroup__unit {
    font-size: max(16px, 1rem);
  }
  .ft-tool .ft-btn--primary {
    min-height: 44px;
  }
}
