.element-frame {
  display: contents;
}

.element-form {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.element-note {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.element-subhead {
  font-size: var(--text-sm);
  font-weight: 600;
}

/* The Positions panel's row of position and rig drawings
   (Views::Elements::PositionsPanel). */
.position-drawings {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-3);
}

.element-percent-input {
  width: 5rem;
}

/* The muscle activation lists (Views::Elements::MusclesPanel and the
   shared ElementMuscleActivations::Fields): up to two columns, each at
   least wide enough for a row's presets and input, one on a phone. */
.muscle-columns {
  columns: 2 24rem;
  column-gap: var(--space-6);
}

.muscle-columns-group {
  break-inside: avoid;
  padding-bottom: var(--space-3);
}

/* The activation form's slider (ElementMuscleActivations::Fields): the
   Muscles panel's meter (ui/meter.css: its height, sunken ground and good
   tone) with a thumb to drag, driven by range_slider_controller.js, which
   sets the fill's left and right. */
.muscle-slider-track {
  position: relative;
  height: var(--tap-dense);
}

.muscle-slider-rail {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: var(--space-2);
  transform: translateY(-50%);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
}

.muscle-slider-fill {
  position: absolute;
  top: 50%;
  left: 0;
  right: 100%;
  height: var(--space-2);
  transform: translateY(-50%);
  border-radius: var(--radius-sm);
  background: var(--good);
  pointer-events: none;
}

.muscle-slider-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.muscle-slider-thumb::-webkit-slider-runnable-track {
  height: var(--space-2);
  background: transparent;
}

.muscle-slider-thumb::-moz-range-track {
  height: var(--space-2);
  background: transparent;
}

.muscle-slider-thumb::-webkit-slider-thumb {
  appearance: none;
  width: var(--space-4);
  height: var(--space-4);
  margin-top: calc((var(--space-2) - var(--space-4)) / 2);
  border: var(--line-width) solid var(--surface);
  border-radius: 50%;
  background: var(--good);
  box-shadow: var(--shadow);
}

.muscle-slider-thumb::-moz-range-thumb {
  width: var(--space-4);
  height: var(--space-4);
  border: var(--line-width) solid var(--surface);
  border-radius: 50%;
  background: var(--good);
  box-shadow: var(--shadow);
}

.muscle-slider-thumb:focus-visible {
  outline: none;
}

.muscle-slider-thumb:focus-visible::-webkit-slider-thumb {
  outline: var(--line-width) solid var(--focus);
  outline-offset: var(--space-1);
}

.muscle-slider-thumb:focus-visible::-moz-range-thumb {
  outline: var(--line-width) solid var(--focus);
  outline-offset: var(--space-1);
}

/* The skill reference under the Skill input (Components::SkillReference):
   the note and the family's ratings, set a step apart from the input. */
.skill-reference {
  display: grid;
  gap: var(--space-1);
  margin-top: var(--space-1);
}

.archetype-picker-search {
  margin-bottom: var(--space-3);
}

.archetype-picker-clear {
  margin-bottom: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: var(--line-width) solid var(--line);
}

.archetype-picker-divider {
  border-top: var(--line-width) solid var(--line);
  margin: var(--space-3) 0 var(--space-2);
  padding-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

.archetype-picker-item {
  border: var(--line-width) solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
}

.archetype-picker-item-current {
  border: 2px solid var(--accent);
  background: var(--surface-sunken);
}

.archetype-picker-choice {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  text-align: left;
  cursor: pointer;
}

.archetype-picker-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.archetype-picker-detail {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

/* Views::Elements::EquipmentFields: a movement's equipment as rows of
   alternatives ("Needs"), then the rest of the catalog ("Add equipment"). */
.equipment-fields {
  display: grid;
  gap: var(--space-3);
}

.equipment-rows {
  display: grid;
  flex-basis: 100%;
  gap: var(--space-2);
}

/* A row wraps: its pieces first, its actions after, so at a phone's width
   the actions drop to their own line instead of squeezing the pieces. */
.equipment-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2);
  border: var(--line-width) solid var(--line);
  border-radius: var(--radius-md);
}

.equipment-row-pieces {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  min-width: 0;
}

.equipment-catalog {
  display: flex;
  flex-basis: 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
}

.equipment-piece {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

/* The word between alternatives in a row ("Bench or Box"). */
.equipment-or {
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

/* What the last move did ("Box added as an alternative to Bench"), for a
   screen reader and as a quiet line for everyone else. */
.equipment-status {
  min-height: 1lh;
  color: var(--ink-muted);
  font-size: var(--text-sm);
}
