/* Step-by-step interactive kinematic constructions (kinwidgets.js). */
.kw-widget {
  margin: 1.2em 0;
  border: 1px solid var(--pst-color-border, #ccc);
  border-radius: 6px;
  background: #fff;
  color: #222;
  overflow: hidden;
}

.kw-main {
  position: relative;
}

.kw-board {
  width: 100%;
  aspect-ratio: var(--kw-aspect, 4 / 3);
  max-height: 560px;
}

/* Auxiliary polygon of Kennedy's theorem, over the top right corner. */
.kw-side {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ddd;
  border-radius: 6px;
  pointer-events: none;
}

.kw-side svg {
  display: block;
  width: 104px;
  height: 104px;
}

.kw-caption {
  padding: 0.6em 0.9em;
  border-top: 1px solid #eee;
  min-height: 4.5em;
  font-size: 0.95em;
  line-height: 1.45;
  background: #fafafa;
}

.kw-caption .kw-step-title {
  font-weight: bold;
  margin-right: 0.4em;
}

.kw-caption .kw-values {
  display: block;
  margin-top: 0.3em;
  font-family: var(--pst-font-family-monospace, monospace);
  font-size: 0.92em;
  color: #0b5394;
}

.kw-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5em 0.8em;
  padding: 0.5em 0.9em;
  border-top: 1px solid #eee;
}

.kw-controls button {
  padding: 0.25em 0.8em;
  border: 1px solid #999;
  border-radius: 4px;
  background: #f3f3f3;
  color: #222;
  cursor: pointer;
}

.kw-controls button:disabled {
  opacity: 0.4;
  cursor: default;
}

.kw-controls label {
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.9em;
}

.kw-controls input[type="range"] {
  width: 160px;
}

.kw-progress {
  font-size: 0.85em;
  color: #666;
  margin-left: auto;
}

.kw-hint {
  font-size: 0.8em;
  color: #777;
  padding: 0 0.9em 0.5em;
}
