/* FEA reveal slider (see fea-slider.js). Each option sets the custom properties to its own look. */
.fea-slider {
  display: grid;
  gap: 16px;
  color: var(--fea-ink, currentColor);
}
.fea-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.fea-tab {
  font: 500 13px/1 var(--fea-mono, ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace);
  letter-spacing: 0.04em;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--fea-line, color-mix(in srgb, currentColor 22%, transparent));
  border-radius: var(--fea-radius, 0px);
  background: transparent;
  color: var(--fea-muted, color-mix(in srgb, currentColor 62%, transparent));
  cursor: pointer;
}
.fea-tab[aria-pressed="true"] { color: var(--fea-ink, currentColor); border-color: var(--fea-accent, currentColor); }
.fea-tab:focus-visible { outline: 2px solid var(--fea-accent, currentColor); outline-offset: 2px; }

.fea-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; }

/* legend: banded bar, every band edge numbered */
.fea-legend { font: 12px/1.2 var(--fea-mono, ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace); min-width: 0; }
.fea-legend__title { margin: 0 0 10px; color: var(--fea-ink, currentColor); max-width: 11em; }
.fea-legend__bar { list-style: none; margin: 0; padding: 0; }
.fea-legend__peak { margin: 14px 0 0; color: var(--fea-muted, color-mix(in srgb, currentColor 62%, transparent)); max-width: 13em; }
.fea-legend__band {
  position: relative;
  width: 18px;
  height: 22px;
  background: var(--band);
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.35);
}
.fea-legend__band--end { height: 0; }
.fea-legend__num {
  position: absolute;
  left: 26px;
  top: 0;
  transform: translateY(-50%);
  white-space: nowrap;
  color: var(--fea-muted, color-mix(in srgb, currentColor 62%, transparent));
  font-variant-numeric: tabular-nums;
}

.fea-stage {
  --pos: 72%;
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  touch-action: pan-y;
  user-select: none;
}
.fea-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fea-top { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
/* the stress plot has no roof or screen: clip the model too, or it shows through the gaps */
.fea-img--base { clip-path: inset(0 0 0 var(--pos)); }
.fea-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 0;
  border-left: 1.5px solid var(--fea-accent, currentColor);
  pointer-events: none;
}
.fea-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -15px;
  width: 26px;
  height: 26px;
  margin-top: -14px;
  border-radius: 50%;
  border: 1.5px solid var(--fea-accent, currentColor);
  background: var(--fea-knob, transparent);
  backdrop-filter: blur(2px);
}
.fea-handle::before {
  content: "\2039\00a0\203a";
  position: absolute;
  top: 50%;
  left: -15px;
  width: 29px;
  transform: translateY(-50%);
  text-align: center;
  font: 600 14px/1 var(--fea-mono, ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace);
  color: var(--fea-accent, currentColor);
  z-index: 1;
}
.fea-tag {
  position: absolute;
  top: 8px;
  font: 11px/1 var(--fea-mono, ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fea-muted, color-mix(in srgb, currentColor 62%, transparent));
  pointer-events: none;
}
.fea-tag--l { left: 8px; }
.fea-tag--r { right: 8px; }
@media (max-width: 640px) { .fea-tag { display: none; } }
.fea-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
}
.fea-stage:has(.fea-range:focus-visible) .fea-handle::after { outline: 2px solid var(--fea-accent, currentColor); outline-offset: 3px; }

/* peak marker: above the wipe, shown only once the handle has passed it (fea-slider.js) */
.fea-peak {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  border: 2px solid var(--fea-label-ink, #f2f3f5);
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.fea-peak__label {
  position: absolute;
  left: 18px;
  bottom: 16px;
  white-space: nowrap;
  font: 12px/1 var(--fea-mono, ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace);
  color: var(--fea-label-ink, #f2f3f5);
  padding: 4px 6px;
  background: var(--fea-label-bg, rgba(10, 12, 14, 0.72));
}

.fea-peak--left .fea-peak__label { left: auto; right: 18px; }
.fea-peak[data-off] { opacity: 0; }
.fea-peak { transition: opacity 0.15s; }

.fea-note { margin: 0; font: 12px/1.4 var(--fea-mono, ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace); color: var(--fea-muted, color-mix(in srgb, currentColor 62%, transparent)); }
.fea-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fea-slider--failed .fea-body, .fea-slider--failed .fea-tabs { display: none; }

@media (max-width: 640px) {
  .fea-body { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .fea-legend { order: 2; }
  .fea-legend__title, .fea-legend__peak { max-width: none; }
  /* horizontal bar on phones: low on the left */
  .fea-legend__bar { display: flex; flex-direction: row-reverse; justify-content: flex-end; padding: 0 18px 20px 12px; }
  .fea-legend__band { width: 10%; height: 14px; flex: none; }
  .fea-legend__band--end { width: 0; height: 14px; }
  .fea-legend__num { left: auto; right: 0; top: auto; bottom: -18px; transform: translateX(50%); font-size: 10px; }
  .fea-legend__band:nth-child(even):not(.fea-legend__band--end) .fea-legend__num { visibility: hidden; }
}
