/* "Tools & modes" pages: hero loops, controls tables, tool cards. */
:root {
  --ml-tools-bg: #f7faf9;
  --ml-tools-teal: #0f766e;
  --ml-tools-accent: #d97706;
  --ml-tools-line: rgba(15, 118, 110, 0.18);
}

[data-md-color-scheme="slate"] {
  --ml-tools-bg: #05100f;
  --ml-tools-teal: #5eead4;
  --ml-tools-accent: #f59e0b;
  --ml-tools-line: rgba(20, 184, 166, 0.22);
}

.md-typeset .ml-hero {
  margin: 0.4em 0 0.6em;
  border: 1px solid var(--ml-tools-line);
  border-radius: 0.6rem;
  overflow: hidden;
  background: var(--ml-tools-bg);
  aspect-ratio: 16 / 10;
}

.md-typeset .ml-hero video,
.md-typeset .ml-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
}

.md-typeset .ml-hero--still {
  aspect-ratio: auto;
}

.md-typeset .ml-hero--still img {
  height: auto;
}

.md-typeset .ml-hero--square {
  aspect-ratio: 1 / 1;
  max-width: 400px;
}

/* Reduced motion: poster only, no playback. */
.md-typeset .ml-hero .ml-loop-poster {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .md-typeset .ml-hero video.ml-loop {
    display: none;
  }

  .md-typeset .ml-hero .ml-loop-poster {
    display: block;
  }
}

.md-typeset .ml-caption {
  margin-top: 0;
  font-size: 0.95em;
}

/* Themed stills: show the one matching the docs theme. */
[data-md-color-scheme="slate"] .md-typeset .ml-only-light,
[data-md-color-scheme="default"] .md-typeset .ml-only-dark {
  display: none !important;
}

.md-typeset .ml-icon {
  width: 16px;
  height: 16px;
  vertical-align: -0.2em;
  color: var(--ml-tools-teal);
}

.md-typeset .ml-controls table {
  display: table;
  width: 100%;
  font-size: 0.8rem;
}

.md-typeset .ml-controls td:first-child,
.md-typeset .ml-controls th:first-child {
  width: 1.6rem;
  padding-right: 0;
}

.md-typeset .ml-controls td:nth-child(2) {
  white-space: nowrap;
  font-weight: 600;
}

.md-typeset .ml-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.7rem;
  margin: 1em 0 1.4em;
}

.md-typeset .ml-card {
  display: block;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--ml-tools-line);
  border-radius: 0.5rem;
  background: var(--ml-tools-bg);
  color: inherit;
  text-decoration: none;
  transition: border-color 120ms ease;
}

.md-typeset a.ml-card,
.md-typeset a.ml-card:hover {
  color: inherit;
  text-decoration: none;
}

.md-typeset .ml-card:hover,
.md-typeset .ml-card:focus-visible {
  border-color: var(--ml-tools-teal);
}

.md-typeset .ml-card__title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--ml-tools-teal);
}

.md-typeset .ml-card__hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  line-height: 1.45;
  opacity: 0.85;
}

.md-typeset .ml-card kbd {
  margin-left: auto;
  font-size: 0.7rem;
}

.md-typeset .ml-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: var(--ml-tools-accent);
  color: #1a1206;
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: 0.05em;
}

.md-typeset .ml-controls th,
.md-typeset .ml-controls td {
  padding: 0.55em 0.9em;
}
