/* mechanism_polish.css — instructor bend editor */

.mech-polish .polish-auth {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #d8dde3;
}

.mech-polish .polish-auth .row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.5rem 0;
}

.mech-polish .polish-auth input[type="text"],
.mech-polish .polish-auth input[type="password"] {
  min-width: 10rem;
  flex: 1 1 8rem;
}

.mech-polish .mech-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: end;
  margin-bottom: 1.25rem;
}

.mech-polish .polish-back-wrap {
  margin: 0;
  flex: 1 1 100%;
}

.mech-polish .polish-back-link {
  font-size: 0.9rem;
  font-weight: 600;
}

/* Lone-pair / radical guides: visible, never steal arrow drags. */
.mech-polish .polish-hits .polish-tap-guide {
  pointer-events: none;
  cursor: default;
}

.mech-polish .polish-hits .mech-hit.lone_pair {
  background: rgba(90, 100, 115, 0.22);
}

.mech-polish .polish-step-field {
  display: block;
  margin: 0 0 1rem;
}

.mech-polish .polish-step-field > span {
  display: block;
  font-weight: 600;
  font-size: 0.92em;
  margin-bottom: 0.35rem;
}

/* One-click step picker (avoids native <select> open → hover → click). */
.mech-polish .polish-step-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mech-polish .polish-step-tab {
  flex: 1 1 auto;
  min-width: 2.5rem;
  margin: 0;
  padding: 0.4rem 0.55rem;
  border: 1px solid #c5ccd4;
  border-radius: 6px;
  background: #f7f8fa;
  color: #2a3340;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.mech-polish .polish-step-tab:hover {
  background: #eef2f6;
  border-color: #aeb6c0;
}

.mech-polish .polish-step-tab[aria-selected="true"] {
  background: #e8f0e6;
  border-color: #6a9a5a;
  color: #1e4a18;
  box-shadow: inset 0 0 0 1px rgba(106, 154, 90, 0.35);
}

.mech-polish .polish-step-tab:disabled {
  opacity: 0.45;
  cursor: default;
}

.mech-polish .polish-step-tab-id {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: #5a6570;
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9rem;
}

.mech-polish .polish-step-tab[aria-selected="true"] .polish-step-tab-id {
  color: #3a6a34;
}

.mech-polish .polish-bend-panel {
  margin: 0.75rem 0;
  padding: 0.75rem 0;
  border-top: 1px solid #e2e6eb;
  border-bottom: 1px solid #e2e6eb;
}

.mech-polish .polish-bend-readout {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.mech-polish .polish-end-readout {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: #5a6570;
}

.mech-polish .polish-fine-tune {
  margin-top: 0.65rem;
  font-size: 0.85rem;
  color: #5a6570;
}

.mech-polish .polish-fine-tune summary {
  cursor: pointer;
  user-select: none;
}

.mech-polish .polish-bend-panel .field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.5rem 0 0;
}

.mech-polish .polish-bend-panel input[type="range"] {
  width: 100%;
}

.mech-polish .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mech-polish .mech-overlay {
  /* Parent defaults to none; re-enable so shaft/handle hits receive drags. */
  pointer-events: auto;
}

.mech-polish .mech-overlay .mech-polish-arrow-hit {
  touch-action: none;
  pointer-events: stroke;
}

.mech-polish .mech-stage-body {
  touch-action: none;
  user-select: none;
}

.mech-polish .mech-arrow-list li.selected {
  outline: 2px solid #103cff;
  background: #eef2ff;
}

/* Selected: slightly lighter blue + bolder stroke. */
.mech-polish .mech-overlay .mech-polish-arrow.selected {
  stroke: #5b8cff;
  stroke-width: 2.4;
}

/* Invisible bend grab target at the curve apex (not a selection cue). */
.mech-polish .mech-overlay .mech-polish-handle {
  cursor: grab;
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
  touch-action: none;
}

.mech-polish .mech-overlay .mech-polish-handle:active {
  cursor: grabbing;
}

/* Visible start/end anchors on the selected arrow (center = tip). */
.mech-polish .mech-overlay .mech-polish-end-handle {
  pointer-events: all;
  touch-action: none;
}

.mech-polish .mech-overlay .mech-polish-end-hit {
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
}

.mech-polish .mech-overlay .mech-polish-end-mark {
  fill: #fff;
  stroke: #103cff;
  stroke-width: 1;
  pointer-events: none;
}

.mech-polish .mech-overlay .mech-polish-end-pip {
  fill: #103cff;
  stroke: none;
  pointer-events: none;
}

/* Multi-curve elbow (diamond) — drag to hand-route around atoms. */
.mech-polish .mech-overlay .mech-polish-waypoint-handle {
  pointer-events: all;
  touch-action: none;
  cursor: grab;
}

.mech-polish .mech-overlay .mech-polish-waypoint-handle:active {
  cursor: grabbing;
}

.mech-polish .mech-overlay .mech-polish-waypoint-hit {
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
}

.mech-polish .mech-overlay .mech-polish-waypoint-mark {
  fill: #fff;
  stroke: #5b8cff;
  stroke-width: 1.4;
  pointer-events: none;
}

.mech-polish .status {
  min-height: 1.25rem;
  font-size: 0.9rem;
  color: #3a4550;
}

.mech-polish .status.error {
  color: #a12622;
}

.mech-polish .status.ok {
  color: #0d6b3a;
}

.mech-polish .help {
  font-size: 0.85rem;
  color: #5a6570;
  margin-top: 0.75rem;
}
