/* CLAUDE 10-06: the editor's media bin and recorder (mediabin.js). Quiet editor palette (editor.css --q-*), green only
   for the focus ring; tiles keep a fixed 16:9 picture so nothing jumps while thumbnails load. */
.mb {
  --mb-ease: cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  display: grid;
  gap: 10px;
}
.mb-top {
  display: flex;
  gap: 8px;
}
.mb-import,
.mb-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--q-line, #2c2c31);
  border-radius: 8px;
  background: var(--q-raise, #1c1c20);
  color: var(--q-ink, #f3f2ee);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    transform 120ms var(--mb-ease);
}
body main .mb-import {
  flex: 1;
  border-color: var(--q-ink, #f3f2ee);
  background: var(--q-ink, #f3f2ee);
  color: var(--q-ink-ink, #0b0b0d);
}
.mb-import:hover {
  background: #fff;
}
.mb-ghost:hover {
  border-color: #3a3a40;
  background: var(--q-raise-hover, #26262b);
}
.mb-import:active,
.mb-ghost:active {
  transform: scale(0.97);
}
/* segmented filters */
.mb-seg {
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--q-line, #2c2c31);
  border-radius: 8px;
  background: #111113;
}
.mb-seg button {
  flex: 1;
  min-width: 0;
  min-height: 28px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--q-soft, #a1a1aa);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}
.mb-seg button:hover {
  color: var(--q-ink, #f3f2ee);
}
.mb-seg [aria-pressed='true'],
.mb-seg [aria-checked='true'] {
  background: var(--q-raise-hover, #26262b);
  color: var(--q-ink, #f3f2ee);
}
.mb-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.mb-scope {
  grid-column: 1 / -1;
}
.mb-tools input,
.mb-tools select {
  width: 100%;
  min-height: 32px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--q-line, #2c2c31);
  border-radius: 8px;
  background: #111113;
  color: var(--q-ink, #f3f2ee);
  font: inherit;
  font-size: 12px;
}
.mb-tools label {
  margin: 0;
}
/* the grid and its tiles */
.mb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px 8px;
}
.mb-tile {
  position: relative;
  min-width: 0;
}
.mb-main {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
}
.mb-main:active {
  transform: none; /* the global button press would shift the grid; the thumb scales instead */
}
.mb-main:active .mb-thumb {
  transform: scale(0.97);
}
.mb-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid #26262a;
  border-radius: 8px;
  background: #18181b;
  transition:
    border-color 150ms ease,
    transform 120ms var(--mb-ease);
}
.mb-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 200ms ease;
}
.mb-loaded .mb-thumb img {
  opacity: 1;
}
.mb-broken .mb-thumb img {
  visibility: hidden;
}
.mb-thumb.mb-picture {
  background: repeating-conic-gradient(#1d1d20 0 25%, #151517 0 50%) 0 0 / 12px 12px;
}
.mb-thumb.mb-picture img {
  object-fit: contain;
}
.mb-wave {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(90deg, transparent 0 5px, #ffffff0d 5px 7px) center / 100% 46% no-repeat,
    linear-gradient(160deg, #24202e, #18171c);
  color: #c9c3dd;
}
.mb-wave svg {
  width: 26px;
  height: 26px;
}
.mb-dur {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #000b;
  color: #fff;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 16px;
}
.mb-used {
  position: absolute;
  left: 5px;
  bottom: 5px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #000b;
  color: #fff;
}
.mb-used svg {
  width: 12px;
  height: 12px;
}
.mb-hover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 6px;
  background: #000a;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transition: opacity 150ms ease;
}
.mb-hover svg {
  flex: none;
  width: 14px;
  height: 14px;
}
@media (hover: hover) and (pointer: fine) {
  .mb-main:hover .mb-thumb {
    border-color: #4a4a52;
  }
  .mb-main:hover .mb-hover {
    opacity: 1;
  }
}
.mb-main:focus-visible .mb-hover {
  opacity: 1;
}
.mb-name {
  overflow: hidden;
  padding-right: 26px;
  color: #bdbdc2;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.mb-more {
  position: absolute;
  right: -4px;
  bottom: -6px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--q-soft, #a1a1aa);
  cursor: pointer;
}
.mb-more:hover,
.mb-more[aria-expanded='true'] {
  background: var(--q-raise-hover, #26262b);
  color: var(--q-ink, #f3f2ee);
}
.mb-tile[aria-busy='true'] {
  opacity: 0.5;
  pointer-events: none;
}
.mb-new .mb-thumb {
  animation: mb-new 1.4s ease-out;
}
@keyframes mb-new {
  0%,
  40% {
    border-color: var(--q-ink, #f3f2ee);
    box-shadow: 0 0 0 2px #f3f2ee40;
  }
}
/* loading skeletons */
.mb-skel .mb-thumb,
.mb-skel i {
  background: linear-gradient(90deg, #18181b 30%, #232327 50%, #18181b 70%) 0 0 / 300% 100%;
  animation: mb-shine 1.2s linear infinite;
}
.mb-skel i {
  display: block;
  width: 70%;
  height: 10px;
  margin-top: 6px;
  border-radius: 4px;
}
@keyframes mb-shine {
  to {
    background-position: -150% 0;
  }
}
/* empty and error states */
.mb-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 22px 12px;
  border: 1px dashed #34343a;
  border-radius: 12px;
  color: var(--q-soft, #a1a1aa);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}
.mb-empty[hidden] {
  display: none;
}
.mb-empty p {
  max-width: 30ch;
  margin: 0;
}
.mb-empty b {
  color: var(--q-ink, #f3f2ee);
}
.mb-empty-art {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--q-raise, #1c1c20);
  color: var(--q-ink, #f3f2ee);
}
.mb-empty-go {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
/* upload rows */
.mb-queue {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mb-queue:empty {
  display: none;
}
.mb-q {
  display: grid;
  gap: 4px;
  padding: 8px 6px 8px 10px;
  border: 1px solid var(--q-line, #2c2c31);
  border-radius: 8px;
  background: #111113;
}
.mb-q-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mb-q-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.mb-q-x {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--q-soft, #a1a1aa);
  cursor: pointer;
}
.mb-q-x:hover {
  background: var(--q-raise-hover, #26262b);
  color: var(--q-ink, #f3f2ee);
}
.mb-q-x svg {
  width: 14px;
  height: 14px;
}
.mb-q-bar {
  height: 3px;
  margin-right: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: #26262a;
}
.mb-q-bar i {
  display: block;
  height: 100%;
  background: var(--q-ink, #f3f2ee);
  transition: width 200ms linear;
}
.mb-q small {
  color: var(--q-soft, #a1a1aa);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.mb-q-error .mb-q-bar i {
  background: #ff6a6a;
}
.mb-q-error small {
  color: #ff8a8a;
}
/* storage meter (Spaces) */
.mb-meter {
  display: grid;
  gap: 6px;
  padding-top: 4px;
  color: var(--q-soft, #a1a1aa);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.mb-meter-bar {
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: #26262a;
}
.mb-meter-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: var(--q-ink, #f3f2ee);
  transition: width 300ms var(--mb-ease);
}
.mb-full .mb-meter-bar i {
  background: #ffd400;
}
/* "Open another video or project": the old Import controls (ids unchanged, app.js drives them) */
.mb-open {
  border-top: 1px solid var(--q-line, #2c2c31);
  padding-top: 8px;
}
.mb-open summary {
  min-height: 32px;
  display: flex;
  align-items: center;
  color: var(--q-soft, #a1a1aa);
  font-size: 12px;
  cursor: pointer;
}
.mb-open summary:hover {
  color: var(--q-ink, #f3f2ee);
}
.mb-open-body {
  display: grid;
  gap: 10px;
  padding-top: 6px;
}
/* files dragged over the bin */
.mb-cover {
  position: absolute;
  inset: -6px;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 2px dashed var(--q-ink, #f3f2ee);
  border-radius: 12px;
  background: #0b0b0de6;
  color: var(--q-ink, #f3f2ee);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}
.mb-cover div {
  display: grid;
  justify-items: center;
  gap: 4px;
}
.mb-cover small {
  color: var(--q-soft, #a1a1aa);
}
.mb-dropping .mb-cover {
  opacity: 1;
}
/* a tile dragged over the timeline or the preview */
body.mb-dragging #tlTracks,
body.mb-dragging .preview-wrap {
  outline: 1px dashed #f3f2ee55;
  outline-offset: -1px;
}
body.mb-dragging .mb-drop-here {
  outline: 2px solid var(--q-ink, #f3f2ee);
  outline-offset: -2px;
}
/* the ⋯ menu */
.mb-menu {
  position: fixed;
  z-index: 60;
  display: grid;
  min-width: 180px;
  padding: 4px;
  border: 1px solid #333338;
  border-radius: 10px;
  background: #1a1a1d;
  box-shadow: 0 18px 50px #000a;
  animation: mb-pop 140ms var(--mb-ease, ease-out);
}
@keyframes mb-pop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}
.mb-menu button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--q-ink, #f3f2ee);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.mb-menu button:hover,
.mb-menu button:focus-visible {
  background: #2a2a2f;
  outline: none;
}
.mb-menu .mb-danger {
  color: #ff6a6a;
}
.mb-toast-go {
  margin-left: 10px;
  padding: 4px 10px;
  border: 1px solid #ffffff55;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
/* Record */
.mb-rec {
  display: grid;
  gap: 10px;
}
.mb-modes button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
}
.mb-modes button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.mb-modes svg {
  flex: none;
  width: 15px;
  height: 15px;
}
.mb-recview {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid #26262a;
  border-radius: 10px;
  background: #0d0d0f;
}
.mb-recview video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.mb-recview video.mb-mirror {
  transform: scaleX(-1);
}
.mb-recview p {
  position: relative;
  max-width: 28ch;
  margin: 0;
  padding: 0 12px;
  color: var(--q-soft, #a1a1aa);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}
.mb-recview p[hidden],
.mb-live[hidden] {
  display: none;
}
.mb-live {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 4px;
  background: #000b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}
.mb-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff453a;
  animation: mb-blink 1s steps(2, start) infinite;
}
@keyframes mb-blink {
  to {
    visibility: hidden;
  }
}
.mb-recbar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mb-recgo {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--q-line, #2c2c31);
  border-radius: 8px;
  background: var(--q-raise, #1c1c20);
  color: var(--q-ink, #f3f2ee);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    transform 120ms var(--mb-ease, ease-out);
}
.mb-recgo:hover {
  background: var(--q-raise-hover, #26262b);
}
.mb-recgo:active {
  transform: scale(0.97);
}
.mb-recgo:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.mb-recgo svg {
  width: 14px;
  height: 14px;
}
.mb-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff453a;
}
.mb-sq {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #fff;
}
.mb-recgo.mb-stop {
  border-color: #b3261e;
  background: #b3261e;
}
.mb-recgo.mb-stop:hover {
  background: #c62f26;
}
.mb-rectime {
  color: var(--q-soft, #a1a1aa);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.mb-recording .mb-rectime {
  color: var(--q-ink, #f3f2ee);
}
.mb-recmsg {
  min-height: 1.4em;
  margin: 0;
  color: #cfcfd4;
  font-size: 12px;
}
.mb-recmsg:empty {
  display: none;
}
/* phones and touch: 44 px targets, the ⋯ always reachable */
@media (pointer: coarse) {
  .mb-import,
  .mb-ghost,
  .mb-recgo {
    min-height: 44px;
  }
  .mb-seg button,
  .mb-tools input,
  .mb-tools select,
  .mb-open summary,
  .mb-menu button {
    min-height: 44px;
  }
  .mb-more,
  .mb-q-x {
    width: 44px;
    height: 44px;
  }
  .mb-more {
    right: -10px;
    bottom: -14px;
  }
  .mb-name {
    padding-right: 34px;
    line-height: 30px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mb-skel .mb-thumb,
  .mb-skel i,
  .mb-new .mb-thumb,
  .mb-menu,
  .mb-live i {
    animation: none;
  }
  .mb-main:active .mb-thumb,
  .mb-import:active,
  .mb-ghost:active,
  .mb-recgo:active {
    transform: none;
  }
}
