/* KIRUPA scroll motion preview: the comparison panel from /scroll_preview/panel.js.
   A plain, opaque card (no backdrop blur, which would repaint on every scroll frame) in the
   page's own colors, at the bottom left so it stays clear of kirupaBot. */

.kmotion-panel {
  position: fixed;
  bottom: 12px;
  left: 12px;
  z-index: 190;
  box-sizing: border-box;
  width: min(300px, calc(100vw - 104px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 10px 12px 11px;
  border: 2px solid var(--structureBorder, #ddd);
  border-radius: 10px;
  background: var(--pageBackground, #fff);
  box-shadow: 0 8px 26px -10px rgba(0, 0, 0, .45);
  color: var(--bodyText, #333);
  font: 500 12.5px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0;
  text-align: left;
}
.kmotion-panel *,
.kmotion-panel *::before,
.kmotion-panel *::after {
  box-sizing: border-box;
}
/* Some styles set fonts on every paragraph and label; the tool keeps one plain face. */
html body .kmotion-panel,
html body .kmotion-panel * {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
}
.kmotion-panel.is-collapsed {
  width: auto;
  max-width: calc(100vw - 104px);
  padding: 6px 8px 6px 12px;
}
.kmotion-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
html body .kmotion-panel .kmotion-panel__title {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--darkText, #222);
  font: 700 13px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}
.kmotion-panel__body {
  margin-top: 8px;
}
.kmotion-panel__body[hidden] {
  display: none;
}
.kmotion-panel__row {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  margin: 5px 0;
}
.kmotion-panel__row[hidden] {
  display: none;
}
.kmotion-panel__label {
  color: var(--darkTextSecondary, #5b5b5b);
  font-size: 11.5px;
  font-weight: 600;
}
.kmotion-panel__set {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
html body .kmotion-panel button,
html body .kmotion-panel select {
  min-height: 26px;
  margin: 0;
  padding: 3px 7px;
  border: 1px solid var(--structureBorder, #ccc);
  border-radius: 6px;
  background: var(--pageBackground, #fff);
  box-shadow: none;
  color: var(--bodyText, #333);
  font: 600 11.5px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
html body .kmotion-panel button:hover,
html body .kmotion-panel select:hover {
  border-color: var(--primary, #0798ff);
}
html body .kmotion-panel button[aria-pressed="true"] {
  border-color: var(--primary, #0798ff);
  background: var(--primary, #0798ff);
  color: var(--textOnPrimary, #fff);
}
html body .kmotion-panel button:disabled {
  opacity: .5;
  cursor: default;
}
html body .kmotion-panel :is(button, select, a):focus-visible {
  outline: 2px solid var(--primary, #0798ff);
  outline-offset: 2px;
}
html body .kmotion-panel .kmotion-panel__toggle {
  min-height: 24px;
  padding: 2px 8px;
}
.kmotion-panel__note,
.kmotion-panel__reason,
.kmotion-panel__readout {
  margin: 7px 0 0;
  font-size: 11.5px;
}
.kmotion-panel__reason {
  color: var(--darkText, #222);
  font-weight: 700;
}
.kmotion-panel__reason[hidden] {
  display: none;
}
.kmotion-panel__readout {
  color: var(--darkTextSecondary, #5b5b5b);
  font-variant-numeric: tabular-nums;
}
.kmotion-panel__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
html body .kmotion-panel .kmotion-panel__link {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--linkForeground, #0071bf);
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: underline;
}
@media print {
  .kmotion-panel {
    display: none !important;
  }
}
