/* Short task loops in the user guide, the workflow guides and the homepage: GIF-like, silent, a few seconds each. */
.mb-loop {
  margin: 16px 0 20px;
  max-width: 100%;
}
.mb-loop-square { max-width: 440px; }
.mb-loop-frame {
  position: relative;
  line-height: 0;
}
.mb-loop-video {
  display: block;
  width: 100%;
  height: auto;
  background: var(--sheet, #202022);
  border: 1px solid var(--line, #333336);
  border-radius: 8px;
}
.mb-loop-toggle {
  /* Under the loop at the caption's right end, so it never covers the interface being shown. */
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line-strong, #4a4a4e);
  border-radius: 6px;
  background: var(--panel, #1f1f21);
  color: var(--text, #f2f2f2);
  cursor: pointer;
  line-height: 1;
}
.mb-loop-toggle:hover { background: #2c2c2f; }
.mb-loop-toggle:focus-visible {
  outline: 3px solid var(--focus, #ffb499);
  outline-offset: 2px;
}
/* Pause: two bars; Play: a triangle. Drawn in CSS so the button needs no image. */
.mb-loop-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 12px;
  transform: translate(-50%, -50%);
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
  box-sizing: border-box;
}
.mb-loop-toggle[data-state="paused"] .mb-loop-icon {
  width: 0;
  height: 0;
  margin-left: 1px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid currentColor;
  border-right: 0;
}
.mb-loop-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.mb-loop figcaption {
  margin-top: 8px;
  min-height: 32px;
  padding-right: 44px;
  color: var(--text-3, #96969c);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
/* Homepage: the four panel loops after the product tour, one per row with its text beside it. The side
   alternates (loop first, then text first), and the Stream Deck row that follows, loop on the left,
   continues the pattern. */
.mb-loop-rows {
  display: grid;
  gap: clamp(48px, 6vw, 88px);
  margin-top: clamp(56px, 7vw, 96px);
}
.mb-loop-row {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  column-gap: clamp(28px, 5vw, 72px);
  margin: 0;
  max-width: none;
}
.mb-loop-row .mb-loop-frame { grid-column: 1; grid-row: 1; margin-bottom: 40px; }
.mb-loop-row figcaption {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  margin: 0 0 40px;
  padding: 0;
  color: var(--text-2, #b8b8bd);
  font-size: 1.0625rem;
  line-height: 1.6;
}
.mb-loop-row:nth-child(even) { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.mb-loop-row:nth-child(even) .mb-loop-frame { grid-column: 2; }
.mb-loop-row:nth-child(even) figcaption { grid-column: 1; }
.mb-loop-row figcaption p { margin: 0; max-width: 42ch; }
.mb-loop-row-title {
  margin: 0 0 14px;
  color: var(--text, #f2f2f2);
  font: 350 clamp(1.5rem, 1.1rem + 1vw, 2rem)/1.08 var(--font-display, inherit);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.mb-loop-craft { max-width: 760px; margin-top: 28px; }
@media (max-width: 720px) {
  .mb-loop-row, .mb-loop-row:nth-child(even) { grid-template-columns: minmax(0, 1fr); }
  .mb-loop-row .mb-loop-frame, .mb-loop-row:nth-child(even) .mb-loop-frame { grid-column: 1; grid-row: 1; margin-bottom: 0; }
  .mb-loop-row figcaption, .mb-loop-row:nth-child(even) figcaption { grid-column: 1; grid-row: 2; margin: 8px 0 0; padding-right: 44px; }
  .mb-loop-row-title { margin-bottom: 8px; }
}
/* A caption kept for screen readers only, where the text beside the loop already explains it. */
.mb-loop .mb-loop-caption-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* Homepage hero: the loop fills the product frame and its button sits in the frame's lower right corner. */
.mb-home .mb-hero-stage .mb-v3-product { position: relative; }
.mb-loop-hero { margin: 0; max-width: none; }
.mb-loop-hero .mb-loop-frame { position: static; }
.mb-loop-hero .mb-loop-video { border: 0; border-radius: 0; }
.mb-loop-hero .mb-loop-toggle { top: auto; bottom: 12px; right: 12px; }
/* The three points under the notes demo each open with a small square loop; the button sits under it. */
.mb-loop-point { margin: 0 0 14px; max-width: 100%; }
.mb-loop-point .mb-loop-frame { margin-bottom: 52px; }
/* The Stream Deck loop replaced a framed picture; its own border is the frame, so the homepage card adds none. */
.mb-home [data-mb-feature-visual] > div:has(> .mb-loop) { border: 0 !important; border-radius: 0 !important; background: none !important; }
@media (max-width: 640px) {
  /* Like the picture it replaces: on a phone, the left part of the panel at reading size. */
  .mb-home .mb-hero-stage .mb-v3-product .mb-loop-hero .mb-loop-video { width: 190%; max-width: none; }
}
@media (forced-colors: active) {
  .mb-loop-video { border-color: CanvasText; }
  .mb-loop-toggle { border-color: ButtonText; background: ButtonFace; color: ButtonText; forced-color-adjust: none; }
}
