.rat-motion-svg {
  max-inline-size: 100%;
  margin: 0;
  padding: 0;
  contain: inline-size;
  overflow: clip;
  color: var(--rat-color-ink, currentColor);
  background: transparent;
  border: 0;
}

.rat-motion-svg__canvas {
  display: block;
  inline-size: 100%;
  block-size: auto;
  max-inline-size: 100%;
  overflow: hidden;
}

.rat-motion-svg__line,
[data-rat-motion-svg-draw] {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.rat-motion-svg__line[data-rat-line-hierarchy="quiet"] { opacity: .55; }
.rat-motion-svg__line[data-rat-line-hierarchy="strong"] { stroke-width: 2; }

.rat-motion-svg__object,
[data-rat-motion-svg-follower] {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.rat-motion-svg__morph,
[data-rat-motion-svg-morph] {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.rat-motion-svg__route-label,
[data-rat-motion-svg-text-path] {
  fill: currentColor;
  font: 600 .6875rem/1 var(--rat-font-sans, sans-serif);
  letter-spacing: .04em;
}

.rat-motion-svg__masked,
.rat-motion-svg__matted {
  fill: currentColor;
  stroke: currentColor;
  vector-effect: non-scaling-stroke;
}

.rat-motion-svg__controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rat-space-2, .5rem);
  margin-block-start: var(--rat-space-3, .75rem);
}

.rat-motion-svg__controls button {
  max-inline-size: 100%;
  overflow-wrap: anywhere;
}

.rat-motion-svg figcaption {
  margin-block-start: var(--rat-space-3, .75rem);
  color: var(--rat-color-muted, currentColor);
  font: 400 var(--rat-text-ui, .875rem)/1.45 var(--rat-font-sans, sans-serif);
}

@media (max-width: 320px) {
  .rat-motion-svg__canvas { min-inline-size: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .rat-motion-svg * { transition: none !important; animation: none !important; }
}

@media (forced-colors: active) {
  .rat-motion-svg { color: CanvasText; forced-color-adjust: auto; }
  .rat-motion-svg__controls button { border-color: CanvasText; color: ButtonText; background: ButtonFace; }
}

@media print {
  .rat-motion-svg [data-rat-motion-svg-draw] { stroke-dasharray: none !important; stroke-dashoffset: 0 !important; }
  .rat-motion-svg__masked { mask: none !important; }
  .rat-motion-svg__matted { clip-path: none !important; }
  .rat-motion-svg__controls { display: none; }
}
