/* studio/media.css — THE MEDIA MANAGER (Wix: Add Elements > Media → My Uploads).
   Typography-only minimal, the Wix-light chrome: hairlines, one accent, no
   cards or chips inside cards. The panel reuses the studio's own tokens so the
   Media tab and the Add Elements tab read as one product. */

.media-manager {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 2px 2px 10px;
}
.media-manager.drag {
  outline: 1px dashed var(--accent);
  outline-offset: 3px;
}

.mm-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}
.mm-titles { min-width: 0; flex: 1 1 150px; }
.mm-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .01em;
}
.mm-sub {
  margin-top: 2px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--soft);
  overflow-wrap: anywhere;
}

.mm-primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 7px;
  padding: 6px 11px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex: none;
}
.mm-primary:hover { filter: brightness(1.04); }
.mm-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.mm-sources {
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--faint);
  overflow-wrap: anywhere;
}

/* the source chooser — Wix's left-side list inside + Upload Media:
   Your computer · My Wix Account · Connect · Import (the Link icon) */
.mm-uploader {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}
.mm-uploader[hidden] { display: none; }
.mm-source-rail {
  display: flex;
  gap: 13px;
  flex-wrap: wrap;
  min-width: 0;
  border-bottom: 1px solid var(--line);
}
.mm-source {
  all: unset;
  cursor: pointer;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--soft);
  padding: 4px 0;
  margin-bottom: -1px;
  border-bottom: 1px solid transparent;
}
.mm-source:hover { color: var(--ink); }
.mm-source.on { color: var(--ink); border-bottom-color: var(--accent); }
.mm-source:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mm-source-pane {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.mm-pick-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.mm-platform {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 6px;
}
.mm-platform-name { font-size: 12px; color: var(--ink); }
.mm-import-form { display: flex; align-items: stretch; gap: 6px; min-width: 0; }
.mm-import-form .mm-input { flex: 1 1 auto; width: auto; }
.mm-primary:disabled,
.mm-btn:disabled { opacity: .45; cursor: not-allowed; }

.mm-status {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--soft);
  min-height: 0;
}
.mm-status:empty { display: none; }
.mm-status.bad { color: var(--red); }

.mm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 7px;
  min-width: 0;
}
.mm-tile {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: var(--panel);
  min-width: 0;
}
.mm-tile:hover { border-color: var(--accent); }
.mm-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mm-tile.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.mm-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: var(--panel-2);
}
.mm-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 4px;
  box-sizing: border-box;
  font-size: 9.5px;
  line-height: 1.3;
  color: var(--faint);
  text-align: center;
  background: var(--panel-2);
  overflow-wrap: anywhere;
}
.mm-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 6px 5px;
  min-width: 0;
}
.mm-name {
  font-size: 10px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mm-badge {
  font-size: 8.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--faint);
}
.mm-badge.ok { color: var(--green, #2ba45e); }
.mm-badge.bad { color: var(--red); }

.mm-detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 9px;
  min-width: 0;
}
.mm-preview-wrap { min-width: 0; }
.mm-preview {
  width: 100%;
  max-height: 170px;
  object-fit: contain;
  display: block;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
}
.mm-fields { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.mm-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mm-label {
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--soft);
}
.mm-input {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 9px;
  font: inherit;
  font-size: 12px;
}
.mm-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.mm-hint {
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--faint);
  overflow-wrap: anywhere;
}
.mm-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mm-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--soft);
  border-radius: 7px;
  padding: 6px 11px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.mm-btn:hover { color: var(--ink); border-color: var(--accent); }
